File size: 15,010 Bytes
5a4691d | 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 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>All Products | LUMINA Store</title>
<meta name="description" content="Browse our complete collection of creative fashion, merchandise, and accessories.">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/lucide@latest"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap" rel="stylesheet">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: { 500: '#f97316', 600: '#ea580c', 50: '#fff7ed' },
creative: { 500: '#0ea5e9', 600: '#0284c7' }
},
fontFamily: {
sans: ['Inter', 'sans-serif'],
display: ['Space Grotesk', 'sans-serif'],
}
}
}
}
</script>
<style>
.glass-nav {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
}
.category-pill.active {
background: #f97316;
color: white;
border-color: #f97316;
}
.product-card { transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.product-card:hover { transform: translateY(-8px); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15); }
.filter-sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
.filter-sidebar.open { transform: translateX(0); }
.backdrop { opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.backdrop.open { opacity: 1; pointer-events: all; }
@media (min-width: 1024px) {
.filter-sidebar { transform: none; position: static; }
.backdrop { display: none; }
}
.loader {
border: 3px solid #f3f3f3;
border-top: 3px solid #f97316;
border-radius: 50%;
width: 24px;
height: 24px;
animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
</style>
</head>
<body class="bg-gray-50 text-gray-900">
<!-- Navigation -->
<nav class="fixed w-full z-50 glass-nav border-b border-gray-100">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-between h-16">
<a href="index.html" class="flex items-center gap-2">
<div class="w-10 h-10 bg-gradient-to-br from-primary-500 to-creative-500 rounded-xl flex items-center justify-center">
<i data-lucide="sparkles" class="w-6 h-6 text-white"></i>
</div>
<span class="font-display text-2xl font-bold">LUMINA</span>
</a>
<div class="flex items-center gap-4">
<button onclick="toggleFilter()" class="lg:hidden p-2 hover:bg-gray-100 rounded-lg">
<i data-lucide="filter" class="w-5 h-5 text-gray-600"></i>
</button>
<a href="cart.html" class="relative p-2 hover:bg-gray-100 rounded-lg">
<i data-lucide="shopping-bag" class="w-5 h-5 text-gray-600"></i>
<span id="cartBadge" class="absolute -top-1 -right-1 w-5 h-5 bg-primary-500 text-white text-xs font-bold rounded-full flex items-center justify-center opacity-0 transition-opacity">0</span>
</a>
</div>
</div>
</div>
</nav>
<!-- Mobile Filter Backdrop -->
<div id="backdrop" class="backdrop fixed inset-0 bg-black/50 z-40 lg:hidden" onclick="toggleFilter()"></div>
<div class="pt-20 min-h-screen flex">
<!-- Filter Sidebar -->
<aside id="filterSidebar" class="filter-sidebar fixed lg:static top-0 left-0 h-full w-72 bg-white border-r border-gray-200 z-50 p-6 overflow-y-auto">
<div class="flex items-center justify-between mb-6 lg:hidden">
<h2 class="font-display text-xl font-bold">Filters</h2>
<button onclick="toggleFilter()" class="p-2 hover:bg-gray-100 rounded-lg">
<i data-lucide="x" class="w-6 h-6"></i>
</button>
</div>
<!-- Categories -->
<div class="mb-8">
<h3 class="font-semibold mb-4">Categories</h3>
<div class="space-y-2">
<button onclick="filterCategory('all')" class="category-pill w-full text-left px-4 py-2 rounded-lg border border-gray-200 hover:border-primary-500 hover:text-primary-600 transition-colors active" data-category="all">
All Products
</button>
<button onclick="filterCategory('clothing')" class="category-pill w-full text-left px-4 py-2 rounded-lg border border-gray-200 hover:border-primary-500 hover:text-primary-600 transition-colors" data-category="clothing">
Clothing
</button>
<button onclick="filterCategory('merch')" class="category-pill w-full text-left px-4 py-2 rounded-lg border border-gray-200 hover:border-primary-500 hover:text-primary-600 transition-colors" data-category="merch">
Merch
</button>
<button onclick="filterCategory('accessories')" class="category-pill w-full text-left px-4 py-2 rounded-lg border border-gray-200 hover:border-primary-500 hover:text-primary-600 transition-colors" data-category="accessories">
Accessories
</button>
<button onclick="filterCategory('lifestyle')" class="category-pill w-full text-left px-4 py-2 rounded-lg border border-gray-200 hover:border-primary-500 hover:text-primary-600 transition-colors" data-category="lifestyle">
Lifestyle
</button>
</div>
</div>
<!-- Price Range -->
<div class="mb-8">
<h3 class="font-semibold mb-4">Price Range</h3>
<div class="px-2">
<input type="range" id="priceRange" min="0" max="5000" step="100" value="5000" class="w-full accent-primary-500 mb-4" onchange="applyPriceFilter(this.value)">
<div class="flex justify-between text-sm text-gray-600">
<span>₹0</span>
<span id="priceValue">₹5,000</span>
</div>
</div>
</div>
<!-- Sort -->
<div class="mb-8">
<h3 class="font-semibold mb-4">Sort By</h3>
<select id="sortSelect" onchange="sortProducts(this.value)" class="w-full px-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:border-primary-500">
<option value="featured">Featured</option>
<option value="price-low">Price: Low to High</option>
<option value="price-high">Price: High to Low</option>
<option value="newest">Newest First</option>
</select>
</div>
<button onclick="clearFilters()" class="w-full border border-gray-300 text-gray-600 px-4 py-2 rounded-lg hover:bg-gray-50 transition-colors">
Clear Filters
</button>
</aside>
<!-- Main Content -->
<main class="flex-1 px-4 sm:px-6 lg:px-8 py-8">
<!-- Header -->
<div class="mb-8">
<h1 class="font-display text-3xl font-bold mb-2" id="pageTitle">All Products</h1>
<p class="text-gray-600" id="productCount">Showing all products</p>
</div>
<!-- Active Filters -->
<div id="activeFilters" class="flex flex-wrap gap-2 mb-6 hidden">
<button onclick="clearFilters()" class="text-sm text-gray-600 bg-gray-100 px-3 py-1 rounded-full flex items-center gap-2 hover:bg-gray-200">
Clear all <i data-lucide="x" class="w-3 h-3"></i>
</button>
</div>
<!-- Product Grid -->
<div id="productGrid" class="grid grid-cols-2 md:grid-cols-3 gap-4 sm:gap-6">
<!-- Products loaded by JS -->
</div>
<!-- Empty State -->
<div id="emptyState" class="hidden text-center py-20">
<div class="w-24 h-24 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4">
<i data-lucide="search" class="w-10 h-10 text-gray-400"></i>
</div>
<h3 class="text-xl font-semibold mb-2">No products found</h3>
<p class="text-gray-600 mb-6">Try adjusting your filters</p>
<button onclick="clearFilters()" class="bg-primary-500 text-white px-6 py-3 rounded-xl font-semibold hover:bg-primary-600 transition-colors">
Clear Filters
</button>
</div>
<!-- Pagination -->
<div class="mt-12 flex justify-center gap-2" id="pagination">
<!-- Pagination by JS -->
</div>
</main>
</div>
<!-- Toast -->
<div id="toast" class="fixed bottom-8 right-8 bg-gray-900 text-white px-6 py-4 rounded-xl shadow-2xl flex items-center gap-3 transform translate-y-20 opacity-0 transition-all duration-300 z-50">
<i data-lucide="check-circle" class="w-5 h-5 text-green-400"></i>
<span id="toastMessage">Added to cart!</span>
</div>
<script src="script.js"></script>
<script>
let currentCategory = 'all';
let currentSort = 'featured';
let maxPrice = 5000;
let currentPage = 1;
const productsPerPage = 9;
document.addEventListener('DOMContentLoaded', () => {
lucide.createIcons();
// Check URL params
const params = new URLSearchParams(window.location.search);
const category = params.get('category');
if (category) {
currentCategory = category;
document.querySelector(`[data-category="${category}"]`)?.classList.add('active');
}
renderProducts();
updateCartBadge();
});
function toggleFilter() {
document.getElementById('filterSidebar').classList.toggle('open');
document.getElementById('backdrop').classList.toggle('open');
}
function filterCategory(category) {
currentCategory = category;
currentPage = 1;
document.querySelectorAll('.category-pill').forEach(btn => {
btn.classList.remove('active');
});
document.querySelector(`[data-category="${category}"]`)?.classList.add('active');
const titles = {
all: 'All Products',
clothing: 'Clothing Collection',
merch: 'Merchandise',
accessories: 'Accessories',
lifestyle: 'Lifestyle'
};
document.getElementById('pageTitle').textContent = titles[category] || 'Products';
renderProducts();
if (window.innerWidth < 1024) {
toggleFilter();
}
}
function applyPriceFilter(value) {
maxPrice = parseInt(value);
document.getElementById('priceValue').textContent = `₹${value.toLocaleString()}`;
currentPage = 1;
renderProducts();
}
function sortProducts(sort) {
currentSort = sort;
renderProducts();
}
function clearFilters() {
currentCategory = 'all';
maxPrice = 5000;
currentSort = 'featured';
currentPage = 1;
document.getElementById('priceRange').value = 5000;
document.getElementById('priceValue').textContent = '₹5,000';
document.getElementById('sortSelect').value = 'featured';
document.querySelectorAll('.category-pill').forEach(btn => btn.classList.remove('active'));
document.querySelector('[data-category="all"]').classList.add('active');
document.getElementById('pageTitle').textContent = 'All Products';
// Update URL
window.history.pushState({}, '', 'products.html');
renderProducts();
}
function renderProducts() {
let filtered = products.filter(p => {
const matchCategory = currentCategory === 'all' || p.category === currentCategory;
const matchPrice = p.price <= maxPrice;
return matchCategory && matchPrice;
});
// Sort
if (currentSort === 'price-low') {
filtered.sort((a, b) => a.price - b.price);
} else if (currentSort === 'price-high') {
filtered.sort((a, b) => b.price - a.price);
} else if (currentSort === 'newest') {
filtered.sort((a, b) => b.id - a.id);
}
const totalPages = Math.ceil(filtered.length / productsPerPage);
const start = (currentPage - 1) * productsPerPage;
const paginated = filtered.slice(start, start + productsPerPage);
const grid = document.getElementById('productGrid');
const emptyState = document.getElementById('emptyState');
const countText = document.getElementById('productCount');
if (filtered.length === 0) {
grid.innerHTML = '';
emptyState.classList.remove('hidden');
countText.textContent = 'No products match your filters';
} else {
emptyState.classList.add('hidden');
countText.textContent = `Showing ${filtered.length} products`;
grid.innerHTML = paginated.map(product => `
<div class="product-card group bg-white rounded-2xl overflow-hidden border border-gray-100">
<a href="product-detail.html?id=${product.id}" class="relative block overflow-hidden aspect-square bg-gray-100">
<img src="${product.image}" alt="${product.name}" class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-110">
${product.badge ? `<span class="absolute top-3 left-3 ${product.badge === 'Sale' ? 'bg-red-500' : 'bg-primary-500'} text-white text-xs font-bold px-3 py-1 rounded-full">${product.badge}</span>` : ''}
</a>
<div class="p-4">
<p class="text-xs text-gray-500 mb-1 capitalize">${product.category}</p>
<h3 class="font-semibold text-gray-900 mb-2 line-clamp-1">${product.name}</h3>
<div class="flex items-center gap-2 mb-3">
<span class="text-lg font-bold text-gray-900">₹${product.price.toLocaleString()}</span>
${product.oldPrice ? `<span class="text-sm text-gray-400 line-through">₹${product.oldPrice.toLocaleString()}</span>` : ''}
</div>
<button onclick="addToCart(${product.id})" class="w-full bg-gray-900 hover:bg-primary-500 text-white py-3 rounded-xl font-semibold transition-colors flex items-center justify-center gap-2">
<i data-lucide="shopping-bag" class="w-4 h-4"></i>
Add to Cart
</button>
</div>
</div>
`).join('');
// Pagination
if (totalPages > 1) {
let paginationHtml = '';
for (let i = 1; i <= totalPages; i++) {
paginationHtml += `
<button onclick="goToPage(${i})" class="w-10 h-10 rounded-lg font-semibold ${currentPage === i ? 'bg-primary-500 text-white' : 'bg-white text-gray-600 border border-gray-200 hover:bg-gray-50'}">
${i}
</button>
`;
}
document.getElementById('pagination').innerHTML = paginationHtml;
} else {
document.getElementById('pagination').innerHTML = '';
}
}
lucide.createIcons();
}
function goToPage(page) {
currentPage = page;
renderProducts();
window.scrollTo({ top: 0, behavior: 'smooth' });
}
</script>
</body>
</html> |