Products Section
Preview
Edit
Download
Run
Download Options
HTML File
Download as .html file
CSS File
Download as .css file
JavaScript File
Download as .js file
Combined HTML
All code in one HTML file
Project ZIP
All files in a ZIP archive
Cancel
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Luxury Blue Products</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> </head> <body> <section class="products-section"> <div class="section-header"> <h2>Premium Blue Collection</h2> <p>Discover our exquisite selection of high-end products designed for those who appreciate quality and elegance.</p> </div> <div class="products-container"> <!-- Product 1 --> <div class="product-card"> <div class="product-image"> <img src="https://images.unsplash.com/photo-1551434678-e076c223a692?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Luxury Watch"> <span class="product-badge">New Arrival</span> </div> <div class="product-content"> <span class="product-category">Watches</span> <h3 class="product-title">Navitimer Blue Edition</h3> <p class="product-description">Precision Swiss-made chronograph with blue alligator leather strap and sapphire crystal.</p> <div class="product-footer"> <div class="product-price">$4,299 <span>$4,599</span></div> <button class="add-to-cart"> <i class="fas fa-shopping-cart"></i> Add to Cart </button> </div> </div> </div> <!-- Product 2 --> <div class="product-card"> <div class="product-image"> <img src="https://images.unsplash.com/photo-1542291026-7eec264c27ff?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Running Shoes"> <span class="product-badge">Best Seller</span> </div> <div class="product-content"> <span class="product-category">Footwear</span> <h3 class="product-title">Ocean Pro Runners</h3> <p class="product-description">High-performance athletic shoes with blue carbon fiber soles and breathable mesh.</p> <div class="product-footer"> <div class="product-price">$189 <span>$229</span></div> <button class="add-to-cart"> <i class="fas fa-shopping-cart"></i> Add to Cart </button> </div> </div> </div> <!-- Product 3 --> <div class="product-card"> <div class="product-image"> <img src="https://images.unsplash.com/photo-1523275335684-37898b6baf30?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1399&q=80" alt="Wireless Headphones"> </div> <div class="product-content"> <span class="product-category">Audio</span> <h3 class="product-title">Azure Noise-Canceling</h3> <p class="product-description">Premium wireless headphones with deep blue aluminum finish and 30-hour battery life.</p> <div class="product-footer"> <div class="product-price">$349 <span>$399</span></div> <button class="add-to-cart"> <i class="fas fa-shopping-cart"></i> Add to Cart </button> </div> </div> </div> <!-- Product 4 --> <div class="product-card"> <div class="product-image"> <img src="https://images.unsplash.com/photo-1594035910387-fea47794261f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1480&q=80" alt="Leather Bag"> <span class="product-badge">Limited</span> </div> <div class="product-content"> <span class="product-category">Accessories</span> <h3 class="product-title">Marine Executive Briefcase</h3> <p class="product-description">Handcrafted Italian blue leather briefcase with gold hardware and anti-theft protection.</p> <div class="product-footer"> <div class="product-price">$599 <span>$699</span></div> <button class="add-to-cart"> <i class="fas fa-shopping-cart"></i> Add to Cart </button> </div> </div> </div> </div> </section> </body> </html>
CSS
:root { --primary-blue: #0a2463; --secondary-blue: #3e92cc; --accent-blue: #1e96fc; --light-blue: #d6f1ff; --dark-blue: #001845; --white: #ffffff; --gray: #f5f5f5; --shadow: 0 15px 30px rgba(0, 40, 100, 0.15); } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } body { background-color: var(--gray); color: var(--dark-blue); } .products-section { padding: 5rem 2rem; max-width: 1400px; margin: 0 auto; } .section-header { text-align: center; margin-bottom: 4rem; } .section-header h2 { font-size: 2.5rem; color: var(--primary-blue); margin-bottom: 1rem; position: relative; display: inline-block; } .section-header h2::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 80px; height: 4px; background: linear-gradient(90deg, var(--accent-blue), var(--secondary-blue)); border-radius: 2px; } .section-header p { font-size: 1.1rem; color: var(--primary-blue); opacity: 0.8; max-width: 700px; margin: 0 auto; line-height: 1.6; } .products-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; } .product-card { background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); transition: all 0.4s ease; position: relative; z-index: 1; } .product-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0, 40, 100, 0.2); } .product-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, var(--light-blue), var(--white)); z-index: -1; opacity: 0; transition: opacity 0.4s ease; } .product-card:hover::before { opacity: 1; } .product-image { height: 220px; overflow: hidden; position: relative; } .product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; } .product-card:hover .product-image img { transform: scale(1.05); } .product-badge { position: absolute; top: 15px; right: 15px; background: var(--accent-blue); color: var(--white); padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } .product-content { padding: 1.5rem; } .product-category { color: var(--secondary-blue); font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; display: block; } .product-title { font-size: 1.3rem; font-weight: 700; color: var(--primary-blue); margin-bottom: 0.8rem; transition: color 0.3s ease; } .product-card:hover .product-title { color: var(--accent-blue); } .product-description { color: #555; font-size: 0.95rem; line-height: 1.5; margin-bottom: 1.2rem; } .product-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; border-top: 1px solid rgba(0, 0, 0, 0.05); } .product-price { font-size: 1.4rem; font-weight: 700; color: var(--primary-blue); } .product-price span { font-size: 1rem; font-weight: 400; color: #777; text-decoration: line-through; margin-left: 0.5rem; } .add-to-cart { background: linear-gradient(90deg, var(--accent-blue), var(--secondary-blue)); color: var(--white); border: none; padding: 0.6rem 1.2rem; border-radius: 6px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 0.5rem; } .add-to-cart:hover { background: linear-gradient(90deg, var(--secondary-blue), var(--accent-blue)); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(62, 146, 204, 0.4); } .add-to-cart i { font-size: 0.9rem; } /* Animations */ @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .product-card { opacity: 0; animation: fadeInUp 0.6s ease forwards; } .product-card:nth-child(1) { animation-delay: 0.1s; } .product-card:nth-child(2) { animation-delay: 0.2s; } .product-card:nth-child(3) { animation-delay: 0.3s; } .product-card:nth-child(4) { animation-delay: 0.4s; } /* Responsive Design */ @media (max-width: 1024px) { .products-container { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } } @media (max-width: 768px) { .section-header h2 { font-size: 2rem; } .section-header p { font-size: 1rem; } .products-container { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); } } @media (max-width: 576px) { .products-section { padding: 3rem 1.5rem; } .section-header { margin-bottom: 3rem; } .products-container { grid-template-columns: 1fr; gap: 1.5rem; } }
JavaScript
// Additional animation on scroll document.addEventListener('DOMContentLoaded', function() { const productCards = document.querySelectorAll('.product-card'); const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.style.animationPlayState = 'running'; observer.unobserve(entry.target); } }); }, { threshold: 0.1 }); productCards.forEach(card => { observer.observe(card); }); // Add to cart animation const addToCartButtons = document.querySelectorAll('.add-to-cart'); addToCartButtons.forEach(button => { button.addEventListener('click', function() { this.innerHTML = '<i class="fas fa-check"></i> Added'; this.style.background = 'linear-gradient(90deg, #4CAF50, #2E7D32)'; setTimeout(() => { this.innerHTML = '<i class="fas fa-shopping-cart"></i> Add to Cart'; this.style.background = 'linear-gradient(90deg, var(--accent-blue), var(--secondary-blue))'; }, 2000); }); }); });
Output Preview
Desktop
Mobile
Fullscreen