|
|
<!DOCTYPE html> |
|
|
<html lang="en"> |
|
|
<head> |
|
|
<meta charset="UTF-8"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
<title>T-Shirt Store | AyoubShop</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> |
|
|
.product-card:hover { |
|
|
transform: translateY(-5px); |
|
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); |
|
|
} |
|
|
|
|
|
.cart-item-enter { |
|
|
opacity: 0; |
|
|
transform: translateX(20px); |
|
|
} |
|
|
.cart-item-enter-active { |
|
|
opacity: 1; |
|
|
transform: translateX(0); |
|
|
transition: all 300ms ease-in; |
|
|
} |
|
|
.cart-item-exit { |
|
|
opacity: 1; |
|
|
} |
|
|
.cart-item-exit-active { |
|
|
opacity: 0; |
|
|
transform: translateX(20px); |
|
|
transition: all 300ms ease-in; |
|
|
} |
|
|
|
|
|
@keyframes pulse { |
|
|
0%, 100% { transform: scale(1); } |
|
|
50% { transform: scale(1.05); } |
|
|
} |
|
|
|
|
|
.cart-pulse { |
|
|
animation: pulse 1.5s infinite; |
|
|
} |
|
|
</style> |
|
|
</head> |
|
|
<body class="bg-gray-50"> |
|
|
|
|
|
<header class="bg-white shadow-sm sticky top-0 z-50"> |
|
|
<div class="container mx-auto px-4 py-4 flex justify-between items-center"> |
|
|
<div class="flex items-center"> |
|
|
<a href="#" class="text-2xl font-bold text-indigo-600">TeeShop</a> |
|
|
</div> |
|
|
|
|
|
<nav class="hidden md:flex space-x-8"> |
|
|
<a href="#" class="text-gray-800 hover:text-indigo-600">Home</a> |
|
|
<a href="#shop" class="text-gray-800 hover:text-indigo-600">Shop</a> |
|
|
<a href="#about" class="text-gray-800 hover:text-indigo-600">About</a> |
|
|
<a href="#contact" class="text-gray-800 hover:text-indigo-600">Contact</a> |
|
|
</nav> |
|
|
|
|
|
<div class="flex items-center space-x-4"> |
|
|
<button id="cartBtn" class="relative"> |
|
|
<i class="fas fa-shopping-cart text-gray-700 text-xl"></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> |
|
|
</button> |
|
|
|
|
|
<button class="md:hidden" id="mobileMenuBtn"> |
|
|
<i class="fas fa-bars text-gray-700 text-xl"></i> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div id="mobileMenu" class="hidden md:hidden bg-white py-2 px-4 shadow-md"> |
|
|
<a href="#" class="block py-2 text-gray-800 hover:text-indigo-600">Home</a> |
|
|
<a href="#shop" class="block py-2 text-gray-800 hover:text-indigo-600">Shop</a> |
|
|
<a href="#about" class="block py-2 text-gray-800 hover:text-indigo-600">About</a> |
|
|
<a href="#contact" class="block py-2 text-gray-800 hover:text-indigo-600">Contact</a> |
|
|
</div> |
|
|
</header> |
|
|
|
|
|
|
|
|
<section class="bg-gradient-to-r from-indigo-500 to-purple-600 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-8 md:mb-0"> |
|
|
<h1 class="text-4xl md:text-5xl font-bold mb-4">Premium Quality T-Shirts</h1> |
|
|
<p class="text-xl mb-6">Comfortable, stylish, and made to last. Find your perfect tee today.</p> |
|
|
<a href="#shop" class="bg-white text-indigo-600 px-6 py-3 rounded-lg font-medium hover:bg-gray-100 transition duration-300 inline-block">Shop Now</a> |
|
|
</div> |
|
|
<div class="md:w-1/2 flex justify-center"> |
|
|
<img src="https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=880&q=80" alt="T-Shirt Display" class="rounded-lg shadow-xl max-w-full h-auto max-h-96"> |
|
|
</div> |
|
|
</div> |
|
|
</section> |
|
|
|
|
|
|
|
|
<section id="shop" class="py-16 bg-white"> |
|
|
<div class="container mx-auto px-4"> |
|
|
<h2 class="text-3xl font-bold text-center mb-12">Our T-Shirt Collection</h2> |
|
|
|
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8"> |
|
|
|
|
|
<div class="product-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300"> |
|
|
<div class="relative"> |
|
|
<img src="https://images.unsplash.com/photo-1527719327859-c6ce80353573?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774&q=80" alt="Graphic T-Shirt" class="w-full h-64 object-cover"> |
|
|
<div class="absolute top-2 right-2 bg-indigo-600 text-white text-xs px-2 py-1 rounded">Bestseller</div> |
|
|
</div> |
|
|
<div class="p-4"> |
|
|
<h3 class="font-semibold text-lg mb-1">Urban Explorer</h3> |
|
|
<p class="text-gray-600 text-sm mb-2">Graphic Print T-Shirt</p> |
|
|
<div class="flex justify-between items-center"> |
|
|
<span class="font-bold text-indigo-600">$24.99</span> |
|
|
<button class="add-to-cart bg-indigo-600 text-white px-3 py-1 rounded text-sm hover:bg-indigo-700 transition" data-id="1" data-name="Urban Explorer" data-price="24.99" data-image="https://images.unsplash.com/photo-1527719327859-c6ce80353573?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774&q=80"> |
|
|
Add to Cart |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="product-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300"> |
|
|
<div class="relative"> |
|
|
<img src="https://images.unsplash.com/photo-1576566588028-4147f3842f27?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1064&q=80" alt="Plain T-Shirt" class="w-full h-64 object-cover"> |
|
|
</div> |
|
|
<div class="p-4"> |
|
|
<h3 class="font-semibold text-lg mb-1">Classic Comfort</h3> |
|
|
<p class="text-gray-600 text-sm mb-2">Basic Cotton T-Shirt</p> |
|
|
<div class="flex justify-between items-center"> |
|
|
<span class="font-bold text-indigo-600">$19.99</span> |
|
|
<button class="add-to-cart bg-indigo-600 text-white px-3 py-1 rounded text-sm hover:bg-indigo-700 transition" data-id="2" data-name="Classic Comfort" data-price="19.99" data-image="https://images.unsplash.com/photo-1576566588028-4147f3842f27?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1064&q=80"> |
|
|
Add to Cart |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="product-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300"> |
|
|
<div class="relative"> |
|
|
<img src="https://images.unsplash.com/photo-1598033129183-c4f50c736ef7?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1025&q=80" alt="Vintage T-Shirt" class="w-full h-64 object-cover"> |
|
|
<div class="absolute top-2 right-2 bg-yellow-500 text-white text-xs px-2 py-1 rounded">Sale</div> |
|
|
</div> |
|
|
<div class="p-4"> |
|
|
<h3 class="font-semibold text-lg mb-1">Retro Vibes</h3> |
|
|
<p class="text-gray-600 text-sm mb-2">Vintage Washed T-Shirt</p> |
|
|
<div class="flex justify-between items-center"> |
|
|
<div> |
|
|
<span class="font-bold text-indigo-600">$22.99</span> |
|
|
<span class="text-gray-400 text-sm line-through ml-2">$29.99</span> |
|
|
</div> |
|
|
<button class="add-to-cart bg-indigo-600 text-white px-3 py-1 rounded text-sm hover:bg-indigo-700 transition" data-id="3" data-name="Retro Vibes" data-price="22.99" data-image="https://images.unsplash.com/photo-1598033129183-c4f50c736ef7?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1025&q=80"> |
|
|
Add to Cart |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="product-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300"> |
|
|
<div class="relative"> |
|
|
<img src="https://images.unsplash.com/photo-1620799140408-edc6dcb6d633?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1072&q=80" alt="Pocket T-Shirt" class="w-full h-64 object-cover"> |
|
|
</div> |
|
|
<div class="p-4"> |
|
|
<h3 class="font-semibold text-lg mb-1">Essential Pocket</h3> |
|
|
<p class="text-gray-600 text-sm mb-2">Pocket Detail T-Shirt</p> |
|
|
<div class="flex justify-between items-center"> |
|
|
<span class="font-bold text-indigo-600">$26.99</span> |
|
|
<button class="add-to-cart bg-indigo-600 text-white px-3 py-1 rounded text-sm hover:bg-indigo-700 transition" data-id="4" data-name="Essential Pocket" data-price="26.99" data-image="https://images.unsplash.com/photo-1620799140408-edc6dcb6d633?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1072&q=80"> |
|
|
Add to Cart |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</section> |
|
|
|
|
|
|
|
|
<section id="about" class="py-16 bg-gray-100"> |
|
|
<div class="container mx-auto px-4"> |
|
|
<div class="flex flex-col md:flex-row items-center"> |
|
|
<div class="md:w-1/2 mb-8 md:mb-0 md:pr-8"> |
|
|
<h2 class="text-3xl font-bold mb-6">About Our T-Shirts</h2> |
|
|
<p class="text-gray-700 mb-4"> |
|
|
We believe in creating high-quality, comfortable t-shirts that you'll love to wear every day. |
|
|
Our tees are made from premium 100% cotton fabric that gets softer with every wash. |
|
|
</p> |
|
|
<p class="text-gray-700 mb-4"> |
|
|
Each design is carefully crafted to ensure both style and durability. We use eco-friendly |
|
|
printing methods that are gentle on the environment and produce vibrant, long-lasting prints. |
|
|
</p> |
|
|
<p class="text-gray-700"> |
|
|
From classic fits to modern styles, we have something for everyone. Shop our collection and |
|
|
experience the difference quality makes. |
|
|
</p> |
|
|
</div> |
|
|
<div class="md:w-1/2"> |
|
|
<img src="https://images.unsplash.com/photo-1529374255404-311a2a4f1fd9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1169&q=80" alt="About Our T-Shirts" class="rounded-lg shadow-lg w-full"> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</section> |
|
|
|
|
|
|
|
|
<section class="py-16 bg-white"> |
|
|
<div class="container mx-auto px-4"> |
|
|
<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 mr-2"> |
|
|
<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-700 mb-4"> |
|
|
"The quality of these t-shirts is amazing! They're so comfortable and the print hasn't faded |
|
|
even after multiple washes. Will definitely be buying more." |
|
|
</p> |
|
|
<div class="flex items-center"> |
|
|
<img src="https://randomuser.me/api/portraits/women/43.jpg" alt="Sarah J." class="w-10 h-10 rounded-full mr-3"> |
|
|
<div> |
|
|
<h4 class="font-semibold">Sarah J.</h4> |
|
|
<p class="text-gray-500 text-sm">Verified Customer</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 mr-2"> |
|
|
<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-700 mb-4"> |
|
|
"I love the fit of these shirts. They're not too tight but still have a nice shape. The fabric |
|
|
is breathable and perfect for summer." |
|
|
</p> |
|
|
<div class="flex items-center"> |
|
|
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="Michael T." class="w-10 h-10 rounded-full mr-3"> |
|
|
<div> |
|
|
<h4 class="font-semibold">Michael T.</h4> |
|
|
<p class="text-gray-500 text-sm">Verified Customer</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 mr-2"> |
|
|
<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-700 mb-4"> |
|
|
"Great customer service and fast shipping. The t-shirt arrived exactly as pictured and fits |
|
|
perfectly. Will be ordering more colors soon!" |
|
|
</p> |
|
|
<div class="flex items-center"> |
|
|
<img src="https://randomuser.me/api/portraits/women/65.jpg" alt="Jessica L." class="w-10 h-10 rounded-full mr-3"> |
|
|
<div> |
|
|
<h4 class="font-semibold">Jessica L.</h4> |
|
|
<p class="text-gray-500 text-sm">Verified Customer</p> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</section> |
|
|
|
|
|
|
|
|
<section id="contact" class="py-16 bg-indigo-50"> |
|
|
<div class="container mx-auto px-4"> |
|
|
<h2 class="text-3xl font-bold text-center mb-12">Contact Us</h2> |
|
|
|
|
|
<div class="max-w-3xl mx-auto bg-white rounded-lg shadow-md overflow-hidden"> |
|
|
<div class="md:flex"> |
|
|
<div class="md:w-1/2 bg-indigo-600 text-white p-8"> |
|
|
<h3 class="text-xl font-semibold mb-4">Get in Touch</h3> |
|
|
<p class="mb-6">Have questions about our products or need assistance with your order? Reach out to us!</p> |
|
|
|
|
|
<div class="mb-4 flex items-start"> |
|
|
<i class="fas fa-map-marker-alt mt-1 mr-3"></i> |
|
|
<p>123 T-Shirt Street, Fashion District, CA 90210</p> |
|
|
</div> |
|
|
<div class="mb-4 flex items-center"> |
|
|
<i class="fas fa-phone-alt mr-3"></i> |
|
|
<p>(555) 123-4567</p> |
|
|
</div> |
|
|
<div class="flex items-center"> |
|
|
<i class="fas fa-envelope mr-3"></i> |
|
|
<p>info@teeshop.com</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="md:w-1/2 p-8"> |
|
|
<form id="contactForm"> |
|
|
<div class="mb-4"> |
|
|
<label for="name" class="block text-gray-700 mb-2">Name</label> |
|
|
<input type="text" id="name" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500"> |
|
|
</div> |
|
|
<div class="mb-4"> |
|
|
<label for="email" class="block text-gray-700 mb-2">Email</label> |
|
|
<input type="email" id="email" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500"> |
|
|
</div> |
|
|
<div class="mb-4"> |
|
|
<label for="message" class="block text-gray-700 mb-2">Message</label> |
|
|
<textarea id="message" rows="4" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500"></textarea> |
|
|
</div> |
|
|
<button type="submit" class="bg-indigo-600 text-white px-6 py-2 rounded-lg hover:bg-indigo-700 transition w-full"> |
|
|
Send Message |
|
|
</button> |
|
|
</form> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</section> |
|
|
|
|
|
|
|
|
<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> |
|
|
<h3 class="text-xl font-bold mb-4">TeeShop</h3> |
|
|
<p class="text-gray-400"> |
|
|
Premium quality t-shirts for every occasion. Comfortable, stylish, and made to last. |
|
|
</p> |
|
|
</div> |
|
|
|
|
|
<div> |
|
|
<h4 class="font-semibold mb-4">Quick Links</h4> |
|
|
<ul class="space-y-2"> |
|
|
<li><a href="#" class="text-gray-400 hover:text-white transition">Home</a></li> |
|
|
<li><a href="#shop" class="text-gray-400 hover:text-white transition">Shop</a></li> |
|
|
<li><a href="#about" class="text-gray-400 hover:text-white transition">About</a></li> |
|
|
<li><a href="#contact" class="text-gray-400 hover:text-white transition">Contact</a></li> |
|
|
</ul> |
|
|
</div> |
|
|
|
|
|
<div> |
|
|
<h4 class="font-semibold mb-4">Customer Service</h4> |
|
|
<ul class="space-y-2"> |
|
|
<li><a href="#" class="text-gray-400 hover:text-white transition">Shipping Policy</a></li> |
|
|
<li><a href="#" class="text-gray-400 hover:text-white transition">Returns & Exchanges</a></li> |
|
|
<li><a href="#" class="text-gray-400 hover:text-white transition">Size Guide</a></li> |
|
|
<li><a href="#" class="text-gray-400 hover:text-white transition">FAQs</a></li> |
|
|
</ul> |
|
|
</div> |
|
|
|
|
|
<div> |
|
|
<h4 class="font-semibold mb-4">Connect With Us</h4> |
|
|
<div class="flex space-x-4"> |
|
|
<a href="#" class="text-gray-400 hover:text-white transition text-xl"><i class="fab fa-facebook-f"></i></a> |
|
|
<a href="#" class="text-gray-400 hover:text-white transition text-xl"><i class="fab fa-twitter"></i></a> |
|
|
<a href="#" class="text-gray-400 hover:text-white transition text-xl"><i class="fab fa-instagram"></i></a> |
|
|
<a href="#" class="text-gray-400 hover:text-white transition text-xl"><i class="fab fa-pinterest-p"></i></a> |
|
|
</div> |
|
|
|
|
|
<h4 class="font-semibold mt-6 mb-2">Newsletter</h4> |
|
|
<div class="flex"> |
|
|
<input type="email" placeholder="Your email" class="px-3 py-2 text-gray-900 rounded-l focus:outline-none w-full"> |
|
|
<button class="bg-indigo-600 px-3 py-2 rounded-r hover:bg-indigo-700 transition"> |
|
|
<i class="fas fa-paper-plane"></i> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-500 text-sm"> |
|
|
<p>© 2023 TeeShop. All rights reserved.</p> |
|
|
</div> |
|
|
</div> |
|
|
</footer> |
|
|
|
|
|
|
|
|
<div id="cartSidebar" class="fixed top-0 right-0 h-full w-full md:w-96 bg-white shadow-lg transform translate-x-full transition-transform duration-300 ease-in-out z-50 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="closeCartBtn" class="text-gray-500 hover:text-gray-700"> |
|
|
<i class="fas fa-times"></i> |
|
|
</button> |
|
|
</div> |
|
|
|
|
|
<div id="cartItems" class="mb-6"> |
|
|
|
|
|
<div class="text-center py-8 text-gray-500" id="emptyCartMessage"> |
|
|
<i class="fas fa-shopping-cart text-4xl mb-3"></i> |
|
|
<p>Your cart is empty</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="border-t border-gray-200 pt-4 mb-4"> |
|
|
<div class="flex justify-between mb-2"> |
|
|
<span class="font-semibold">Subtotal:</span> |
|
|
<span id="cartSubtotal">$0.00</span> |
|
|
</div> |
|
|
<div class="flex justify-between mb-2"> |
|
|
<span class="font-semibold">Shipping:</span> |
|
|
<span>Calculated at checkout</span> |
|
|
</div> |
|
|
<div class="flex justify-between text-lg font-bold"> |
|
|
<span>Total:</span> |
|
|
<span id="cartTotal">$0.00</span> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<button id="checkoutBtn" class="bg-indigo-600 text-white w-full py-3 rounded-lg font-medium hover:bg-indigo-700 transition mb-3"> |
|
|
Checkout |
|
|
</button> |
|
|
<a href="#shop" class="block text-center text-indigo-600 hover:text-indigo-800 transition"> |
|
|
Continue Shopping |
|
|
</a> |
|
|
</div> |
|
|
</div> |
|
|
<div id="cartOverlay" class="hidden fixed inset-0 bg-black bg-opacity-50 z-40"></div> |
|
|
|
|
|
<script> |
|
|
document.addEventListener('DOMContentLoaded', function() { |
|
|
|
|
|
const mobileMenuBtn = document.getElementById('mobileMenuBtn'); |
|
|
const mobileMenu = document.getElementById('mobileMenu'); |
|
|
|
|
|
mobileMenuBtn.addEventListener('click', function() { |
|
|
mobileMenu.classList.toggle('hidden'); |
|
|
}); |
|
|
|
|
|
|
|
|
const cartBtn = document.getElementById('cartBtn'); |
|
|
const closeCartBtn = document.getElementById('closeCartBtn'); |
|
|
const cartSidebar = document.getElementById('cartSidebar'); |
|
|
const cartOverlay = document.getElementById('cartOverlay'); |
|
|
const cartCount = document.getElementById('cartCount'); |
|
|
const cartItems = document.getElementById('cartItems'); |
|
|
const emptyCartMessage = document.getElementById('emptyCartMessage'); |
|
|
const cartSubtotal = document.getElementById('cartSubtotal'); |
|
|
const cartTotal = document.getElementById('cartTotal'); |
|
|
const checkoutBtn = document.getElementById('checkoutBtn'); |
|
|
|
|
|
let cart = []; |
|
|
|
|
|
|
|
|
function toggleCart() { |
|
|
cartSidebar.classList.toggle('translate-x-full'); |
|
|
cartOverlay.classList.toggle('hidden'); |
|
|
document.body.classList.toggle('overflow-hidden'); |
|
|
} |
|
|
|
|
|
cartBtn.addEventListener('click', toggleCart); |
|
|
closeCartBtn.addEventListener('click', toggleCart); |
|
|
cartOverlay.addEventListener('click', toggleCart); |
|
|
|
|
|
|
|
|
const addToCartButtons = document.querySelectorAll('.add-to-cart'); |
|
|
|
|
|
addToCartButtons.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')); |
|
|
const image = this.getAttribute('data-image'); |
|
|
|
|
|
|
|
|
const existingItem = cart.find(item => item.id === id); |
|
|
|
|
|
if (existingItem) { |
|
|
existingItem.quantity += 1; |
|
|
} else { |
|
|
cart.push({ |
|
|
id, |
|
|
name, |
|
|
price, |
|
|
image, |
|
|
quantity: 1 |
|
|
}); |
|
|
} |
|
|
|
|
|
updateCart(); |
|
|
|
|
|
|
|
|
cartBtn.classList.add('cart-pulse'); |
|
|
setTimeout(() => { |
|
|
cartBtn.classList.remove('cart-pulse'); |
|
|
}, 1500); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
function updateCart() { |
|
|
|
|
|
const totalItems = cart.reduce((total, item) => total + item.quantity, 0); |
|
|
cartCount.textContent = totalItems; |
|
|
|
|
|
|
|
|
if (cart.length === 0) { |
|
|
emptyCartMessage.classList.remove('hidden'); |
|
|
cartItems.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="cart-item flex items-center py-4 border-b border-gray-200"> |
|
|
<div class="w-16 h-16 bg-gray-100 rounded-lg overflow-hidden mr-4"> |
|
|
<img src="${item.image}" alt="${item.name}" class="w-full h-full object-cover"> |
|
|
</div> |
|
|
<div class="flex-1"> |
|
|
<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 py-1" 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 py-1" data-id="${item.id}"> |
|
|
<i class="fas fa-plus text-xs"></i> |
|
|
</button> |
|
|
</div> |
|
|
<div class="ml-4 font-medium"> |
|
|
$${itemTotal.toFixed(2)} |
|
|
</div> |
|
|
<button class="remove-item ml-4 text-red-500" data-id="${item.id}"> |
|
|
<i class="fas fa-trash"></i> |
|
|
</button> |
|
|
</div> |
|
|
`; |
|
|
}); |
|
|
|
|
|
cartItems.innerHTML = itemsHTML; |
|
|
|
|
|
|
|
|
cartSubtotal.textContent = `$${subtotal.toFixed(2)}`; |
|
|
cartTotal.textContent = `$${subtotal.toFixed(2)}`; |
|
|
|
|
|
|
|
|
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; |
|
|
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(); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
checkoutBtn.addEventListener('click', function() { |
|
|
if (cart.length === 0) { |
|
|
alert('Your cart is empty!'); |
|
|
return; |
|
|
} |
|
|
|
|
|
alert('Checkout functionality would go here!'); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
const contactForm = document.getElementById('contactForm'); |
|
|
|
|
|
contactForm.addEventListener('submit', function(e) { |
|
|
e.preventDefault(); |
|
|
|
|
|
const name = document.getElementById('name').value; |
|
|
const email = document.getElementById('email').value; |
|
|
const message = document.getElementById('message').value; |
|
|
|
|
|
|
|
|
if (!name || !email || !message) { |
|
|
alert('Please fill in all fields'); |
|
|
return; |
|
|
} |
|
|
|
|
|
|
|
|
alert(`Thank you for your message, ${name}! We'll get back to you soon.`); |
|
|
contactForm.reset(); |
|
|
}); |
|
|
}); |
|
|
</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=Sonata71/teeshop" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> |
|
|
</html> |