host-pro / index.html
docto41's picture
Add 3 files
17db3d1 verified
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hébergement Web Haute Performance</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script src="https://js.stripe.com/v3/"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Inter', sans-serif;
background-color: #f8fafc;
}
.gradient-bg {
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
}
.hosting-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.availability-badge {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { opacity: 0.8; }
50% { opacity: 1; }
100% { opacity: 0.8; }
}
.sidebar {
transition: all 0.3s ease;
}
.cart-item {
transition: all 0.2s ease;
}
.cart-item:hover {
background-color: #f3f4f6;
}
@media (max-width: 768px) {
.sidebar {
transform: translateX(-100%);
}
.sidebar.open {
transform: translateX(0);
}
}
</style>
</head>
<body class="min-h-screen">
<!-- Login/Signup Modal -->
<div id="authModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-xl p-6 w-full max-w-md">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-medium">Connexion / Inscription</h3>
<button id="closeAuthModal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Email</label>
<input type="email" id="authEmail" class="w-full px-3 py-2 border border-gray-300 rounded-md">
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Mot de passe</label>
<input type="password" id="authPassword" class="w-full px-3 py-2 border border-gray-300 rounded-md">
</div>
<div class="flex justify-between items-center mb-6">
<button id="loginBtn" class="px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700">
Connexion
</button>
<button id="signupBtn" class="px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700">
Inscription
</button>
</div>
<p class="text-sm text-gray-500">Vous devez être connecté pour utiliser nos services.</p>
</div>
</div>
<!-- Mobile Menu Button -->
<div class="md:hidden fixed top-4 left-4 z-50">
<button id="menuToggle" class="p-2 rounded-lg bg-white shadow-md text-indigo-600">
<i class="fas fa-bars text-xl"></i>
</button>
</div>
<!-- Sidebar -->
<div id="sidebar" class="sidebar fixed top-0 left-0 h-full w-64 bg-white shadow-lg z-40">
<div class="p-4 gradient-bg text-white h-24 flex items-center">
<div class="flex items-center space-x-2">
<i class="fas fa-server text-2xl"></i>
<h1 class="text-xl font-bold">HostPro</h1>
</div>
</div>
<nav class="p-4">
<ul class="space-y-2">
<li>
<a href="#" class="flex items-center space-x-3 p-3 rounded-lg bg-indigo-50 text-indigo-700">
<i class="fas fa-home"></i>
<span>Accueil</span>
</a>
</li>
<li>
<a href="#" class="flex items-center space-x-3 p-3 rounded-lg hover:bg-gray-100 text-gray-700">
<i class="fas fa-server"></i>
<span>Nos Offres</span>
</a>
</li>
<li>
<a href="#" class="flex items-center space-x-3 p-3 rounded-lg hover:bg-gray-100 text-gray-700">
<i class="fas fa-shopping-cart"></i>
<span>Mon Panier</span>
</a>
</li>
<li>
<a href="#" id="dashboardLink" class="flex items-center space-x-3 p-3 rounded-lg hover:bg-gray-100 text-gray-700">
<i class="fas fa-tachometer-alt"></i>
<span>Tableau de Bord</span>
</a>
</li>
<li>
<a href="#" class="flex items-center space-x-3 p-3 rounded-lg hover:bg-gray-100 text-gray-700">
<i class="fas fa-question-circle"></i>
<span>Aide & Support</span>
</a>
</li>
</ul>
</nav>
<div class="absolute bottom-0 w-full p-4 border-t border-gray-200">
<div id="userProfile" class="hidden">
<div class="flex items-center space-x-3 p-3 rounded-lg hover:bg-gray-100 cursor-pointer">
<div class="w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-600">
<i class="fas fa-user"></i>
</div>
<div>
<p id="userName" class="font-medium">Utilisateur</p>
<p id="userEmail" class="text-xs text-gray-500">user@example.com</p>
</div>
</div>
<button id="logoutBtn" class="w-full mt-2 px-3 py-1 bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200 text-sm">
Déconnexion
</button>
</div>
<div id="loginPrompt" class="text-center">
<button id="showAuthModal" class="text-indigo-600 hover:text-indigo-800 text-sm">
<i class="fas fa-sign-in-alt mr-1"></i> Se connecter
</button>
</div>
</div>
</div>
<!-- Main Content -->
<div class="md:ml-64 min-h-screen">
<!-- Header -->
<header class="bg-white shadow-sm">
<div class="max-w-7xl mx-auto px-4 py-4 sm:px-6 lg:px-8 flex justify-between items-center">
<h1 class="text-2xl font-bold text-gray-800">Hébergement Web Haute Performance</h1>
<div class="flex items-center space-x-4">
<div class="relative">
<div id="cartIcon" class="relative cursor-pointer">
<i class="fas fa-shopping-cart text-xl text-gray-600"></i>
<span id="cartCount" class="absolute -top-2 -right-2 bg-indigo-600 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center">0</span>
</div>
<div id="cartDropdown" class="hidden absolute right-0 mt-2 w-72 bg-white rounded-md shadow-lg z-50 py-2">
<div class="px-4 py-2 border-b border-gray-200">
<h3 class="font-medium">Mon Panier</h3>
</div>
<div id="cartItems" class="max-h-60 overflow-y-auto">
<!-- Cart items will be added here dynamically -->
<div class="px-4 py-3 text-center text-gray-500">Votre panier est vide</div>
</div>
<div class="px-4 py-2 border-t border-gray-200">
<div class="flex justify-between mb-2">
<span>Total:</span>
<span id="cartTotal">€0.00</span>
</div>
<button id="checkoutBtn" class="w-full py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700">
Payer maintenant
</button>
</div>
</div>
</div>
<div id="userAvatar" class="hidden">
<div class="w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-600 cursor-pointer">
<i class="fas fa-user"></i>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content Area -->
<main class="max-w-7xl mx-auto px-4 py-6 sm:px-6 lg:px-8">
<!-- Hero Section -->
<div class="bg-gradient-to-r from-indigo-500 to-purple-600 rounded-xl text-white p-8 mb-8">
<div class="max-w-2xl">
<h2 class="text-3xl font-bold mb-4">Des serveurs ultra-rapides avec 99.9% de disponibilité</h2>
<p class="text-lg mb-6">Support technique 24/7, infrastructure haute performance et paiements sécurisés.</p>
<div class="flex space-x-4">
<button id="getStartedBtn" class="px-6 py-3 bg-white text-indigo-600 rounded-lg font-medium hover:bg-gray-100">
Commencer maintenant
</button>
<button class="px-6 py-3 border border-white text-white rounded-lg font-medium hover:bg-white hover:bg-opacity-10">
En savoir plus
</button>
</div>
</div>
</div>
<!-- Pricing Plans -->
<div class="mb-8">
<h2 class="text-2xl font-bold text-gray-800 mb-6">Nos Offres d'Hébergement</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<!-- Basic Plan -->
<div class="hosting-card bg-white rounded-xl border border-gray-200 overflow-hidden shadow-sm transition">
<div class="p-6 border-b border-gray-200">
<h3 class="text-xl font-semibold text-gray-800 mb-2">Basique</h3>
<p class="text-gray-600 mb-4">Parfait pour les petits sites et projets personnels</p>
<div class="flex items-baseline mb-4">
<span class="text-3xl font-bold">€4.99</span>
<span class="ml-1 text-gray-500">/mois</span>
</div>
<div class="flex items-center text-sm text-green-600 mb-2">
<i class="fas fa-check-circle mr-2"></i>
<span>Disponibilité 99.9%</span>
</div>
</div>
<div class="p-6">
<ul class="space-y-3 mb-6">
<li class="flex items-center">
<i class="fas fa-check text-green-500 mr-2"></i>
<span>10GB Stockage SSD</span>
</li>
<li class="flex items-center">
<i class="fas fa-check text-green-500 mr-2"></i>
<span>100GB Bandwidth</span>
</li>
<li class="flex items-center">
<i class="fas fa-check text-green-500 mr-2"></i>
<span>1 Site Web</span>
</li>
<li class="flex items-center">
<i class="fas fa-check text-green-500 mr-2"></i>
<span>Support 24/7</span>
</li>
</ul>
<button class="add-to-cart w-full py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition" data-plan="basique" data-price="4.99">
Ajouter au panier
</button>
</div>
</div>
<!-- Pro Plan (Featured) -->
<div class="hosting-card bg-white rounded-xl border-2 border-indigo-500 overflow-hidden shadow-md transition relative">
<div class="absolute top-0 right-0 bg-indigo-500 text-white text-xs font-bold px-2 py-1 rounded-bl-lg">
POPULAIRE
</div>
<div class="p-6 border-b border-gray-200">
<h3 class="text-xl font-semibold text-gray-800 mb-2">Professionnel</h3>
<p class="text-gray-600 mb-4">Idéal pour les entreprises et sites à trafic moyen</p>
<div class="flex items-baseline mb-4">
<span class="text-3xl font-bold">€12.99</span>
<span class="ml-1 text-gray-500">/mois</span>
</div>
<div class="flex items-center text-sm text-green-600 mb-2">
<i class="fas fa-check-circle mr-2"></i>
<span>Disponibilité 99.9%</span>
</div>
</div>
<div class="p-6">
<ul class="space-y-3 mb-6">
<li class="flex items-center">
<i class="fas fa-check text-green-500 mr-2"></i>
<span>50GB Stockage SSD</span>
</li>
<li class="flex items-center">
<i class="fas fa-check text-green-500 mr-2"></i>
<span>500GB Bandwidth</span>
</li>
<li class="flex items-center">
<i class="fas fa-check text-green-500 mr-2"></i>
<span>5 Sites Web</span>
</li>
<li class="flex items-center">
<i class="fas fa-check text-green-500 mr-2"></i>
<span>Support Premium 24/7</span>
</li>
</ul>
<button class="add-to-cart w-full py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition" data-plan="professionnel" data-price="12.99">
Ajouter au panier
</button>
</div>
</div>
<!-- Enterprise Plan -->
<div class="hosting-card bg-white rounded-xl border border-gray-200 overflow-hidden shadow-sm transition">
<div class="p-6 border-b border-gray-200">
<h3 class="text-xl font-semibold text-gray-800 mb-2">Entreprise</h3>
<p class="text-gray-600 mb-4">Solution haut de gamme pour les sites à fort trafic</p>
<div class="flex items-baseline mb-4">
<span class="text-3xl font-bold">€29.99</span>
<span class="ml-1 text-gray-500">/mois</span>
</div>
<div class="flex items-center text-sm text-green-600 mb-2">
<i class="fas fa-check-circle mr-2"></i>
<span>Disponibilité 99.9%</span>
</div>
</div>
<div class="p-6">
<ul class="space-y-3 mb-6">
<li class="flex items-center">
<i class="fas fa-check text-green-500 mr-2"></i>
<span>200GB Stockage SSD</span>
</li>
<li class="flex items-center">
<i class="fas fa-check text-green-500 mr-2"></i>
<span>Bandwidth Illimité</span>
</li>
<li class="flex items-center">
<i class="fas fa-check text-green-500 mr-2"></i>
<span>Sites Web Illimités</span>
</li>
<li class="flex items-center">
<i class="fas fa-check text-green-500 mr-2"></i>
<span>Support VIP 24/7</span>
</li>
</ul>
<button class="add-to-cart w-full py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition" data-plan="entreprise" data-price="29.99">
Ajouter au panier
</button>
</div>
</div>
</div>
</div>
<!-- Features Section -->
<div class="bg-white rounded-xl shadow-sm p-6 mb-8">
<h2 class="text-2xl font-bold text-gray-800 mb-6">Pourquoi choisir notre hébergement ?</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div class="text-center p-4">
<div class="w-16 h-16 bg-indigo-100 rounded-full flex items-center justify-center mx-auto mb-4">
<i class="fas fa-bolt text-indigo-600 text-2xl"></i>
</div>
<h3 class="font-medium text-lg mb-2">Ultra Rapide</h3>
<p class="text-gray-600">SSD NVMe et cache optimisé pour des temps de chargement record.</p>
</div>
<div class="text-center p-4">
<div class="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4">
<i class="fas fa-shield-alt text-green-600 text-2xl"></i>
</div>
<h3 class="font-medium text-lg mb-2">Sécurisé</h3>
<p class="text-gray-600">Protection DDoS, SSL gratuit et sauvegardes automatiques.</p>
</div>
<div class="text-center p-4">
<div class="w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4">
<i class="fas fa-headset text-purple-600 text-2xl"></i>
</div>
<h3 class="font-medium text-lg mb-2">Support 24/7</h3>
<p class="text-gray-600">Notre équipe est disponible à tout moment pour vous aider.</p>
</div>
<div class="text-center p-4">
<div class="w-16 h-16 bg-pink-100 rounded-full flex items-center justify-center mx-auto mb-4">
<i class="fas fa-chart-line text-pink-600 text-2xl"></i>
</div>
<h3 class="font-medium text-lg mb-2">99.9% Uptime</h3>
<p class="text-gray-600">Garantie de disponibilité avec infrastructure redondante.</p>
</div>
</div>
</div>
<!-- Dashboard Section (Hidden by default) -->
<div id="dashboardSection" class="hidden">
<div class="bg-white rounded-xl shadow-sm p-6 mb-8">
<h2 class="text-2xl font-bold text-gray-800 mb-6">Tableau de Bord</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<div class="bg-indigo-50 rounded-lg p-4">
<div class="flex justify-between items-start">
<div>
<p class="text-sm text-indigo-600">Abonnement Actif</p>
<h3 class="text-xl font-bold mt-1" id="currentPlan">Professionnel</h3>
</div>
<div class="bg-indigo-100 p-2 rounded-full">
<i class="fas fa-server text-indigo-600"></i>
</div>
</div>
<div class="mt-4">
<p class="text-sm text-gray-600">Prochain paiement:</p>
<p class="font-medium" id="nextPayment">15 Juillet 2023 - €12.99</p>
</div>
</div>
<div class="bg-green-50 rounded-lg p-4">
<div class="flex justify-between items-start">
<div>
<p class="text-sm text-green-600">Utilisation du Stockage</p>
<h3 class="text-xl font-bold mt-1">18.5GB / 50GB</h3>
</div>
<div class="bg-green-100 p-2 rounded-full">
<i class="fas fa-database text-green-600"></i>
</div>
</div>
<div class="mt-4">
<div class="w-full bg-gray-200 rounded-full h-2">
<div class="bg-green-500 h-2 rounded-full" style="width: 37%"></div>
</div>
</div>
</div>
<div class="bg-purple-50 rounded-lg p-4">
<div class="flex justify-between items-start">
<div>
<p class="text-sm text-purple-600">Sites Actifs</p>
<h3 class="text-xl font-bold mt-1">3/5</h3>
</div>
<div class="bg-purple-100 p-2 rounded-full">
<i class="fas fa-globe text-purple-600"></i>
</div>
</div>
<div class="mt-4">
<a href="#" class="text-purple-600 hover:text-purple-800 text-sm font-medium">
Gérer les sites <i class="fas fa-arrow-right ml-1"></i>
</a>
</div>
</div>
</div>
<h3 class="text-lg font-semibold text-gray-800 mb-4">Historique des Paiements</h3>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Montant</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Méthode</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Statut</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Facture</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">15 Juin 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">€12.99</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<div class="flex items-center">
<i class="fab fa-cc-stripe text-blue-500 mr-2"></i> Stripe
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Payé</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<a href="#" class="text-indigo-600 hover:text-indigo-900">Télécharger</a>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">15 Mai 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">€12.99</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<div class="flex items-center">
<i class="fab fa-cc-paypal text-blue-500 mr-2"></i> PayPal
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Payé</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<a href="#" class="text-indigo-600 hover:text-indigo-900">Télécharger</a>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">15 Avril 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">€12.99</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<div class="flex items-center">
<i class="fab fa-cc-stripe text-blue-500 mr-2"></i> Stripe
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Payé</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<a href="#" class="text-indigo-600 hover:text-indigo-900">Télécharger</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="mt-8">
<h3 class="text-lg font-semibold text-gray-800 mb-4">Méthodes de Paiement</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex justify-between items-center mb-4">
<h4 class="font-medium">PayPal</h4>
<img src="https://www.paypalobjects.com/webstatic/mktg/logo/pp_cc_mark_37x23.jpg" alt="PayPal" class="h-8">
</div>
<p class="text-sm text-gray-600 mb-4">Payer rapidement et facilement avec votre compte PayPal.</p>
<button id="paypalBtn" class="w-full py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition">
<i class="fab fa-paypal mr-2"></i> Payer avec PayPal
</button>
</div>
<div class="border border-gray-200 rounded-lg p-4">
<div class="flex justify-between items-center mb-4">
<h4 class="font-medium">Carte Bancaire</h4>
<div class="flex space-x-2">
<i class="fab fa-cc-visa text-gray-600 text-xl"></i>
<i class="fab fa-cc-mastercard text-gray-600 text-xl"></i>
<i class="fab fa-cc-amex text-gray-600 text-xl"></i>
</div>
</div>
<p class="text-sm text-gray-600 mb-4">Paiement sécurisé par Stripe avec cryptage SSL.</p>
<button id="stripeBtn" class="w-full py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition">
<i class="fab fa-cc-stripe mr-2"></i> Payer avec Stripe
</button>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<!-- Checkout Modal -->
<div id="checkoutModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-xl p-6 w-full max-w-md">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-medium">Finaliser la Commande</h3>
<button id="closeCheckoutModal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<h4 class="font-medium mb-2">Votre Commande</h4>
<div id="checkoutItems" class="space-y-2 mb-4">
<!-- Cart items will be added here dynamically -->
</div>
<div class="flex justify-between border-t border-gray-200 pt-2">
<span class="font-medium">Total:</span>
<span id="checkoutTotal" class="font-bold">€0.00</span>
</div>
</div>
<div class="mb-6">
<h4 class="font-medium mb-2">Méthode de Paiement</h4>
<div class="grid grid-cols-2 gap-3">
<button id="selectPaypal" class="py-2 border border-gray-300 rounded-lg hover:border-blue-500 flex items-center justify-center">
<i class="fab fa-paypal text-blue-500 mr-2 text-xl"></i>
</button>
<button id="selectStripe" class="py-2 border border-gray-300 rounded-lg hover:border-indigo-500 flex items-center justify-center">
<i class="fab fa-cc-stripe text-indigo-500 mr-2 text-xl"></i>
</button>
</div>
</div>
<button id="confirmPaymentBtn" class="w-full py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition">
Confirmer et Payer
</button>
</div>
</div>
<script>
// User authentication state
let isLoggedIn = false;
let currentUser = null;
let cart = [];
// Mobile menu toggle
const menuToggle = document.getElementById('menuToggle');
const sidebar = document.getElementById('sidebar');
menuToggle.addEventListener('click', () => {
sidebar.classList.toggle('open');
});
// Auth modal toggle
const authModal = document.getElementById('authModal');
const showAuthModal = document.getElementById('showAuthModal');
const closeAuthModal = document.getElementById('closeAuthModal');
showAuthModal.addEventListener('click', () => {
authModal.classList.remove('hidden');
});
closeAuthModal.addEventListener('click', () => {
authModal.classList.add('hidden');
});
// Login functionality
const loginBtn = document.getElementById('loginBtn');
const signupBtn = document.getElementById('signupBtn');
const logoutBtn = document.getElementById('logoutBtn');
const userProfile = document.getElementById('userProfile');
const loginPrompt = document.getElementById('loginPrompt');
const userAvatar = document.getElementById('userAvatar');
const userName = document.getElementById('userName');
const userEmail = document.getElementById('userEmail');
loginBtn.addEventListener('click', () => {
const email = document.getElementById('authEmail').value;
const password = document.getElementById('authPassword').value;
if (email && password) {
// In a real app, you would validate credentials with your backend
isLoggedIn = true;
currentUser = {
name: "John Doe",
email: email
};
updateAuthUI();
authModal.classList.add('hidden');
} else {
alert("Veuillez entrer un email et un mot de passe valides.");
}
});
signupBtn.addEventListener('click', () => {
const email = document.getElementById('authEmail').value;
const password = document.getElementById('authPassword').value;
if (email && password) {
// In a real app, you would create a new user account
isLoggedIn = true;
currentUser = {
name: "Nouvel Utilisateur",
email: email
};
updateAuthUI();
authModal.classList.add('hidden');
} else {
alert("Veuillez entrer un email et un mot de passe valides.");
}
});
logoutBtn.addEventListener('click', () => {
isLoggedIn = false;
currentUser = null;
updateAuthUI();
});
function updateAuthUI() {
if (isLoggedIn) {
userProfile.classList.remove('hidden');
loginPrompt.classList.add('hidden');
userAvatar.classList.remove('hidden');
userName.textContent = currentUser.name;
userEmail.textContent = currentUser.email;
} else {
userProfile.classList.add('hidden');
loginPrompt.classList.remove('hidden');
userAvatar.classList.add('hidden');
}
}
// Cart functionality
const cartIcon = document.getElementById('cartIcon');
const cartDropdown = document.getElementById('cartDropdown');
const cartCount = document.getElementById('cartCount');
const cartItems = document.getElementById('cartItems');
const cartTotal = document.getElementById('cartTotal');
const addToCartButtons = document.querySelectorAll('.add-to-cart');
const checkoutBtn = document.getElementById('checkoutBtn');
cartIcon.addEventListener('click', (e) => {
e.stopPropagation();
cartDropdown.classList.toggle('hidden');
});
// Close cart dropdown when clicking outside
document.addEventListener('click', (e) => {
if (!cartDropdown.contains(e.target) && e.target !== cartIcon) {
cartDropdown.classList.add('hidden');
}
});
addToCartButtons.forEach(button => {
button.addEventListener('click', () => {
if (!isLoggedIn) {
authModal.classList.remove('hidden');
return;
}
const plan = button.getAttribute('data-plan');
const price = parseFloat(button.getAttribute('data-price'));
// Check if item already in cart
const existingItem = cart.find(item => item.plan === plan);
if (existingItem) {
existingItem.quantity += 1;
} else {
cart.push({
plan: plan,
price: price,
quantity: 1
});
}
updateCartUI();
cartDropdown.classList.remove('hidden');
});
});
function updateCartUI() {
// Update cart count
const totalItems = cart.reduce((sum, item) => sum + item.quantity, 0);
cartCount.textContent = totalItems;
// Update cart items list
cartItems.innerHTML = '';
if (cart.length === 0) {
cartItems.innerHTML = '<div class="px-4 py-3 text-center text-gray-500">Votre panier est vide</div>';
cartTotal.textContent = '€0.00';
return;
}
let total = 0;
cart.forEach((item, index) => {
const itemTotal = item.price * item.quantity;
total += itemTotal;
const itemElement = document.createElement('div');
itemElement.className = 'cart-item px-4 py-3 flex justify-between items-center';
itemElement.innerHTML = `
<div>
<p class="font-medium">${item.plan.charAt(0).toUpperCase() + item.plan.slice(1)}</p>
<p class="text-sm text-gray-500">${item.quantity} x €${item.price.toFixed(2)}</p>
</div>
<div class="flex items-center">
<span class="font-medium mr-3">€${itemTotal.toFixed(2)}</span>
<button class="remove-item text-red-500 hover:text-red-700" data-index="${index}">
<i class="fas fa-times"></i>
</button>
</div>
`;
cartItems.appendChild(itemElement);
});
// Add remove item event listeners
document.querySelectorAll('.remove-item').forEach(button => {
button.addEventListener('click', (e) => {
e.stopPropagation();
const index = parseInt(button.getAttribute('data-index'));
cart.splice(index, 1);
updateCartUI();
});
});
// Update total
cartTotal.textContent = `€${total.toFixed(2)}`;
}
// Checkout functionality
const checkoutModal = document.getElementById('checkoutModal');
const closeCheckoutModal = document.getElementById('closeCheckoutModal');
const checkoutItems = document.getElementById('checkoutItems');
const checkoutTotal = document.getElementById('checkoutTotal');
const selectPaypal = document.getElementById('selectPaypal');
const selectStripe = document.getElementById('selectStripe');
const confirmPaymentBtn = document.getElementById('confirmPaymentBtn');
checkoutBtn.addEventListener('click', () => {
if (cart.length === 0) {
alert("Votre panier est vide.");
return;
}
if (!isLoggedIn) {
authModal.classList.remove('hidden');
return;
}
// Update checkout items
checkoutItems.innerHTML = '';
let total = 0;
cart.forEach(item => {
const itemTotal = item.price * item.quantity;
total += itemTotal;
const itemElement = document.createElement('div');
itemElement.className = 'flex justify-between';
itemElement.innerHTML = `
<span>${item.plan.charAt(0).toUpperCase() + item.plan.slice(1)} x${item.quantity}</span>
<span>€${itemTotal.toFixed(2)}</span>
`;
checkoutItems.appendChild(itemElement);
});
checkoutTotal.textContent = `€${total.toFixed(2)}`;
checkoutModal.classList.remove('hidden');
cartDropdown.classList.add('hidden');
});
closeCheckoutModal.addEventListener('click', () => {
checkoutModal.classList.add('hidden');
});
let selectedPaymentMethod = null;
selectPaypal.addEventListener('click', () => {
selectedPaymentMethod = 'paypal';
selectPaypal.classList.add('border-blue-500', 'bg-blue-50');
selectStripe.classList.remove('border-indigo-500', 'bg-indigo-50');
});
selectStripe.addEventListener('click', () => {
selectedPaymentMethod = 'stripe';
selectStripe.classList.add('border-indigo-500', 'bg-indigo-50');
selectPaypal.classList.remove('border-blue-500', 'bg-blue-50');
});
confirmPaymentBtn.addEventListener('click', () => {
if (!selectedPaymentMethod) {
alert("Veuillez sélectionner une méthode de paiement.");
return;
}
// In a real app, you would process payment here
alert(`Paiement de €${checkoutTotal.textContent} avec ${selectedPaymentMethod.toUpperCase()} effectué avec succès!`);
// Clear cart and close modals
cart = [];
updateCartUI();
checkoutModal.classList.add('hidden');
});
// Dashboard functionality
const dashboardLink = document.getElementById('dashboardLink');
const dashboardSection = document.getElementById('dashboardSection');
const getStartedBtn = document.getElementById('getStartedBtn');
const paypalBtn = document.getElementById('paypalBtn');
const stripeBtn = document.getElementById('stripeBtn');
dashboardLink.addEventListener('click', (e) => {
e.preventDefault();
if (!isLoggedIn) {
authModal.classList.remove('hidden');
return;
}
// Show dashboard and hide other sections
dashboardSection.classList.remove('hidden');
document.querySelectorAll('main > div:not(#dashboardSection)').forEach(section => {
section.classList.add('hidden');
});
});
getStartedBtn.addEventListener('click', () => {
if (!isLoggedIn) {
authModal.classList.remove('hidden');
} else {
// Scroll to pricing section
document.querySelector('.hosting-card').scrollIntoView({ behavior: 'smooth' });
}
});
paypalBtn.addEventListener('click', () => {
alert("Redirection vers PayPal pour le paiement...");
// In a real app: window.location.href = "your-paypal-checkout-url";
});
stripeBtn.addEventListener('click', () => {
alert("Ouverture du formulaire de paiement Stripe...");
// In a real app: stripe.redirectToCheckout({ sessionId: 'your-session-id' });
});
// Initialize UI
updateAuthUI();
updateCartUI();
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=docto41/host-pro" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>