iShares commited on
Commit
3b5e170
·
verified ·
1 Parent(s): 1c67704

Add 1 files

Browse files
Files changed (1) hide show
  1. index.html +250 -18
index.html CHANGED
@@ -31,6 +31,33 @@
31
  .bottom-navbar {
32
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
33
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  </style>
35
  </head>
36
  <body class="bg-gray-50 font-sans">
@@ -48,11 +75,21 @@
48
  <i class="fas fa-bell text-xl"></i>
49
  <span class="absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-4 w-4 flex items-center justify-center">3</span>
50
  </button>
51
- <button>
52
  <i class="fas fa-search text-xl"></i>
53
  </button>
54
  </div>
55
  </div>
 
 
 
 
 
 
 
 
 
 
56
  </header>
57
 
58
  <!-- Contenu principal (changé dynamiquement) -->
@@ -61,30 +98,22 @@
61
  <div id="home-page">
62
  <!-- Bannière promotionnelle -->
63
  <div class="bg-gradient-to-r from-blue-500 to-blue-600 rounded-xl p-4 text-white mb-6 fade-in">
64
- <h2 class="text-xl font-bold mb-2">Promotions du mois</h2>
65
- <p class="text-sm mb-3">Jusqu'à -20% sur les véhicules neufs</p>
66
- <button class="bg-white text-blue-600 px-4 py-1 rounded-full text-sm font-semibold">Voir les offres</button>
67
  </div>
68
 
69
  <!-- Catégories -->
70
  <h2 class="text-lg font-semibold mb-3">Catégories</h2>
71
  <div class="grid grid-cols-2 gap-3 mb-6">
72
  <div class="bg-gray-100 p-4 rounded-lg text-center fade-in" style="animation-delay: 0.1s;">
73
- <i class="fas fa-car text-3xl text-blue-500 mb-2"></i>
74
  <p class="font-medium">Neuf</p>
75
  </div>
76
  <div class="bg-gray-100 p-4 rounded-lg text-center fade-in" style="animation-delay: 0.2s;">
77
  <i class="fas fa-car-side text-3xl text-green-500 mb-2"></i>
78
  <p class="font-medium">Occasion</p>
79
  </div>
80
- <div class="bg-gray-100 p-4 rounded-lg text-center fade-in" style="animation-delay: 0.3s;">
81
- <i class="fas fa-truck-pickup text-3xl text-orange-500 mb-2"></i>
82
- <p class="font-medium">Utilitaires</p>
83
- </div>
84
- <div class="bg-gray-100 p-4 rounded-lg text-center fade-in" style="animation-delay: 0.4s;">
85
- <i class="fas fa-motorcycle text-3xl text-purple-500 mb-2"></i>
86
- <p class="font-medium">Motos</p>
87
- </div>
88
  </div>
89
 
90
  <!-- Véhicules récents -->
@@ -102,7 +131,7 @@
102
  <div class="flex justify-between items-center mt-2">
103
  <div>
104
  <p class="text-gray-600 text-sm"><i class="fas fa-gas-pump mr-1"></i> Essence</p>
105
- <p class="text-gray-600 text-sm"><i class="fas fa-tachometer-alt mr-1"></i> 15 000 km</p>
106
  </div>
107
  <p class="text-lg font-bold text-blue-600">18 990 €</p>
108
  </div>
@@ -165,10 +194,10 @@
165
 
166
  <!-- Page favoris (cachée par défaut) -->
167
  <div id="favorites-page" class="hidden">
168
- <h2 class="text-xl font-bold mb-4">Vos favoris</h2>
169
  <div class="text-center py-10">
170
- <i class="fas fa-heart text-4xl text-gray-300 mb-2"></i>
171
- <p class="text-gray-500">Vous n'avez pas encore de favoris</p>
172
  <button class="mt-4 bg-blue-600 text-white px-6 py-2 rounded-full">Parcourir les véhicules</button>
173
  </div>
174
  </div>
@@ -198,6 +227,10 @@
198
  <p class="text-sm text-gray-600 mt-1"><i class="fas fa-moon mr-2"></i> Mode sombre</p>
199
  </div>
200
 
 
 
 
 
201
  <button class="w-full bg-red-100 text-red-600 p-3 rounded-lg font-medium">
202
  <i class="fas fa-sign-out-alt mr-2"></i> Déconnexion
203
  </button>
@@ -222,6 +255,119 @@
222
  </button>
223
  </div>
224
  </nav>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  </div>
226
 
227
  <script>
@@ -252,6 +398,16 @@
252
  }
253
  }
254
 
 
 
 
 
 
 
 
 
 
 
255
  // Fonction pour charger les véhicules dans la page de liste
256
  function loadVehicles() {
257
  const vehicles = [
@@ -369,7 +525,7 @@
369
  </button>
370
 
371
  <!-- Carrousel d'images -->
372
- <div class="relative h-48 bg-gray-2 00 rounded-xl overflow-hidden mb-4">
373
  <img src="${vehicle.images[0]}" alt="${vehicle.name}" class="w-full h-full object-cover">
374
  <div class="absolute bottom-2 left-0 right-0 flex justify-center space-x-1">
375
  ${vehicle.images.map((_, i) => `<div class="w-2 h-2 rounded-full ${i === 0 ? 'bg-blue-500' : 'bg-gray-300'}"></div>`).join('')}
@@ -477,6 +633,82 @@
477
  // Afficher la page de détails
478
  showPage('vehicle-details-page');
479
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
480
  </script>
481
  <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=iShares/test-apps" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
482
  </html>
 
31
  .bottom-navbar {
32
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
33
  }
34
+
35
+ /* Animation pour la barre de recherche */
36
+ @keyframes slideDown {
37
+ from { opacity: 0; transform: translateY(-20px); }
38
+ to { opacity: 1; transform: translateY(0); }
39
+ }
40
+
41
+ .search-bar {
42
+ animation: slideDown 0.3s ease-out forwards;
43
+ }
44
+
45
+ /* Style pour le modal */
46
+ .modal {
47
+ transition: all 0.3s ease;
48
+ }
49
+
50
+ .modal-hidden {
51
+ opacity: 0;
52
+ visibility: hidden;
53
+ transform: translateY(20px);
54
+ }
55
+
56
+ .modal-visible {
57
+ opacity: 1;
58
+ visibility: visible;
59
+ transform: translateY(0);
60
+ }
61
  </style>
62
  </head>
63
  <body class="bg-gray-50 font-sans">
 
75
  <i class="fas fa-bell text-xl"></i>
76
  <span class="absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-4 w-4 flex items-center justify-center">3</span>
77
  </button>
78
+ <button id="search-button">
79
  <i class="fas fa-search text-xl"></i>
80
  </button>
81
  </div>
82
  </div>
83
+
84
+ <!-- Barre de recherche (cachée par défaut) -->
85
+ <div id="search-bar" class="hidden search-bar mt-3">
86
+ <div class="relative">
87
+ <input type="text" placeholder="Rechercher un véhicule..." class="w-full py-2 px-4 pr-10 rounded-full text-gray-800 focus:outline-none">
88
+ <button class="absolute right-3 top-2 text-gray-500">
89
+ <i class="fas fa-search"></i>
90
+ </button>
91
+ </div>
92
+ </div>
93
  </header>
94
 
95
  <!-- Contenu principal (changé dynamiquement) -->
 
98
  <div id="home-page">
99
  <!-- Bannière promotionnelle -->
100
  <div class="bg-gradient-to-r from-blue-500 to-blue-600 rounded-xl p-4 text-white mb-6 fade-in">
101
+ <h2 class="text-xl font-bold mb-2">Promotions de la semaine</h2>
102
+ <p class="text-sm mb-3">Jusqu'à -33% sur les véhicules neufs</p>
103
+ <button class="bg-white text-blue-600 px-4 py-1 rounded-full text-sm font-semibold">Voir toutes nos offres</button>
104
  </div>
105
 
106
  <!-- Catégories -->
107
  <h2 class="text-lg font-semibold mb-3">Catégories</h2>
108
  <div class="grid grid-cols-2 gap-3 mb-6">
109
  <div class="bg-gray-100 p-4 rounded-lg text-center fade-in" style="animation-delay: 0.1s;">
110
+ <i class="fas fa-car text-3xl text-yellow-500 mb-2"></i>
111
  <p class="font-medium">Neuf</p>
112
  </div>
113
  <div class="bg-gray-100 p-4 rounded-lg text-center fade-in" style="animation-delay: 0.2s;">
114
  <i class="fas fa-car-side text-3xl text-green-500 mb-2"></i>
115
  <p class="font-medium">Occasion</p>
116
  </div>
 
 
 
 
 
 
 
 
117
  </div>
118
 
119
  <!-- Véhicules récents -->
 
131
  <div class="flex justify-between items-center mt-2">
132
  <div>
133
  <p class="text-gray-600 text-sm"><i class="fas fa-gas-pump mr-1"></i> Essence</p>
134
+ <p class="text-gray-600 text-sm"><i class="fas fa-tachometer-alt mr-1"></i> 16 845 km</p>
135
  </div>
136
  <p class="text-lg font-bold text-blue-600">18 990 €</p>
137
  </div>
 
194
 
195
  <!-- Page favoris (cachée par défaut) -->
196
  <div id="favorites-page" class="hidden">
197
+ <h2 class="text-xl font-bold mb-4">Vos coup de coeur</h2>
198
  <div class="text-center py-10">
199
+ <i class="fas fa-heart text-4xl text-pink-200 mb-2"></i>
200
+ <p class="text-gray-500">Vous n'avez pas encore trouvé le coup de coeur</p>
201
  <button class="mt-4 bg-blue-600 text-white px-6 py-2 rounded-full">Parcourir les véhicules</button>
202
  </div>
203
  </div>
 
227
  <p class="text-sm text-gray-600 mt-1"><i class="fas fa-moon mr-2"></i> Mode sombre</p>
228
  </div>
229
 
230
+ <button onclick="showAddVehicleModal()" class="w-full bg-blue-100 text-blue-600 p-3 rounded-lg font-medium">
231
+ <i class="fas fa-plus-circle mr-2"></i> Ajouter un véhicule
232
+ </button>
233
+
234
  <button class="w-full bg-red-100 text-red-600 p-3 rounded-lg font-medium">
235
  <i class="fas fa-sign-out-alt mr-2"></i> Déconnexion
236
  </button>
 
255
  </button>
256
  </div>
257
  </nav>
258
+
259
+ <!-- Modal pour ajouter un véhicule -->
260
+ <div id="add-vehicle-modal" class="modal modal-hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50">
261
+ <div class="bg-white rounded-xl w-full max-w-md max-h-[90vh] overflow-y-auto">
262
+ <div class="p-4 border-b border-gray-200 flex justify-between items-center">
263
+ <h3 class="text-lg font-semibold">Ajouter un véhicule</h3>
264
+ <button onclick="hideAddVehicleModal()" class="text-gray-500">
265
+ <i class="fas fa-times"></i>
266
+ </button>
267
+ </div>
268
+
269
+ <div class="p-4">
270
+ <form id="add-vehicle-form" onsubmit="addVehicle(event)">
271
+ <div class="space-y-4">
272
+ <!-- Type de véhicule -->
273
+ <div>
274
+ <label class="block text-sm font-medium text-gray-700 mb-1">Type de véhicule</label>
275
+ <div class="flex space-x-2">
276
+ <label class="flex-1">
277
+ <input type="radio" name="type" value="Neuf" class="sr-only peer" checked>
278
+ <div class="p-3 border border-gray-300 rounded-lg text-center peer-checked:border-blue-500 peer-checked:bg-blue-50 peer-checked:text-blue-600">
279
+ <i class="fas fa-car text-xl mb-1"></i>
280
+ <p>Neuf</p>
281
+ </div>
282
+ </label>
283
+ <label class="flex-1">
284
+ <input type="radio" name="type" value="Occasion" class="sr-only peer">
285
+ <div class="p-3 border border-gray-300 rounded-lg text-center peer-checked:border-blue-500 peer-checked:bg-blue-50 peer-checked:text-blue-600">
286
+ <i class="fas fa-car-side text-xl mb-1"></i>
287
+ <p>Occasion</p>
288
+ </div>
289
+ </label>
290
+ </div>
291
+ </div>
292
+
293
+ <!-- Marque et modèle -->
294
+ <div class="grid grid-cols-2 gap-4">
295
+ <div>
296
+ <label for="brand" class="block text-sm font-medium text-gray-700 mb-1">Marque</label>
297
+ <input type="text" id="brand" name="brand" required class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
298
+ </div>
299
+ <div>
300
+ <label for="model" class="block text-sm font-medium text-gray-700 mb-1">Modèle</label>
301
+ <input type="text" id="model" name="model" required class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
302
+ </div>
303
+ </div>
304
+
305
+ <!-- Année et kilométrage -->
306
+ <div class="grid grid-cols-2 gap-4">
307
+ <div>
308
+ <label for="year" class="block text-sm font-medium text-gray-700 mb-1">Année</label>
309
+ <input type="number" id="year" name="year" min="1900" max="2023" required class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
310
+ </div>
311
+ <div>
312
+ <label for="km" class="block text-sm font-medium text-gray-700 mb-1">Kilométrage</label>
313
+ <input type="number" id="km" name="km" min="0" required class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
314
+ </div>
315
+ </div>
316
+
317
+ <!-- Carburant et prix -->
318
+ <div class="grid grid-cols-2 gap-4">
319
+ <div>
320
+ <label for="fuel" class="block text-sm font-medium text-gray-700 mb-1">Carburant</label>
321
+ <select id="fuel" name="fuel" required class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
322
+ <option value="Essence">Essence</option>
323
+ <option value="Diesel">Diesel</option>
324
+ <option value="Hybride">Hybride</option>
325
+ <option value="Électrique">Électrique</option>
326
+ </select>
327
+ </div>
328
+ <div>
329
+ <label for="price" class="block text-sm font-medium text-gray-700 mb-1">Prix (€)</label>
330
+ <input type="number" id="price" name="price" min="0" required class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
331
+ </div>
332
+ </div>
333
+
334
+ <!-- Description -->
335
+ <div>
336
+ <label for="description" class="block text-sm font-medium text-gray-700 mb-1">Description</label>
337
+ <textarea id="description" name="description" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
338
+ </div>
339
+
340
+ <!-- Photos -->
341
+ <div>
342
+ <label class="block text-sm font-medium text-gray-700 mb-1">Photos du véhicule</label>
343
+ <div class="border-2 border-dashed border-gray-300 rounded-lg p-4 text-center">
344
+ <i class="fas fa-camera text-3xl text-gray-400 mb-2"></i>
345
+ <p class="text-sm text-gray-500">Glissez-déposez vos photos ici ou cliquez pour sélectionner</p>
346
+ <input type="file" id="photos" name="photos" multiple accept="image/*" class="hidden">
347
+ </div>
348
+ </div>
349
+ </div>
350
+
351
+ <div class="mt-6 flex space-x-3">
352
+ <button type="button" onclick="hideAddVehicleModal()" class="flex-1 bg-gray-200 text-gray-800 py-2 px-4 rounded-md font-medium">
353
+ Annuler
354
+ </button>
355
+ <button type="submit" class="flex-1 bg-blue-600 text-white py-2 px-4 rounded-md font-medium">
356
+ Ajouter le véhicule
357
+ </button>
358
+ </div>
359
+ </form>
360
+ </div>
361
+ </div>
362
+ </div>
363
+
364
+ <!-- Notification de succès -->
365
+ <div id="success-notification" class="fixed top-4 right-4 bg-green-500 text-white px-4 py-2 rounded-lg shadow-lg hidden z-50">
366
+ <div class="flex items-center">
367
+ <i class="fas fa-check-circle mr-2"></i>
368
+ <span>Véhicule ajouté avec succès!</span>
369
+ </div>
370
+ </div>
371
  </div>
372
 
373
  <script>
 
398
  }
399
  }
400
 
401
+ // Fonction pour activer/désactiver la barre de recherche
402
+ document.getElementById('search-button').addEventListener('click', function() {
403
+ const searchBar = document.getElementById('search-bar');
404
+ if (searchBar.classList.contains('hidden')) {
405
+ searchBar.classList.remove('hidden');
406
+ } else {
407
+ searchBar.classList.add('hidden');
408
+ }
409
+ });
410
+
411
  // Fonction pour charger les véhicules dans la page de liste
412
  function loadVehicles() {
413
  const vehicles = [
 
525
  </button>
526
 
527
  <!-- Carrousel d'images -->
528
+ <div class="relative h-48 bg-gray-200 rounded-xl overflow-hidden mb-4">
529
  <img src="${vehicle.images[0]}" alt="${vehicle.name}" class="w-full h-full object-cover">
530
  <div class="absolute bottom-2 left-0 right-0 flex justify-center space-x-1">
531
  ${vehicle.images.map((_, i) => `<div class="w-2 h-2 rounded-full ${i === 0 ? 'bg-blue-500' : 'bg-gray-300'}"></div>`).join('')}
 
633
  // Afficher la page de détails
634
  showPage('vehicle-details-page');
635
  }
636
+
637
+ // Fonctions pour le modal d'ajout de véhicule
638
+ function showAddVehicleModal() {
639
+ const modal = document.getElementById('add-vehicle-modal');
640
+ modal.classList.remove('modal-hidden');
641
+ modal.classList.add('modal-visible');
642
+ }
643
+
644
+ function hideAddVehicleModal() {
645
+ const modal = document.getElementById('add-vehicle-modal');
646
+ modal.classList.remove('modal-visible');
647
+ modal.classList.add('modal-hidden');
648
+ }
649
+
650
+ // Fonction pour ajouter un véhicule
651
+ function addVehicle(event) {
652
+ event.preventDefault();
653
+
654
+ // Récupérer les données du formulaire
655
+ const formData = new FormData(event.target);
656
+ const vehicleData = {
657
+ type: formData.get('type'),
658
+ brand: formData.get('brand'),
659
+ model: formData.get('model'),
660
+ year: formData.get('year'),
661
+ km: formData.get('km'),
662
+ fuel: formData.get('fuel'),
663
+ price: formData.get('price'),
664
+ description: formData.get('description')
665
+ };
666
+
667
+ // Ici, vous pourriez envoyer les données à un serveur
668
+ console.log('Nouveau véhicule ajouté:', vehicleData);
669
+
670
+ // Afficher une notification de succès
671
+ const notification = document.getElementById('success-notification');
672
+ notification.classList.remove('hidden');
673
+
674
+ // Masquer la notification après 3 secondes
675
+ setTimeout(() => {
676
+ notification.classList.add('hidden');
677
+ }, 3000);
678
+
679
+ // Fermer le modal
680
+ hideAddVehicleModal();
681
+
682
+ // Réinitialiser le formulaire
683
+ event.target.reset();
684
+
685
+ // Recharger la liste des véhicules
686
+ loadVehicles();
687
+ }
688
+
689
+ // Initialisation
690
+ document.addEventListener('DOMContentLoaded', function() {
691
+ // Activer le drag and drop pour les photos
692
+ const dropZone = document.querySelector('div[class*="border-dashed"]');
693
+ const fileInput = document.getElementById('photos');
694
+
695
+ dropZone.addEventListener('click', () => fileInput.click());
696
+
697
+ dropZone.addEventListener('dragover', (e) => {
698
+ e.preventDefault();
699
+ dropZone.classList.add('border-blue-500', 'bg-blue-50');
700
+ });
701
+
702
+ dropZone.addEventListener('dragleave', () => {
703
+ dropZone.classList.remove('border-blue-500', 'bg-blue-50');
704
+ });
705
+
706
+ dropZone.addEventListener('drop', (e) => {
707
+ e.preventDefault();
708
+ dropZone.classList.remove('border-blue-500', 'bg-blue-50');
709
+ fileInput.files = e.dataTransfer.files;
710
+ });
711
+ });
712
  </script>
713
  <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=iShares/test-apps" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
714
  </html>