File size: 33,448 Bytes
7924db5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nike Elite | Exclusive Sneakers</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">
<style>
.hero {
background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1600269452121-1f5d1415f084?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80');
background-size: cover;
background-position: center;
}
.shoe-card:hover {
transform: translateY(-10px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.cart-panel {
transition: all 0.3s ease;
transform: translateX(100%);
}
.cart-panel.open {
transform: translateX(0);
}
@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.5;
}
}
.animate-pulse {
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
</style>
</head>
<body class="bg-gray-50 font-sans">
<!-- Navigation -->
<nav class="bg-white shadow-md sticky top-0 z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16 items-center">
<div class="flex items-center">
<div class="flex-shrink-0">
<img class="h-8 w-auto" src="https://www.freepnglogos.com/uploads/nike-logo-0.png" alt="Nike Logo">
</div>
<div class="hidden md:block">
<div class="ml-10 flex items-baseline space-x-4">
<a href="#" class="text-black px-3 py-2 rounded-md text-sm font-medium">Home</a>
<a href="#" class="text-gray-600 hover:text-black px-3 py-2 rounded-md text-sm font-medium">Men</a>
<a href="#" class="text-gray-600 hover:text-black px-3 py-2 rounded-md text-sm font-medium">Women</a>
<a href="#" class="text-gray-600 hover:text-black px-3 py-2 rounded-md text-sm font-medium">Kids</a>
<a href="#" class="text-gray-600 hover:text-black px-3 py-2 rounded-md text-sm font-medium">Collections</a>
</div>
</div>
</div>
<div class="hidden md:block">
<div class="ml-4 flex items-center md:ml-6">
<button class="p-1 rounded-full text-gray-600 hover:text-black focus:outline-none">
<i class="fas fa-search"></i>
</button>
<button id="cart-btn" class="ml-3 p-1 rounded-full text-gray-600 hover:text-black focus:outline-none relative">
<i class="fas fa-shopping-cart"></i>
<span id="cart-count" class="absolute -top-2 -right-2 bg-red-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center">0</span>
</button>
<button class="ml-3 p-1 rounded-full text-gray-600 hover:text-black focus:outline-none">
<i class="fas fa-user"></i>
</button>
</div>
</div>
<div class="-mr-2 flex md:hidden">
<button type="button" class="inline-flex items-center justify-center p-2 rounded-md text-gray-600 hover:text-black focus:outline-none">
<i class="fas fa-bars"></i>
</button>
</div>
</div>
</div>
</nav>
<!-- Hero Section -->
<section class="hero text-white py-20 md:py-32">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="md:w-1/2">
<h1 class="text-4xl md:text-6xl font-bold mb-4">Exclusive Nike Sneakers</h1>
<p class="text-lg md:text-xl mb-8">Discover limited edition and premium quality Nike shoes that elevate your style and performance.</p>
<button class="bg-white text-black font-bold py-3 px-8 rounded-full hover:bg-gray-100 transition duration-300">Shop Now</button>
</div>
</div>
</section>
<!-- Featured Section -->
<section class="py-12 bg-white">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<h2 class="text-3xl font-bold text-center mb-12">Featured Collections</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<div class="relative overflow-hidden rounded-lg shadow-lg group">
<img src="https://images.unsplash.com/photo-1600185365483-26d7a4cc7519?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1025&q=80" alt="Air Jordan" class="w-full h-64 object-cover">
<div class="absolute inset-0 bg-black bg-opacity-40 flex items-center justify-center opacity-0 group-hover:opacity-100 transition duration-300">
<button class="bg-white text-black font-bold py-2 px-6 rounded-full">View Collection</button>
</div>
<div class="absolute bottom-0 left-0 right-0 bg-white p-4">
<h3 class="font-bold text-lg">Air Jordan</h3>
<p class="text-gray-600">Legendary performance</p>
</div>
</div>
<div class="relative overflow-hidden rounded-lg shadow-lg group">
<img src="https://images.unsplash.com/photo-1542291026-7eec264c27ff?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80" alt="Air Force" class="w-full h-64 object-cover">
<div class="absolute inset-0 bg-black bg-opacity-40 flex items-center justify-center opacity-0 group-hover:opacity-100 transition duration-300">
<button class="bg-white text-black font-bold py-2 px-6 rounded-full">View Collection</button>
</div>
<div class="absolute bottom-0 left-0 right-0 bg-white p-4">
<h3 class="font-bold text-lg">Air Force 1</h3>
<p class="text-gray-600">Classic style</p>
</div>
</div>
<div class="relative overflow-hidden rounded-lg shadow-lg group">
<img src="https://images.unsplash.com/photo-1600269452121-1f5d1415f084?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80" alt="Dunk" class="w-full h-64 object-cover">
<div class="absolute inset-0 bg-black bg-opacity-40 flex items-center justify-center opacity-0 group-hover:opacity-100 transition duration-300">
<button class="bg-white text-black font-bold py-2 px-6 rounded-full">View Collection</button>
</div>
<div class="absolute bottom-0 left-0 right-0 bg-white p-4">
<h3 class="font-bold text-lg">Nike Dunk</h3>
<p class="text-gray-600">Skate culture</p>
</div>
</div>
</div>
</div>
</section>
<!-- Products Section -->
<section class="py-12 bg-gray-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between items-center mb-8">
<h2 class="text-3xl font-bold">Latest Drops</h2>
<div class="flex space-x-2">
<button class="px-4 py-2 bg-black text-white rounded-full text-sm">All</button>
<button class="px-4 py-2 bg-white text-gray-600 rounded-full text-sm">Men</button>
<button class="px-4 py-2 bg-white text-gray-600 rounded-full text-sm">Women</button>
<button class="px-4 py-2 bg-white text-gray-600 rounded-full text-sm">Kids</button>
</div>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6">
<!-- Product 1 -->
<div class="shoe-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
<div class="relative">
<img src="https://images.unsplash.com/photo-1605348532760-6753d2c43329?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=687&q=80" alt="Nike Air Max" class="w-full h-64 object-cover">
<div class="absolute top-2 right-2 bg-red-500 text-white text-xs font-bold px-2 py-1 rounded">NEW</div>
</div>
<div class="p-4">
<h3 class="font-bold text-lg mb-1">Nike Air Max 270</h3>
<p class="text-gray-600 text-sm mb-2">Men's Running Shoes</p>
<div class="flex justify-between items-center">
<span class="font-bold text-lg">$150</span>
<button class="add-to-cart bg-black text-white px-3 py-1 rounded-full text-sm hover:bg-gray-800" data-id="1" data-name="Nike Air Max 270" data-price="150" data-image="https://images.unsplash.com/photo-1605348532760-6753d2c43329?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=687&q=80">
Add to Cart
</button>
</div>
</div>
</div>
<!-- Product 2 -->
<div class="shoe-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
<div class="relative">
<img src="https://images.unsplash.com/photo-1600185365483-26d7a4cc7519?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1025&q=80" alt="Air Jordan 1" class="w-full h-64 object-cover">
<div class="absolute top-2 right-2 bg-yellow-500 text-white text-xs font-bold px-2 py-1 rounded">LIMITED</div>
</div>
<div class="p-4">
<h3 class="font-bold text-lg mb-1">Air Jordan 1 Retro</h3>
<p class="text-gray-600 text-sm mb-2">Men's Basketball Shoes</p>
<div class="flex justify-between items-center">
<span class="font-bold text-lg">$180</span>
<button class="add-to-cart bg-black text-white px-3 py-1 rounded-full text-sm hover:bg-gray-800" data-id="2" data-name="Air Jordan 1 Retro" data-price="180" data-image="https://images.unsplash.com/photo-1600185365483-26d7a4cc7519?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1025&q=80">
Add to Cart
</button>
</div>
</div>
</div>
<!-- Product 3 -->
<div class="shoe-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
<div class="relative">
<img src="https://images.unsplash.com/photo-1542291026-7eec264c27ff?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80" alt="Nike Air Force" class="w-full h-64 object-cover">
</div>
<div class="p-4">
<h3 class="font-bold text-lg mb-1">Nike Air Force 1 '07</h3>
<p class="text-gray-600 text-sm mb-2">Women's Lifestyle Shoes</p>
<div class="flex justify-between items-center">
<span class="font-bold text-lg">$120</span>
<button class="add-to-cart bg-black text-white px-3 py-1 rounded-full text-sm hover:bg-gray-800" data-id="3" data-name="Nike Air Force 1 '07" data-price="120" data-image="https://images.unsplash.com/photo-1542291026-7eec264c27ff?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80">
Add to Cart
</button>
</div>
</div>
</div>
<!-- Product 4 -->
<div class="shoe-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
<div class="relative">
<img src="https://images.unsplash.com/photo-1600269452121-1f5d1415f084?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80" alt="Nike Dunk Low" class="w-full h-64 object-cover">
<div class="absolute top-2 right-2 bg-blue-500 text-white text-xs font-bold px-2 py-1 rounded">SALE</div>
</div>
<div class="p-4">
<h3 class="font-bold text-lg mb-1">Nike Dunk Low Retro</h3>
<p class="text-gray-600 text-sm mb-2">Unisex Skate Shoes</p>
<div class="flex justify-between items-center">
<span class="font-bold text-lg">$110</span>
<button class="add-to-cart bg-black text-white px-3 py-1 rounded-full text-sm hover:bg-gray-800" data-id="4" data-name="Nike Dunk Low Retro" data-price="110" data-image="https://images.unsplash.com/photo-1600269452121-1f5d1415f084?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80">
Add to Cart
</button>
</div>
</div>
</div>
</div>
<div class="text-center mt-10">
<button class="border-2 border-black text-black font-bold py-2 px-8 rounded-full hover:bg-black hover:text-white transition duration-300">
View All Products
</button>
</div>
</div>
</section>
<!-- Testimonials -->
<section class="py-12 bg-white">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<h2 class="text-3xl font-bold text-center mb-12">What Our Customers Say</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<div class="bg-gray-50 p-6 rounded-lg shadow-sm">
<div class="flex items-center mb-4">
<div class="text-yellow-400">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
</div>
</div>
<p class="text-gray-600 mb-4">"The quality of these Nike shoes is unmatched. I've never had a more comfortable pair of sneakers in my life!"</p>
<div class="flex items-center">
<img class="h-10 w-10 rounded-full mr-3" src="https://randomuser.me/api/portraits/men/32.jpg" alt="Customer">
<div>
<h4 class="font-bold">Michael Johnson</h4>
<p class="text-gray-500 text-sm">Verified Buyer</p>
</div>
</div>
</div>
<div class="bg-gray-50 p-6 rounded-lg shadow-sm">
<div class="flex items-center mb-4">
<div class="text-yellow-400">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
</div>
</div>
<p class="text-gray-600 mb-4">"The limited edition Jordans I got from here are absolutely stunning. They arrived quickly and in perfect condition."</p>
<div class="flex items-center">
<img class="h-10 w-10 rounded-full mr-3" src="https://randomuser.me/api/portraits/women/44.jpg" alt="Customer">
<div>
<h4 class="font-bold">Sarah Williams</h4>
<p class="text-gray-500 text-sm">Verified Buyer</p>
</div>
</div>
</div>
<div class="bg-gray-50 p-6 rounded-lg shadow-sm">
<div class="flex items-center mb-4">
<div class="text-yellow-400">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star-half-alt"></i>
</div>
</div>
<p class="text-gray-600 mb-4">"Great selection of exclusive Nikes. The customer service was excellent when I had questions about sizing."</p>
<div class="flex items-center">
<img class="h-10 w-10 rounded-full mr-3" src="https://randomuser.me/api/portraits/men/75.jpg" alt="Customer">
<div>
<h4 class="font-bold">David Kim</h4>
<p class="text-gray-500 text-sm">Verified Buyer</p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Newsletter -->
<section class="py-12 bg-black text-white">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="md:flex md:items-center md:justify-between">
<div class="md:w-1/2 mb-6 md:mb-0">
<h2 class="text-2xl font-bold mb-2">Get Exclusive Drops</h2>
<p>Subscribe to our newsletter to be the first to know about new releases and special offers.</p>
</div>
<div class="md:w-1/2">
<form class="flex">
<input type="email" placeholder="Your email address" class="px-4 py-3 w-full rounded-l focus:outline-none text-black">
<button type="submit" class="bg-red-500 hover:bg-red-600 px-6 py-3 rounded-r font-bold">Subscribe</button>
</form>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="bg-gray-900 text-white py-12">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<div>
<h3 class="font-bold text-lg mb-4">Nike Elite</h3>
<p class="text-gray-400">The premier destination for exclusive and limited edition Nike sneakers.</p>
<div class="flex space-x-4 mt-4">
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-facebook-f"></i></a>
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-twitter"></i></a>
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-instagram"></i></a>
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-pinterest-p"></i></a>
</div>
</div>
<div>
<h3 class="font-bold text-lg mb-4">Shop</h3>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-white">All Products</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Featured</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">New Arrivals</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Sale</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Collections</a></li>
</ul>
</div>
<div>
<h3 class="font-bold text-lg mb-4">Help</h3>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-white">FAQs</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Shipping</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Returns</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Size Guide</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Contact Us</a></li>
</ul>
</div>
<div>
<h3 class="font-bold text-lg mb-4">About</h3>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-white">Our Story</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Authenticity</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Careers</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Terms & Conditions</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Privacy Policy</a></li>
</ul>
</div>
</div>
<div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-400">
<p>© 2023 Nike Elite. All rights reserved.</p>
</div>
</div>
</footer>
<!-- Shopping Cart Panel -->
<div id="cart-panel" class="cart-panel fixed top-0 right-0 w-full md:w-1/3 h-full bg-white shadow-xl z-50 overflow-y-auto">
<div class="p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold">Your Cart</h2>
<button id="close-cart" class="text-gray-500 hover:text-black">
<i class="fas fa-times"></i>
</button>
</div>
<div id="cart-items" class="mb-6">
<!-- Cart items will be added here dynamically -->
<div class="text-center py-10">
<i class="fas fa-shopping-cart text-4xl text-gray-300 mb-4"></i>
<p class="text-gray-500">Your cart is empty</p>
</div>
</div>
<div class="border-t border-gray-200 pt-4">
<div class="flex justify-between mb-2">
<span class="text-gray-600">Subtotal</span>
<span id="cart-subtotal" class="font-bold">$0.00</span>
</div>
<div class="flex justify-between mb-4">
<span class="text-gray-600">Shipping</span>
<span class="font-bold">Free</span>
</div>
<div class="flex justify-between text-lg font-bold mb-6">
<span>Total</span>
<span id="cart-total">$0.00</span>
</div>
<button class="w-full bg-black text-white py-3 rounded-full font-bold hover:bg-gray-800 transition duration-300">
Checkout
</button>
</div>
</div>
</div>
<!-- Overlay -->
<div id="overlay" class="fixed inset-0 bg-black bg-opacity-50 z-40 hidden"></div>
<!-- Success Notification -->
<div id="success-notification" class="fixed bottom-4 right-4 bg-green-500 text-white px-6 py-3 rounded-lg shadow-lg hidden z-50">
<div class="flex items-center">
<i class="fas fa-check-circle mr-2"></i>
<span>Item added to cart!</span>
</div>
</div>
<script>
// Shopping Cart Functionality
document.addEventListener('DOMContentLoaded', function() {
const cartBtn = document.getElementById('cart-btn');
const closeCartBtn = document.getElementById('close-cart');
const cartPanel = document.getElementById('cart-panel');
const overlay = document.getElementById('overlay');
const addToCartBtns = document.querySelectorAll('.add-to-cart');
const cartItemsContainer = document.getElementById('cart-items');
const cartSubtotal = document.getElementById('cart-subtotal');
const cartTotal = document.getElementById('cart-total');
const cartCount = document.getElementById('cart-count');
const successNotification = document.getElementById('success-notification');
let cart = [];
// Toggle Cart Panel
cartBtn.addEventListener('click', function() {
cartPanel.classList.add('open');
overlay.classList.remove('hidden');
document.body.style.overflow = 'hidden';
});
closeCartBtn.addEventListener('click', function() {
cartPanel.classList.remove('open');
overlay.classList.add('hidden');
document.body.style.overflow = 'auto';
});
overlay.addEventListener('click', function() {
cartPanel.classList.remove('open');
overlay.classList.add('hidden');
document.body.style.overflow = 'auto';
});
// Add to Cart
addToCartBtns.forEach(btn => {
btn.addEventListener('click', function() {
const id = this.getAttribute('data-id');
const name = this.getAttribute('data-name');
const price = parseFloat(this.getAttribute('data-price'));
const image = this.getAttribute('data-image');
// Check if item already exists in cart
const existingItem = cart.find(item => item.id === id);
if (existingItem) {
existingItem.quantity += 1;
} else {
cart.push({
id,
name,
price,
image,
quantity: 1
});
}
// Update UI
updateCartUI();
// Show success notification
successNotification.classList.remove('hidden');
setTimeout(() => {
successNotification.classList.add('hidden');
}, 3000);
});
});
// Update Cart UI
function updateCartUI() {
// Update cart count
const totalItems = cart.reduce((total, item) => total + item.quantity, 0);
cartCount.textContent = totalItems;
// Update cart items
if (cart.length === 0) {
cartItemsContainer.innerHTML = `
<div class="text-center py-10">
<i class="fas fa-shopping-cart text-4xl text-gray-300 mb-4"></i>
<p class="text-gray-500">Your cart is empty</p>
</div>
`;
} else {
let itemsHTML = '';
cart.forEach(item => {
itemsHTML += `
<div class="flex items-center py-4 border-b border-gray-200">
<img src="${item.image}" alt="${item.name}" class="w-16 h-16 object-cover rounded">
<div class="ml-4 flex-1">
<h4 class="font-medium">${item.name}</h4>
<div class="flex justify-between items-center mt-1">
<div class="flex items-center">
<button class="decrease-quantity text-gray-500 px-2" data-id="${item.id}">
<i class="fas fa-minus text-xs"></i>
</button>
<span class="mx-2">${item.quantity}</span>
<button class="increase-quantity text-gray-500 px-2" data-id="${item.id}">
<i class="fas fa-plus text-xs"></i>
</button>
</div>
<span class="font-medium">$${(item.price * item.quantity).toFixed(2)}</span>
</div>
</div>
<button class="remove-item ml-4 text-gray-400 hover:text-black" data-id="${item.id}">
<i class="fas fa-times"></i>
</button>
</div>
`;
});
cartItemsContainer.innerHTML = itemsHTML;
// Add event listeners to new buttons
document.querySelectorAll('.decrease-quantity').forEach(btn => {
btn.addEventListener('click', function() {
const id = this.getAttribute('data-id');
const item = cart.find(item => item.id === id);
if (item.quantity > 1) {
item.quantity -= 1;
} else {
cart = cart.filter(item => item.id !== id);
}
updateCartUI();
});
});
document.querySelectorAll('.increase-quantity').forEach(btn => {
btn.addEventListener('click', function() {
const id = this.getAttribute('data-id');
const item = cart.find(item => item.id === id);
item.quantity += 1;
updateCartUI();
});
});
document.querySelectorAll('.remove-item').forEach(btn => {
btn.addEventListener('click', function() {
const id = this.getAttribute('data-id');
cart = cart.filter(item => item.id !== id);
updateCartUI();
});
});
}
// Update subtotal and total
const subtotal = cart.reduce((total, item) => total + (item.price * item.quantity), 0);
cartSubtotal.textContent = `$${subtotal.toFixed(2)}`;
cartTotal.textContent = `$${subtotal.toFixed(2)}`;
}
// Mobile menu toggle (placeholder for future implementation)
const mobileMenuBtn = document.querySelector('.md\\:-mr-2 button');
mobileMenuBtn.addEventListener('click', function() {
alert('Mobile menu would open here in a full implementation');
});
});
</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://deepsite.hf.co/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://deepsite.hf.co" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://deepsite.hf.co?remix=NillyG/gg" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |