Repository navigation
Expand file tree
/
Copy pathgallery.html
More file actions
294 lines (252 loc) · 8.65 KB
/
Copy pathgallery.html
File metadata and controls
294 lines (252 loc) · 8.65 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Product Gallery - MISSFITS Boutique</title>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="css/product.css">
<link rel="stylesheet" href="css/search.css">
<link href="https://fonts.googleapis.com/css2?family=Arimo:wght@400;700&display=swap" rel="stylesheet">
<link rel="icon" href="favicon.svg" type="image/svg">
<style>
body {
margin: 0;
padding: 0;
font-family: 'Arimo', Arial, sans-serif;
background-color: #f4eae2;
min-height: 100vh;
}
.gallery-header {
background-color: #f4eae2;
padding: 20px 0;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
position: sticky;
top: 0;
z-index: 100;
}
.header-content {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
}
.header-logo {
height: 60px;
width: auto;
}
.header-nav {
display: flex;
gap: 30px;
}
.header-nav a {
color: #333;
text-decoration: none;
font-weight: 500;
font-size: 16px;
transition: color 0.3s;
}
.header-nav a:hover {
color: #d2a6a6;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 40px 20px;
}
h1 {
text-align: center;
color: #333;
margin-bottom: 20px;
font-size: 36px;
font-weight: 700;
}
.gallery-description {
text-align: center;
color: #666;
margin-bottom: 40px;
font-size: 18px;
line-height: 1.6;
}
/* Category Filter */
.category-filter {
display: flex;
justify-content: center;
margin-bottom: 40px;
gap: 15px;
flex-wrap: wrap;
}
.filter-btn {
padding: 10px 20px;
background-color: white;
color: #333;
border: 2px solid #d2a6a6;
border-radius: 25px;
text-decoration: none;
font-weight: 500;
transition: all 0.3s;
cursor: pointer;
}
.filter-btn:hover,
.filter-btn.active {
background-color: #d2a6a6;
color: white;
}
.products-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 30px;
margin-bottom: 60px;
}
.loading {
text-align: center;
padding: 60px 20px;
font-size: 18px;
color: #666;
}
@media (max-width: 768px) {
.header-content {
flex-direction: column;
gap: 20px;
}
.header-logo {
height: 50px;
}
.header-nav {
gap: 20px;
}
h1 {
font-size: 28px;
}
.gallery-description {
font-size: 16px;
}
.products-grid {
grid-template-columns: 1fr;
gap: 20px;
}
.category-filter {
gap: 10px;
}
.filter-btn {
padding: 8px 16px;
font-size: 14px;
}
}
</style>
</head>
<body>
<header class="gallery-header">
<div class="header-content">
<a href="index.html" class="logo-link">
<img src="img/title.svg" alt="MISSFITS Boutique Logo" class="header-logo">
</a>
<nav class="header-nav">
<a href="index.html">Home</a>
<a href="gallery.html" class="active">Gallery</a>
</nav>
</div>
</header>
<div class="container">
<h1>Our Product Collection</h1>
<p class="gallery-description">
Discover our exquisite collection of handcrafted fashion pieces. Each item is carefully designed and made with attention to detail, bringing you the perfect blend of traditional artistry and contemporary style.
</p>
<!-- Category Filter -->
<div class="category-filter" id="categoryFilter">
<button class="filter-btn active" data-category="all">All Products</button>
</div>
<!-- Products Grid -->
<div class="products-grid" id="productsGrid">
<div class="loading">Loading our beautiful collection...</div>
</div>
</div>
<footer>
<p>Contact MISSFITS Boutique for all your fashion needs! Call us at +917975495202. © 2024 MISSFITS Boutique. All Rights Reserved.</p>
</footer>
<script src="js/products.js"></script>
<script src="js/search.js"></script>
<script>
let allProducts = [];
let currentCategory = 'all';
// Load and display products
async function loadGallery() {
try {
// Load product database
await window.productDB.loadProducts();
allProducts = window.productDB.getAllProducts();
const categories = window.productDB.getCategories();
// Setup category filter
setupCategoryFilter(categories);
// Display products
displayProducts(allProducts);
} catch (error) {
console.error('Error loading gallery:', error);
document.getElementById('productsGrid').innerHTML = `
<div class="error">
<h2>Error Loading Products</h2>
<p>We're having trouble loading our collection. Please try refreshing the page.</p>
</div>
`;
}
}
// Setup category filter buttons
function setupCategoryFilter(categories) {
const filterContainer = document.getElementById('categoryFilter');
// Add click event to 'All Products' button
const allBtn = filterContainer.querySelector('[data-category="all"]');
if (allBtn) {
allBtn.addEventListener('click', () => filterProducts('all'));
}
// Add category buttons
categories.forEach(category => {
const button = document.createElement('button');
button.className = 'filter-btn';
button.textContent = category.name;
button.setAttribute('data-category', category.id);
button.addEventListener('click', () => filterProducts(category.id));
filterContainer.appendChild(button);
});
}
// Filter products by category
function filterProducts(categoryId) {
currentCategory = categoryId;
// Update active filter button
document.querySelectorAll('.filter-btn').forEach(btn => {
btn.classList.remove('active');
if (btn.getAttribute('data-category') === categoryId) {
btn.classList.add('active');
}
});
// Filter and display products
let filteredProducts;
if (categoryId === 'all') {
filteredProducts = allProducts;
} else {
filteredProducts = window.productDB.getProductsByCategory(categoryId);
}
displayProducts(filteredProducts);
}
// Display products in grid
function displayProducts(products) {
const gridContainer = document.getElementById('productsGrid');
if (products.length === 0) {
gridContainer.innerHTML = `
<div class="no-products">
<h3>No products found</h3>
<p>There are currently no products in this category.</p>
</div>
`;
return;
}
gridContainer.innerHTML = products.map(product =>
window.ProductUtils.createProductCard(product, true)
).join('');
}
// Initialize gallery
document.addEventListener('DOMContentLoaded', loadGallery);
</script>
</body>
</html>