Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>HoopsHub - Premium Basketball Store</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> | |
| @keyframes bounce { | |
| 0%, 100% { transform: translateY(0); } | |
| 50% { transform: translateY(-15px); } | |
| } | |
| .bounce-animation { | |
| animation: bounce 2s infinite; | |
| } | |
| .ball-spin { | |
| animation: spin 8s linear infinite; | |
| } | |
| @keyframes spin { | |
| from { transform: rotate(0deg); } | |
| to { transform: rotate(360deg); } | |
| } | |
| .gradient-bg { | |
| background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #1d4ed8 100%); | |
| } | |
| .product-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); | |
| } | |
| .product-card { | |
| transition: all 0.3s ease; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 font-sans"> | |
| <!-- Header --> | |
| <header class="gradient-bg text-white shadow-lg"> | |
| <div class="container mx-auto px-4 py-4"> | |
| <div class="flex justify-between items-center"> | |
| <div class="flex items-center space-x-2"> | |
| <i class="fas fa-basketball-ball text-3xl bounce-animation text-orange-500"></i> | |
| <h1 class="text-2xl font-bold">HoopsHub</h1> | |
| </div> | |
| <nav class="hidden md:flex space-x-6"> | |
| <a href="#" class="hover:text-orange-300 transition">Home</a> | |
| <a href="#products" class="hover:text-orange-300 transition">Products</a> | |
| <a href="#features" class="hover:text-orange-300 transition">Features</a> | |
| <a href="#testimonials" class="hover:text-orange-300 transition">Testimonials</a> | |
| <a href="#contact" class="hover:text-orange-300 transition">Contact</a> | |
| </nav> | |
| <div class="flex items-center space-x-4"> | |
| <button class="relative"> | |
| <i class="fas fa-shopping-cart text-xl"></i> | |
| <span id="cart-count" class="absolute -top-2 -right-2 bg-orange-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center">0</span> | |
| </button> | |
| <button class="md:hidden" id="menu-toggle"> | |
| <i class="fas fa-bars text-2xl"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Mobile Menu --> | |
| <div id="mobile-menu" class="hidden md:hidden py-4"> | |
| <div class="flex flex-col space-y-3"> | |
| <a href="#" class="hover:text-orange-300 transition">Home</a> | |
| <a href="#products" class="hover:text-orange-300 transition">Products</a> | |
| <a href="#features" class="hover:text-orange-300 transition">Features</a> | |
| <a href="#testimonials" class="hover:text-orange-300 transition">Testimonials</a> | |
| <a href="#contact" class="hover:text-orange-300 transition">Contact</a> | |
| </div> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Hero Section --> | |
| <section class="gradient-bg text-white py-16 md:py-24"> | |
| <div class="container mx-auto px-4 flex flex-col md:flex-row items-center"> | |
| <div class="md:w-1/2 mb-10 md:mb-0"> | |
| <h2 class="text-4xl md:text-5xl font-bold mb-4">Elevate Your Game</h2> | |
| <p class="text-xl mb-6">Premium basketballs for players of all levels. Engineered for performance, designed for champions.</p> | |
| <div class="flex space-x-4"> | |
| <button class="bg-orange-500 hover:bg-orange-600 text-white px-6 py-3 rounded-lg font-medium transition">Shop Now</button> | |
| <button class="border border-white hover:bg-white hover:text-blue-900 text-white px-6 py-3 rounded-lg font-medium transition">Learn More</button> | |
| </div> | |
| </div> | |
| <div class="md:w-1/2 flex justify-center"> | |
| <div class="relative w-64 h-64 md:w-80 md:h-80"> | |
| <img src="https://m.media-amazon.com/images/I/71KvWXK+0BL._AC_UF1000,1000_QL80_.jpg" alt="Premium Basketball" class="w-full h-full object-contain ball-spin"> | |
| <div class="absolute inset-0 rounded-full border-4 border-orange-500 opacity-20 animate-pulse"></div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Features Section --> | |
| <section id="features" class="py-16 bg-white"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-12">Why Choose Our Basketballs</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-8"> | |
| <div class="bg-gray-50 p-6 rounded-xl text-center"> | |
| <div class="bg-blue-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-4"> | |
| <i class="fas fa-bolt text-blue-600 text-2xl"></i> | |
| </div> | |
| <h3 class="text-xl font-semibold mb-2">Premium Materials</h3> | |
| <p class="text-gray-600">Made with high-quality composite leather for superior grip and durability.</p> | |
| </div> | |
| <div class="bg-gray-50 p-6 rounded-xl text-center"> | |
| <div class="bg-orange-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-4"> | |
| <i class="fas fa-basketball-ball text-orange-600 text-2xl"></i> | |
| </div> | |
| <h3 class="text-xl font-semibold mb-2">Perfect Bounce</h3> | |
| <p class="text-gray-600">Engineered for consistent bounce and optimal performance on all court surfaces.</p> | |
| </div> | |
| <div class="bg-gray-50 p-6 rounded-xl text-center"> | |
| <div class="bg-green-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-4"> | |
| <i class="fas fa-medal text-green-600 text-2xl"></i> | |
| </div> | |
| <h3 class="text-xl font-semibold mb-2">Pro Approved</h3> | |
| <p class="text-gray-600">Used and recommended by professional players and coaches worldwide.</p> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Products Section --> | |
| <section id="products" class="py-16 bg-gray-50"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-12">Our Basketball Collection</h2> | |
| <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8"> | |
| <!-- Product 1 --> | |
| <div class="product-card bg-white rounded-xl overflow-hidden shadow-md"> | |
| <div class="relative h-48 overflow-hidden"> | |
| <img src="https://m.media-amazon.com/images/I/71KvWXK+0BL._AC_UF1000,1000_QL80_.jpg" alt="Pro Elite Basketball" class="w-full h-full object-contain p-4"> | |
| <div class="absolute top-2 right-2 bg-orange-500 text-white text-xs font-bold px-2 py-1 rounded">BESTSELLER</div> | |
| </div> | |
| <div class="p-4"> | |
| <h3 class="font-bold text-lg mb-1">Pro Elite Official Game Ball</h3> | |
| <div class="flex items-center mb-2"> | |
| <div class="flex 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> | |
| <span class="text-gray-600 text-sm ml-2">(128 reviews)</span> | |
| </div> | |
| <p class="text-gray-600 text-sm mb-3">Composite leather, official size and weight for professional play.</p> | |
| <div class="flex justify-between items-center"> | |
| <span class="font-bold text-lg">$89.99</span> | |
| <button class="add-to-cart bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm transition" data-id="1" data-name="Pro Elite Official Game Ball" data-price="89.99"> | |
| Add to Cart | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Product 2 --> | |
| <div class="product-card bg-white rounded-xl overflow-hidden shadow-md"> | |
| <div class="relative h-48 overflow-hidden"> | |
| <img src="https://m.media-amazon.com/images/I/71+UqG+QmUL._AC_UF1000,1000_QL80_.jpg" alt="Street King Basketball" class="w-full h-full object-contain p-4"> | |
| </div> | |
| <div class="p-4"> | |
| <h3 class="font-bold text-lg mb-1">Street King Outdoor Ball</h3> | |
| <div class="flex items-center mb-2"> | |
| <div class="flex 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="far fa-star"></i> | |
| </div> | |
| <span class="text-gray-600 text-sm ml-2">(94 reviews)</span> | |
| </div> | |
| <p class="text-gray-600 text-sm mb-3">Durable rubber construction perfect for outdoor courts and street play.</p> | |
| <div class="flex justify-between items-center"> | |
| <span class="font-bold text-lg">$34.99</span> | |
| <button class="add-to-cart bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm transition" data-id="2" data-name="Street King Outdoor Ball" data-price="34.99"> | |
| Add to Cart | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Product 3 --> | |
| <div class="product-card bg-white rounded-xl overflow-hidden shadow-md"> | |
| <div class="relative h-48 overflow-hidden"> | |
| <img src="https://m.media-amazon.com/images/I/71e4b2+QNTL._AC_UF1000,1000_QL80_.jpg" alt="Training Pro Basketball" class="w-full h-full object-contain p-4"> | |
| <div class="absolute top-2 right-2 bg-green-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">Training Pro Basketball</h3> | |
| <div class="flex items-center mb-2"> | |
| <div class="flex 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> | |
| <span class="text-gray-600 text-sm ml-2">(56 reviews)</span> | |
| </div> | |
| <p class="text-gray-600 text-sm mb-3">Special textured surface for enhanced grip during practice sessions.</p> | |
| <div class="flex justify-between items-center"> | |
| <span class="font-bold text-lg">$59.99</span> | |
| <button class="add-to-cart bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm transition" data-id="3" data-name="Training Pro Basketball" data-price="59.99"> | |
| Add to Cart | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Product 4 --> | |
| <div class="product-card bg-white rounded-xl overflow-hidden shadow-md"> | |
| <div class="relative h-48 overflow-hidden"> | |
| <img src="https://m.media-amazon.com/images/I/71z9dC-0JYL._AC_UF1000,1000_QL80_.jpg" alt="Youth All-Star Basketball" class="w-full h-full object-contain p-4"> | |
| </div> | |
| <div class="p-4"> | |
| <h3 class="font-bold text-lg mb-1">Youth All-Star Basketball</h3> | |
| <div class="flex items-center mb-2"> | |
| <div class="flex 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> | |
| <span class="text-gray-600 text-sm ml-2">(72 reviews)</span> | |
| </div> | |
| <p class="text-gray-600 text-sm mb-3">Smaller size perfect for young players developing their skills.</p> | |
| <div class="flex justify-between items-center"> | |
| <span class="font-bold text-lg">$24.99</span> | |
| <button class="add-to-cart bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm transition" data-id="4" data-name="Youth All-Star Basketball" data-price="24.99"> | |
| Add to Cart | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Testimonials Section --> | |
| <section id="testimonials" class="py-16 bg-white"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-12">What Players Say</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-8"> | |
| <div class="bg-gray-50 p-6 rounded-xl"> | |
| <div class="flex items-center mb-4"> | |
| <img src="https://randomuser.me/api/portraits/men/32.jpg" alt="Jason T." class="w-12 h-12 rounded-full mr-4"> | |
| <div> | |
| <h4 class="font-semibold">Jason T.</h4> | |
| <div class="flex text-yellow-400 text-sm"> | |
| <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> | |
| </div> | |
| <p class="text-gray-600">"The Pro Elite ball has completely transformed my game. The grip is incredible even after months of heavy use. Worth every penny!"</p> | |
| </div> | |
| <div class="bg-gray-50 p-6 rounded-xl"> | |
| <div class="flex items-center mb-4"> | |
| <img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Sarah K." class="w-12 h-12 rounded-full mr-4"> | |
| <div> | |
| <h4 class="font-semibold">Sarah K.</h4> | |
| <div class="flex text-yellow-400 text-sm"> | |
| <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> | |
| </div> | |
| <p class="text-gray-600">"I bought the Youth All-Star for my son and he loves it! Perfect size and weight for his age. He's improved so much since getting it."</p> | |
| </div> | |
| <div class="bg-gray-50 p-6 rounded-xl"> | |
| <div class="flex items-center mb-4"> | |
| <img src="https://randomuser.me/api/portraits/men/75.jpg" alt="Marcus D." class="w-12 h-12 rounded-full mr-4"> | |
| <div> | |
| <h4 class="font-semibold">Marcus D.</h4> | |
| <div class="flex text-yellow-400 text-sm"> | |
| <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> | |
| </div> | |
| <p class="text-gray-600">"The Street King holds up amazingly well on concrete. Most outdoor balls wear out quickly but this one still looks new after 6 months."</p> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Newsletter Section --> | |
| <section class="py-16 gradient-bg text-white"> | |
| <div class="container mx-auto px-4 text-center"> | |
| <h2 class="text-3xl font-bold mb-4">Join Our Basketball Community</h2> | |
| <p class="text-xl mb-8 max-w-2xl mx-auto">Subscribe to get exclusive offers, training tips, and the latest basketball gear updates.</p> | |
| <div class="max-w-md mx-auto flex"> | |
| <input type="email" placeholder="Your email address" class="flex-grow px-4 py-3 rounded-l-lg focus:outline-none text-gray-900"> | |
| <button class="bg-orange-500 hover:bg-orange-600 px-6 py-3 rounded-r-lg font-medium transition">Subscribe</button> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Contact Section --> | |
| <section id="contact" class="py-16 bg-white"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-12">Contact Us</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-12"> | |
| <div> | |
| <h3 class="text-xl font-semibold mb-4">Get in Touch</h3> | |
| <p class="text-gray-600 mb-6">Have questions about our products or need help with your order? Our team is here to assist you.</p> | |
| <div class="space-y-4"> | |
| <div class="flex items-start"> | |
| <i class="fas fa-map-marker-alt text-blue-600 mt-1 mr-4"></i> | |
| <div> | |
| <h4 class="font-medium">Address</h4> | |
| <p class="text-gray-600">123 Court Street, Basketball City, BC 90210</p> | |
| </div> | |
| </div> | |
| <div class="flex items-start"> | |
| <i class="fas fa-phone-alt text-blue-600 mt-1 mr-4"></i> | |
| <div> | |
| <h4 class="font-medium">Phone</h4> | |
| <p class="text-gray-600">(555) 123-4567</p> | |
| </div> | |
| </div> | |
| <div class="flex items-start"> | |
| <i class="fas fa-envelope text-blue-600 mt-1 mr-4"></i> | |
| <div> | |
| <h4 class="font-medium">Email</h4> | |
| <p class="text-gray-600">support@hoopshub.com</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div> | |
| <form class="space-y-4"> | |
| <div> | |
| <label for="name" class="block text-gray-700 mb-1">Name</label> | |
| <input type="text" id="name" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| </div> | |
| <div> | |
| <label for="email" class="block text-gray-700 mb-1">Email</label> | |
| <input type="email" id="email" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| </div> | |
| <div> | |
| <label for="message" class="block text-gray-700 mb-1">Message</label> | |
| <textarea id="message" rows="4" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea> | |
| </div> | |
| <button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-lg font-medium transition">Send Message</button> | |
| </form> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Footer --> | |
| <footer class="bg-gray-900 text-white py-12"> | |
| <div class="container mx-auto px-4"> | |
| <div class="grid grid-cols-1 md:grid-cols-4 gap-8"> | |
| <div> | |
| <div class="flex items-center space-x-2 mb-4"> | |
| <i class="fas fa-basketball-ball text-2xl text-orange-500"></i> | |
| <h3 class="text-xl font-bold">HoopsHub</h3> | |
| </div> | |
| <p class="text-gray-400">Premium basketball equipment for players at every level. Elevate your game with our high-performance gear.</p> | |
| </div> | |
| <div> | |
| <h4 class="text-lg font-semibold mb-4">Shop</h4> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">All Products</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">New Arrivals</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Bestsellers</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Sale Items</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h4 class="text-lg font-semibold mb-4">Support</h4> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Contact Us</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">FAQs</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Shipping Info</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Returns & Exchanges</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h4 class="text-lg font-semibold mb-4">Connect</h4> | |
| <div class="flex space-x-4 mb-4"> | |
| <a href="#" class="text-gray-400 hover:text-white transition"><i class="fab fa-facebook-f"></i></a> | |
| <a href="#" class="text-gray-400 hover:text-white transition"><i class="fab fa-twitter"></i></a> | |
| <a href="#" class="text-gray-400 hover:text-white transition"><i class="fab fa-instagram"></i></a> | |
| <a href="#" class="text-gray-400 hover:text-white transition"><i class="fab fa-youtube"></i></a> | |
| </div> | |
| <p class="text-gray-400">Subscribe to our newsletter for the latest updates and offers.</p> | |
| </div> | |
| </div> | |
| <div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-400"> | |
| <p>© 2023 HoopsHub. All rights reserved.</p> | |
| </div> | |
| </div> | |
| </footer> | |
| <!-- Shopping Cart Modal --> | |
| <div id="cart-modal" class="fixed inset-0 bg-black bg-opacity-50 z-50 hidden"> | |
| <div class="absolute right-0 top-0 h-full w-full sm:w-96 bg-white shadow-lg overflow-y-auto"> | |
| <div class="p-6"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h3 class="text-xl font-bold">Your Cart</h3> | |
| <button id="close-cart" class="text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-times"></i> | |
| </button> | |
| </div> | |
| <div id="cart-items" class="space-y-4 mb-6"> | |
| <!-- Cart items will be added here dynamically --> | |
| <p id="empty-cart-message" class="text-gray-500 text-center py-8">Your cart is empty</p> | |
| </div> | |
| <div class="border-t border-gray-200 pt-4"> | |
| <div class="flex justify-between mb-2"> | |
| <span class="font-medium">Subtotal</span> | |
| <span id="cart-subtotal" class="font-bold">$0.00</span> | |
| </div> | |
| <button class="w-full bg-blue-600 hover:bg-blue-700 text-white py-3 rounded-lg font-medium transition">Checkout</button> | |
| <div class="text-center mt-4"> | |
| <a href="#" class="text-blue-600 hover:underline">Continue Shopping</a> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // Mobile menu toggle | |
| document.getElementById('menu-toggle').addEventListener('click', function() { | |
| document.getElementById('mobile-menu').classList.toggle('hidden'); | |
| }); | |
| // Shopping cart functionality | |
| let cart = []; | |
| // Add to cart buttons | |
| document.querySelectorAll('.add-to-cart').forEach(button => { | |
| button.addEventListener('click', function() { | |
| const id = this.getAttribute('data-id'); | |
| const name = this.getAttribute('data-name'); | |
| const price = parseFloat(this.getAttribute('data-price')); | |
| // Check if item already in cart | |
| const existingItem = cart.find(item => item.id === id); | |
| if (existingItem) { | |
| existingItem.quantity += 1; | |
| } else { | |
| cart.push({ | |
| id, | |
| name, | |
| price, | |
| quantity: 1 | |
| }); | |
| } | |
| updateCart(); | |
| showCartNotification(); | |
| }); | |
| }); | |
| // Update cart UI | |
| function updateCart() { | |
| const cartItemsElement = document.getElementById('cart-items'); | |
| const emptyCartMessage = document.getElementById('empty-cart-message'); | |
| const cartCountElement = document.getElementById('cart-count'); | |
| const cartSubtotalElement = document.getElementById('cart-subtotal'); | |
| // Update cart count | |
| const totalItems = cart.reduce((sum, item) => sum + item.quantity, 0); | |
| cartCountElement.textContent = totalItems; | |
| // Update cart items list | |
| if (cart.length === 0) { | |
| emptyCartMessage.classList.remove('hidden'); | |
| cartItemsElement.innerHTML = ''; | |
| } else { | |
| emptyCartMessage.classList.add('hidden'); | |
| let itemsHTML = ''; | |
| let subtotal = 0; | |
| cart.forEach(item => { | |
| const itemTotal = item.price * item.quantity; | |
| subtotal += itemTotal; | |
| itemsHTML += ` | |
| <div class="flex justify-between items-center border-b border-gray-100 pb-4"> | |
| <div> | |
| <h4 class="font-medium">${item.name}</h4> | |
| <p class="text-gray-600 text-sm">$${item.price.toFixed(2)}</p> | |
| </div> | |
| <div class="flex items-center"> | |
| <button class="decrease-quantity text-gray-500 px-2" data-id="${item.id}">-</button> | |
| <span class="mx-2">${item.quantity}</span> | |
| <button class="increase-quantity text-gray-500 px-2" data-id="${item.id}">+</button> | |
| <button class="remove-item text-red-500 ml-4" data-id="${item.id}"> | |
| <i class="fas fa-trash"></i> | |
| </button> | |
| </div> | |
| </div> | |
| `; | |
| }); | |
| cartItemsElement.innerHTML = itemsHTML; | |
| cartSubtotalElement.textContent = `$${subtotal.toFixed(2)}`; | |
| // Add event listeners to new buttons | |
| document.querySelectorAll('.decrease-quantity').forEach(button => { | |
| button.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); | |
| } | |
| updateCart(); | |
| }); | |
| }); | |
| document.querySelectorAll('.increase-quantity').forEach(button => { | |
| button.addEventListener('click', function() { | |
| const id = this.getAttribute('data-id'); | |
| const item = cart.find(item => item.id === id); | |
| item.quantity += 1; | |
| updateCart(); | |
| }); | |
| }); | |
| document.querySelectorAll('.remove-item').forEach(button => { | |
| button.addEventListener('click', function() { | |
| const id = this.getAttribute('data-id'); | |
| cart = cart.filter(item => item.id !== id); | |
| updateCart(); | |
| }); | |
| }); | |
| } | |
| } | |
| // Show cart notification | |
| function showCartNotification() { | |
| const notification = document.createElement('div'); | |
| notification.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-lg shadow-lg'; | |
| notification.textContent = 'Item added to cart!'; | |
| document.body.appendChild(notification); | |
| setTimeout(() => { | |
| notification.classList.add('opacity-0', 'transition-opacity', 'duration-300'); | |
| setTimeout(() => notification.remove(), 300); | |
| }, 2000); | |
| } | |
| // Cart modal toggle | |
| document.querySelector('header button:first-of-type').addEventListener('click', function() { | |
| document.getElementById('cart-modal').classList.remove('hidden'); | |
| }); | |
| document.getElementById('close-cart').addEventListener('click', function() { | |
| document.getElementById('cart-modal').classList.add('hidden'); | |
| }); | |
| // Close cart when clicking outside | |
| document.getElementById('cart-modal').addEventListener('click', function(e) { | |
| if (e.target === this) { | |
| this.classList.add('hidden'); | |
| } | |
| }); | |
| // Smooth scrolling for anchor links | |
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { | |
| anchor.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| const targetId = this.getAttribute('href'); | |
| if (targetId === '#') return; | |
| const targetElement = document.querySelector(targetId); | |
| if (targetElement) { | |
| targetElement.scrollIntoView({ | |
| behavior: 'smooth' | |
| }); | |
| // Close mobile menu if open | |
| if (!document.getElementById('mobile-menu').classList.contains('hidden')) { | |
| document.getElementById('mobile-menu').classList.add('hidden'); | |
| } | |
| } | |
| }); | |
| }); | |
| </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=pedrinhilo/basketball-ecomerce" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |