-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
827 lines (736 loc) · 44.1 KB
/
index.html
File metadata and controls
827 lines (736 loc) · 44.1 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
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
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
<!DOCTYPE html>
<html lang="en" class="scroll-smooth">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FreshMart | Premium Organic Market</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap"
rel="stylesheet">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
sans: ['Outfit', 'sans-serif'],
serif: ['Playfair Display', 'serif'],
},
colors: {
brand: {
50: '#f2fcf5',
100: '#e1f9e8',
200: '#c3f2d2',
300: '#94e6b1',
400: '#5dd289',
500: '#34ba67',
600: '#269b52',
700: '#237b44',
800: '#20613a',
900: '#1b5033',
950: '#0e2c1d',
},
cream: '#FDFBF7',
},
animation: {
'fade-in-up': 'fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards',
'float': 'float 6s ease-in-out infinite',
'spin-slow': 'spin 12s linear infinite',
},
keyframes: {
fadeInUp: {
'0%': { opacity: '0', transform: 'translateY(40px)' },
'100%': { opacity: '1', transform: 'translateY(0)' },
},
float: {
'0%, 100%': { transform: 'translateY(0)' },
'50%': { transform: 'translateY(-10px)' },
}
}
}
}
}
</script>
<style>
/* Custom Styles */
body {
background-color: #FDFBF7;
/* Cream background for premium feel */
}
.glass-nav {
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.hero-bg {
background-image:
linear-gradient(to right, rgba(14, 44, 29, 0.85), rgba(14, 44, 29, 0.6)),
url('https://images.unsplash.com/photo-1542838132-92c53300491e?auto=format&fit=crop&w=2000&q=90');
background-size: cover;
background-position: center;
background-attachment: fixed;
}
/* Hide Scrollbar */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
.no-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
}
.product-card:hover .product-actions {
opacity: 1;
transform: translateY(0);
}
/* Smooth transitions for all interactive elements */
a,
button {
transition-property: all;
transition-duration: 300ms;
}
/* Cart Drawer Animation */
.drawer-slide-in {
animation: slideIn 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer-slide-out {
animation: slideOut 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideIn {
from {
transform: translateX(100%);
}
to {
transform: translateX(0);
}
}
@keyframes slideOut {
from {
transform: translateX(0);
}
to {
transform: translateX(100%);
}
}
</style>
</head>
<body class="text-gray-800 antialiased selection:bg-brand-200 selection:text-brand-900">
<!-- Navigation -->
<nav id="navbar" class="fixed w-full z-50 transition-all duration-300 bg-transparent py-6">
<div class="max-w-7xl mx-auto px-6 lg:px-8">
<div class="flex justify-between items-center h-12">
<!-- Logo -->
<a href="#" class="group flex items-center space-x-2 z-50" onclick="window.scrollTo(0,0)">
<div
class="w-10 h-10 bg-brand-600 rounded-full flex items-center justify-center text-white text-lg shadow-lg group-hover:scale-110 transition-transform duration-300">
<i class="fas fa-leaf"></i>
</div>
<span id="nav-logo-text"
class="font-serif font-bold text-2xl text-white tracking-tight group-hover:text-brand-200 transition-colors">FreshMart</span>
</a>
<!-- Desktop Menu -->
<div
class="hidden md:flex items-center space-x-10 bg-white/10 backdrop-blur-md px-8 py-3 rounded-full border border-white/20 shadow-sm transition-all duration-300 hover:bg-white/20">
<a href="#home"
class="nav-link text-white text-sm font-medium hover:text-brand-200 uppercase tracking-wider">Home</a>
<a href="#features"
class="nav-link text-white text-sm font-medium hover:text-brand-200 uppercase tracking-wider">About</a>
<a href="#products"
class="nav-link text-white text-sm font-medium hover:text-brand-200 uppercase tracking-wider">Shop</a>
<a href="#contact"
class="nav-link text-white text-sm font-medium hover:text-brand-200 uppercase tracking-wider">Contact</a>
</div>
<!-- Icons -->
<div class="flex items-center space-x-6 z-50">
<button onclick="toggleCart()"
class="relative group text-white hover:text-brand-200 transition-colors">
<i class="fas fa-shopping-bag text-2xl"></i>
<span id="cart-badge"
class="absolute -top-1 -right-2 bg-brand-500 text-white text-[10px] font-bold px-1.5 py-0.5 rounded-full opacity-0 scale-0 transition-all duration-300 shadow-md">0</span>
</button>
<button onclick="toggleMobileMenu()" class="md:hidden text-white text-2xl">
<i class="fas fa-bars"></i>
</button>
</div>
</div>
</div>
<!-- Mobile Menu -->
<div id="mobile-menu"
class="hidden absolute top-0 left-0 w-full h-screen bg-brand-900 z-40 flex-col items-center justify-center space-y-8 animate-fade-in-up md:hidden">
<a href="#home" onclick="toggleMobileMenu()"
class="text-3xl text-white font-serif hover:text-brand-300">Home</a>
<a href="#features" onclick="toggleMobileMenu()"
class="text-3xl text-white font-serif hover:text-brand-300">About</a>
<a href="#products" onclick="toggleMobileMenu()"
class="text-3xl text-white font-serif hover:text-brand-300">Shop</a>
<a href="#contact" onclick="toggleMobileMenu()"
class="text-3xl text-white font-serif hover:text-brand-300">Contact</a>
<button onclick="toggleMobileMenu()" class="absolute top-6 right-6 text-white text-2xl"><i
class="fas fa-times"></i></button>
</div>
</nav>
<!-- Shopping Cart Sidebar -->
<div id="cart-overlay" onclick="toggleCart()"
class="fixed inset-0 bg-black/60 backdrop-blur-sm z-[60] hidden transition-opacity duration-300 opacity-0">
</div>
<div id="cart-drawer"
class="fixed top-0 right-0 h-full w-full sm:w-[450px] bg-white z-[70] transform translate-x-full transition-transform duration-300 shadow-2xl flex flex-col">
<div class="p-6 border-b border-gray-100 flex justify-between items-center bg-cream">
<div>
<h2 class="text-2xl font-serif font-bold text-gray-800">Your Basket</h2>
<p class="text-sm text-gray-500">Free delivery on orders over Rs. 5000</p>
</div>
<button onclick="toggleCart()"
class="w-8 h-8 flex items-center justify-center rounded-full hover:bg-gray-100 text-gray-500 transition">
<i class="fas fa-times text-lg"></i>
</button>
</div>
<div id="cart-items" class="flex-1 overflow-y-auto p-6 space-y-6 bg-white/50">
<!-- Items injected here -->
<div class="h-full flex flex-col items-center justify-center text-gray-400 space-y-4">
<div class="w-20 h-20 bg-gray-50 rounded-full flex items-center justify-center animate-pulse">
<i class="fas fa-basket-shopping text-3xl text-gray-300"></i>
</div>
<p class="font-medium">Your basket is empty</p>
<button onclick="toggleCart()" class="text-brand-600 font-bold hover:underline">Start Shopping</button>
</div>
</div>
<div class="p-8 bg-white border-t border-gray-100">
<div class="flex justify-between items-end mb-6">
<span class="text-sm text-gray-500 font-medium">Subtotal</span>
<span id="cart-total" class="text-3xl font-serif font-bold text-gray-900">$0.00</span>
</div>
<p class="text-xs text-center text-gray-400 mb-4">Shipping & taxes calculated at checkout</p>
<button onclick="checkout()"
class="w-full bg-brand-800 text-white py-4 rounded-xl font-bold tracking-wide hover:bg-brand-900 transition-all transform active:scale-[0.98] shadow-lg hover:shadow-brand-500/25 flex items-center justify-center gap-2">
<span>Secure Checkout</span>
<i class="fas fa-arrow-right text-sm"></i>
</button>
</div>
</div>
<!-- Toast -->
<div id="toast"
class="fixed top-24 right-6 bg-white border-l-4 border-brand-500 text-gray-800 px-6 py-4 rounded-r shadow-2xl transform translate-x-full transition-all duration-300 z-[80] flex items-center gap-4 min-w-[300px]">
<div class="w-8 h-8 rounded-full bg-brand-100 text-brand-600 flex items-center justify-center flex-shrink-0">
<i class="fas fa-check"></i>
</div>
<div>
<h4 class="font-bold text-sm">Success</h4>
<span id="toast-message" class="text-sm text-gray-500">Item added</span>
</div>
</div>
<!-- Hero Section -->
<header id="home" class="hero-bg min-h-screen flex items-center relative overflow-hidden">
<div
class="absolute inset-0 bg-[url('https://www.transparenttextures.com/patterns/noise.png')] opacity-20 mix-blend-overlay">
</div>
<div class="max-w-7xl mx-auto px-6 w-full pt-20 relative z-10">
<div class="max-w-3xl animate-fade-in-up">
<div
class="inline-flex items-center gap-2 bg-white/10 backdrop-blur-md border border-white/20 px-4 py-1.5 rounded-full text-brand-200 text-sm font-medium mb-8">
<span class="w-2 h-2 rounded-full bg-brand-400 animate-pulse"></span>
100% Organic & Locally Sourced
</div>
<h1 class="text-5xl md:text-7xl lg:text-8xl font-serif font-bold text-white leading-[1.1] mb-8">
Eat Fresh, <br />
<span class="text-transparent bg-clip-text bg-gradient-to-r from-brand-300 to-white">Live
Better.</span>
</h1>
<p class="text-xl text-gray-200 font-light mb-12 max-w-xl leading-relaxed">
Connecting you with local farmers for the freshest, chemical-free produce delivered straight to your
doorstep within hours.
</p>
<div class="flex flex-col sm:flex-row gap-5">
<a href="#products"
class="bg-brand-500 hover:bg-brand-400 text-white px-10 py-5 rounded-full font-bold text-lg transition-all transform hover:-translate-y-1 shadow-xl hover:shadow-brand-500/20 flex items-center justify-center gap-3">
Shop Collection <i class="fas fa-arrow-right"></i>
</a>
<a href="#features"
class="bg-white/10 backdrop-blur-md hover:bg-white/20 text-white border border-white/30 px-10 py-5 rounded-full font-bold text-lg transition-all flex items-center justify-center">
Our Story
</a>
</div>
</div>
</div>
<!-- Scroll Indicator -->
<div class="absolute bottom-10 left-1/2 transform -translate-x-1/2 text-white/50 animate-bounce">
<i class="fas fa-chevron-down text-2xl"></i>
</div>
</header>
<!-- Features Section -->
<section id="features" class="py-24 bg-cream relative">
<div class="max-w-7xl mx-auto px-6">
<div class="text-center mb-20">
<span class="text-brand-600 font-bold tracking-wider uppercase text-sm">Why Choose Us</span>
<h2 class="text-4xl md:text-5xl font-serif font-bold text-gray-900 mt-3 mb-6">The FreshMart Difference
</h2>
<div class="w-24 h-1 bg-brand-500 mx-auto rounded-full"></div>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-12">
<!-- Feature 1 -->
<div
class="group p-8 rounded-3xl bg-white border border-gray-100 hover:border-brand-200 shadow-sm hover:shadow-2xl hover:shadow-brand-100/50 transition-all duration-500 cursor-default">
<div
class="w-16 h-16 rounded-2xl bg-brand-50 text-brand-600 flex items-center justify-center text-3xl mb-8 group-hover:scale-110 group-hover:bg-brand-500 group-hover:text-white transition-all duration-300">
<i class="fas fa-leaf"></i>
</div>
<h3 class="text-2xl font-serif font-bold text-gray-900 mb-4">Certified Organic</h3>
<p class="text-gray-500 leading-relaxed group-hover:text-gray-700 transition-colors">
Every item in our inventory is strictly checked for organic certification. No pesticides, no
chemicals, just pure nature.
</p>
</div>
<!-- Feature 2 -->
<div
class="group p-8 rounded-3xl bg-white border border-gray-100 hover:border-brand-200 shadow-sm hover:shadow-2xl hover:shadow-brand-100/50 transition-all duration-500 cursor-default">
<div
class="w-16 h-16 rounded-2xl bg-brand-50 text-brand-600 flex items-center justify-center text-3xl mb-8 group-hover:scale-110 group-hover:bg-brand-500 group-hover:text-white transition-all duration-300">
<i class="fas fa-truck-fast"></i>
</div>
<h3 class="text-2xl font-serif font-bold text-gray-900 mb-4">Farm to Table</h3>
<p class="text-gray-500 leading-relaxed group-hover:text-gray-700 transition-colors">
We don't store fresh produce for days. Harvested in the morning, delivered to your kitchen by
evening.
</p>
</div>
<!-- Feature 3 -->
<div
class="group p-8 rounded-3xl bg-white border border-gray-100 hover:border-brand-200 shadow-sm hover:shadow-2xl hover:shadow-brand-100/50 transition-all duration-500 cursor-default">
<div
class="w-16 h-16 rounded-2xl bg-brand-50 text-brand-600 flex items-center justify-center text-3xl mb-8 group-hover:scale-110 group-hover:bg-brand-500 group-hover:text-white transition-all duration-300">
<i class="fas fa-heart"></i>
</div>
<h3 class="text-2xl font-serif font-bold text-gray-900 mb-4">Community First</h3>
<p class="text-gray-500 leading-relaxed group-hover:text-gray-700 transition-colors">
We support over 200 tailored local farming families, ensuring fair trade prices and sustainable
livelihoods.
</p>
</div>
</div>
</div>
</section>
<!-- Product Section -->
<section id="products" class="py-24 bg-white">
<div class="max-w-7xl mx-auto px-6">
<div class="flex flex-col md:flex-row md:items-end justify-between mb-16 gap-8">
<div>
<span class="text-brand-600 font-bold tracking-wider uppercase text-sm">Seasonal Harvest</span>
<h2 class="text-4xl md:text-5xl font-serif font-bold text-gray-900 mt-2">Our Fresh Selection</h2>
</div>
<!-- Filter Tabs -->
<div class="flex flex-wrap gap-2 p-1.5 bg-gray-100 rounded-full">
<button onclick="filterProducts('all')"
class="filter-btn active px-6 py-2 rounded-full text-sm font-bold transition-all duration-300 shadow-sm bg-white text-gray-900">All</button>
<button onclick="filterProducts('veg')"
class="filter-btn px-6 py-2 rounded-full text-sm font-bold transition-all duration-300 text-gray-500 hover:text-gray-900 hover:bg-white/50">Vegetables</button>
<button onclick="filterProducts('fruit')"
class="filter-btn px-6 py-2 rounded-full text-sm font-bold transition-all duration-300 text-gray-500 hover:text-gray-900 hover:bg-white/50">Fruits</button>
<button onclick="filterProducts('dairy')"
class="filter-btn px-6 py-2 rounded-full text-sm font-bold transition-all duration-300 text-gray-500 hover:text-gray-900 hover:bg-white/50">Dairy</button>
</div>
</div>
<!-- Grid -->
<div id="product-grid" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-8 gap-y-12">
<!-- Products injected via JS -->
</div>
</div>
</section>
<!-- Promotional / Stats -->
<section class="py-24 bg-brand-900 text-white relative overflow-hidden">
<!-- Abstract Shapes -->
<div
class="absolute top-0 right-0 w-96 h-96 bg-brand-800 rounded-full mix-blend-multiply filter blur-3xl opacity-50 animate-float">
</div>
<div class="absolute bottom-0 left-0 w-72 h-72 bg-brand-600 rounded-full mix-blend-multiply filter blur-3xl opacity-30 animate-float"
style="animation-delay: 1s;"></div>
<div class="max-w-7xl mx-auto px-6 relative z-10">
<div class="grid grid-cols-1 md:grid-cols-2 gap-16 items-center">
<div>
<h2 class="text-4xl md:text-5xl font-serif font-bold mb-6">Join the Organic Revolution</h2>
<p class="text-brand-100 text-lg mb-8 leading-relaxed">
Subscribe to our premium weekly basket service. Get a curated selection of the season's best
produce delivered to your door every Monday morning.
</p>
<form onsubmit="event.preventDefault(); showToast('Subscribed successfully!');" class="space-y-4">
<div class="flex flex-col sm:flex-row gap-3">
<input type="email" placeholder="Email Address" required
class="flex-1 px-6 py-4 rounded-full bg-white/10 border border-white/20 text-white placeholder-brand-200 focus:outline-none focus:bg-white/20 focus:border-brand-400 backdrop-blur-sm transition">
<button type="submit"
class="px-8 py-4 rounded-full bg-brand-500 hover:bg-brand-400 text-white font-bold shadow-lg transition transform hover:scale-105">
Subscribe
</button>
</div>
<p class="text-xs text-brand-300">*We respect your privacy. Unsubscribe at any time.</p>
</form>
</div>
<div class="grid grid-cols-2 gap-6">
<div
class="bg-white/5 backdrop-blur-sm p-8 rounded-2xl border border-white/10 text-center hover:bg-white/10 transition duration-500">
<div class="text-4xl font-bold text-brand-400 mb-2">5k+</div>
<div class="text-brand-100 text-sm font-medium uppercase tracking-wider">Happy Customers</div>
</div>
<div
class="bg-white/5 backdrop-blur-sm p-8 rounded-2xl border border-white/10 text-center hover:bg-white/10 transition duration-500 translate-y-6">
<div class="text-4xl font-bold text-brand-400 mb-2">120+</div>
<div class="text-brand-100 text-sm font-medium uppercase tracking-wider">Local Farmers</div>
</div>
<div
class="bg-white/5 backdrop-blur-sm p-8 rounded-2xl border border-white/10 text-center hover:bg-white/10 transition duration-500">
<div class="text-4xl font-bold text-brand-400 mb-2">100%</div>
<div class="text-brand-100 text-sm font-medium uppercase tracking-wider">Organic Certified</div>
</div>
<div
class="bg-white/5 backdrop-blur-sm p-8 rounded-2xl border border-white/10 text-center hover:bg-white/10 transition duration-500 translate-y-6">
<div class="text-4xl font-bold text-brand-400 mb-2">24h</div>
<div class="text-brand-100 text-sm font-medium uppercase tracking-wider">Delivery Time</div>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer id="contact" class="bg-gray-900 border-t border-gray-800 pt-20 pb-10 text-gray-400">
<div class="max-w-7xl mx-auto px-6">
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12 mb-16">
<!-- Branding -->
<div>
<div class="flex items-center space-x-2 text-white mb-6">
<i class="fas fa-leaf text-brand-500 text-2xl"></i>
<span class="font-serif font-bold text-2xl">FreshMart</span>
</div>
<p class="mb-6 leading-relaxed">
Cultivating a healthier lifestyle for our community through sustainable, organic, and ethically
sourced produce.
</p>
<div class="flex space-x-4">
<a href="#"
class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center hover:bg-brand-600 hover:text-white transition-all transform hover:scale-110"><i
class="fab fa-facebook-f"></i></a>
<a href="#"
class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center hover:bg-brand-600 hover:text-white transition-all transform hover:scale-110"><i
class="fab fa-instagram"></i></a>
<a href="#"
class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center hover:bg-brand-600 hover:text-white transition-all transform hover:scale-110"><i
class="fab fa-twitter"></i></a>
</div>
</div>
<!-- Links -->
<div>
<h4 class="text-white font-serif font-bold text-lg mb-6">Explore</h4>
<ul class="space-y-4">
<li><a href="#home" class="hover:text-brand-500 transition-colors">Our Story</a></li>
<li><a href="#products" class="hover:text-brand-500 transition-colors">Shop Collection</a></li>
<li><a href="#" class="hover:text-brand-500 transition-colors">Sustainability</a></li>
<li><a href="#" class="hover:text-brand-500 transition-colors">Careers</a></li>
</ul>
</div>
<!-- Contact -->
<div>
<h4 class="text-white font-serif font-bold text-lg mb-6">Contact</h4>
<ul class="space-y-4">
<li class="flex items-start gap-4">
<i class="fas fa-map-marker-alt text-brand-600 mt-1"></i>
<span class="text-gray-400">123 Organic Valley,<br />Colombo 03, Sri Lanka</span>
</li>
<li class="flex items-center gap-4">
<i class="fas fa-envelope text-brand-600"></i>
<a href="mailto:hello@freshmart.lk"
class="hover:text-white transition">hello@freshmart.lk</a>
</li>
<li class="flex items-center gap-4">
<i class="fas fa-phone text-brand-600"></i>
<span class="text-gray-400">+94 11 234 5678</span>
</li>
</ul>
</div>
<!-- Newsletter (Mini) -->
<div>
<h4 class="text-white font-serif font-bold text-lg mb-6">Mobile App</h4>
<p class="mb-4">Shop on the go with our award-winning app.</p>
<div class="flex flex-col gap-3">
<button
class="bg-gray-800 hover:bg-gray-700 text-white px-4 py-3 rounded-lg flex items-center gap-3 transition">
<i class="fab fa-apple text-2xl"></i>
<div class="text-left">
<div class="text-[10px] uppercase">Download on the</div>
<div class="text-sm font-bold leading-none">App Store</div>
</div>
</button>
</div>
</div>
</div>
<div class="border-t border-gray-800 pt-8 flex flex-col md:flex-row justify-between items-center text-sm">
<p>© 2025 FreshMart. All rights reserved.</p>
<div class="flex gap-6 mt-4 md:mt-0">
<a href="#" class="hover:text-white transition">Privacy Policy</a>
<a href="#" class="hover:text-white transition">Terms of Service</a>
</div>
</div>
</div>
</footer>
<!-- Application Logic -->
<script>
// --- Data ---
const products = [
{ id: 1, name: "Organic Red Apples", price: 1350, category: "fruit", image: "https://images.unsplash.com/photo-1560806887-1e4cd0b6cbd6?auto=format&fit=crop&w=600&q=80", unit: "kg" },
{ id: 2, name: "Fresh Carrots", price: 600, category: "veg", image: "https://images.unsplash.com/photo-1598170845058-32b9d6a5da37?auto=format&fit=crop&w=600&q=80", unit: "kg" },
{ id: 3, name: "Green Spinach", price: 450, category: "veg", image: "https://images.unsplash.com/photo-1576045057995-568f588f82fb?auto=format&fit=crop&w=600&q=80", unit: "bunch" },
{ id: 4, name: "Farm Fresh Milk", price: 950, category: "dairy", image: "https://images.unsplash.com/photo-1576186726188-c9d70843790f?auto=format&fit=crop&w=600&q=80", unit: "L" },
{ id: 5, name: "Cavendish Bananas", price: 850, category: "fruit", image: "https://images.unsplash.com/flagged/photo-1581375362082-dac258015581?auto=format&fit=crop&w=600&q=80", unit: "kg" },
{ id: 6, name: "Vine Tomatoes", price: 850, category: "veg", image: "https://images.unsplash.com/photo-1592924357228-91a4daadcfea?auto=format&fit=crop&w=600&q=80", unit: "kg" },
{ id: 7, name: "Aged Cheddar", price: 2800, category: "dairy", image: "https://images.unsplash.com/photo-1552767059-ce182ead6c1b?auto=format&fit=crop&w=600&q=80", unit: "block" },
{ id: 8, name: "Hass Avocados", price: 1600, category: "fruit", image: "https://images.unsplash.com/photo-1726177551991-270f9e79b65e?auto=format&fit=crop&w=600&q=80", unit: "pack" },
{ id: 9, name: "Fresh Pineapple", price: 850, category: "fruit", image: "https://images.unsplash.com/photo-1589820296156-2454bb8a6ad1?auto=format&fit=crop&w=600&q=80", unit: "each" },
{ id: 10, name: "Juicy Mango", price: 600, category: "fruit", image: "https://images.unsplash.com/photo-1601493700631-2b16ec4b4716?auto=format&fit=crop&w=600&q=80", unit: "each" },
{ id: 11, name: "Organic Broccoli", price: 1400, category: "veg", image: "https://images.unsplash.com/photo-1685504445355-0e7bdf90d415?auto=format&fit=crop&w=600&q=80", unit: "kg" },
{ id: 12, name: "Red Bell Pepper", price: 1100, category: "veg", image: "https://images.unsplash.com/photo-1641738119374-0a0ed1fb1764?auto=format&fit=crop&w=600&q=80", unit: "kg" },
{ id: 13, name: "Greek Yogurt", price: 1850, category: "dairy", image: "https://images.unsplash.com/photo-1571212515416-fef01fc43637?auto=format&fit=crop&w=600&q=80", unit: "tub" },
{ id: 14, name: "Salted Butter", price: 800, category: "dairy", image: "https://images.unsplash.com/photo-1589985269102-ff38adf6f00d?auto=format&fit=crop&w=600&q=80", unit: "block" },
{ id: 15, name: "Fresh Strawberries", price: 1200, category: "fruit", image: "https://images.unsplash.com/photo-1575980541474-bf9e64967d55?auto=format&fit=crop&w=600&q=80", unit: "pack" },
{ id: 16, name: "Farm Eggs (10pk)", price: 650, category: "dairy", image: "https://images.unsplash.com/photo-1760393339745-18360fc2b6e3?auto=format&fit=crop&w=600&q=80", unit: "pack" },
];
let cart = [];
// --- Core ---
document.addEventListener('DOMContentLoaded', () => {
renderProducts('all');
setupScrollEffect();
});
// Navbar Scroll Effect
function setupScrollEffect() {
const nav = document.getElementById('navbar');
const logoText = document.getElementById('nav-logo-text');
const links = document.querySelectorAll('.nav-link');
const desktopMenu = nav.querySelector('.md\\:flex');
window.addEventListener('scroll', () => {
if (window.scrollY > 50) {
nav.classList.add('glass-nav', 'py-3');
nav.classList.remove('bg-transparent', 'py-6');
logoText.classList.remove('text-white');
logoText.classList.add('text-brand-800');
links.forEach(l => {
l.classList.remove('text-white');
l.classList.add('text-gray-700', 'hover:text-brand-600');
l.classList.remove('hover:text-brand-200');
});
if (desktopMenu) {
desktopMenu.classList.remove('bg-white/10', 'border-white/20', 'text-white');
desktopMenu.classList.add('bg-white/0', 'border-transparent'); // Hide container style on scroll for cleaner look
}
// Update icons color
const icons = nav.querySelectorAll('.fa-shopping-bag, .fa-bars');
icons.forEach(i => i.parentElement.classList.replace('text-white', 'text-gray-800'));
} else {
nav.classList.remove('glass-nav', 'py-3');
nav.classList.add('bg-transparent', 'py-6');
logoText.classList.add('text-white');
logoText.classList.remove('text-brand-800');
links.forEach(l => {
l.classList.add('text-white');
l.classList.remove('text-gray-700', 'hover:text-brand-600');
l.classList.add('hover:text-brand-200');
});
if (desktopMenu) {
desktopMenu.classList.add('bg-white/10', 'border-white/20');
desktopMenu.classList.remove('bg-white/0', 'border-transparent');
}
const icons = nav.querySelectorAll('.fa-shopping-bag, .fa-bars');
icons.forEach(i => i.parentElement.classList.replace('text-gray-800', 'text-white'));
}
});
}
// --- Products ---
function renderProducts(filter) {
const grid = document.getElementById('product-grid');
grid.innerHTML = '';
// Fade out effect could go here, but kept simple for performance
const filtered = filter === 'all' ? products : products.filter(p => p.category === filter);
filtered.forEach((p, index) => {
const card = document.createElement('div');
card.className = 'group bg-white rounded-3xl p-4 shadow-sm hover:shadow-xl transition-all duration-500 transform hover:-translate-y-2 border border-gray-100 product-card relative overflow-hidden';
card.style.animation = `fadeInUp 0.5s ease-out forwards ${index * 0.1}s`;
card.style.opacity = '0'; // Initial state for animation
card.innerHTML = `
<div class="relative h-60 rounded-2xl overflow-hidden mb-4 bg-gray-100">
<img src="${p.image}" alt="${p.name}" class="w-full h-full object-cover transform group-hover:scale-110 transition duration-700">
<div class="absolute top-3 left-3 bg-white/90 backdrop-blur-sm px-3 py-1 rounded-full text-xs font-bold text-gray-800 uppercase tracking-wide shadow-sm">
${p.category}
</div>
<!-- Quick Action Overlay -->
<div class="product-actions absolute inset-0 bg-black/20 flex items-center justify-center opacity-0 transition-all duration-300 backdrop-blur-[2px]">
<button onclick="addToCart(${p.id})" class="bg-white text-gray-900 rounded-full w-12 h-12 flex items-center justify-center shadow-lg hover:bg-brand-500 hover:text-white transform hover:scale-110 transition-all duration-300">
<i class="fas fa-plus text-lg"></i>
</button>
</div>
</div>
<div class="px-2 pb-2">
<div class="flex justify-between items-start mb-2">
<h3 class="font-serif font-bold text-lg text-gray-900 leading-tight">${p.name}</h3>
<div class="text-right">
<span class="block font-bold text-brand-700 text-lg">Rs. ${p.price.toFixed(0)}</span>
<span class="text-xs text-gray-400">/${p.unit}</span>
</div>
</div>
<div class="flex items-center gap-1 text-yellow-400 text-xs mb-4">
<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>
<span class="text-gray-300 ml-1">(24)</span>
</div>
<button onclick="addToCart(${p.id})" class="w-full border border-gray-200 text-gray-600 py-3 rounded-xl font-medium text-sm hover:bg-brand-600 hover:text-white hover:border-transparent transition-all duration-300 flex items-center justify-center gap-2 group-hover:bg-brand-600 group-hover:text-white group-hover:border-transparent group-hover:shadow-lg group-hover:shadow-brand-500/30">
Add to Cart
</button>
</div>
`;
grid.appendChild(card);
});
}
function filterProducts(category) {
// Update Buttons
document.querySelectorAll('.filter-btn').forEach(btn => {
// Reset styling
btn.className = "filter-btn px-6 py-2 rounded-full text-sm font-bold transition-all duration-300 text-gray-500 hover:text-gray-900 hover:bg-white/50";
// Active Logic
const isMatch = (category === 'all' && btn.innerText === 'All') ||
(category === 'veg' && btn.innerText === 'Vegetables') ||
(category === 'fruit' && btn.innerText === 'Fruits') ||
(category === 'dairy' && btn.innerText === 'Dairy');
if (isMatch) {
btn.className = "filter-btn active px-6 py-2 rounded-full text-sm font-bold transition-all duration-300 shadow-sm bg-white text-gray-900 ring-1 ring-gray-200";
}
});
renderProducts(category);
}
// --- Cart Logic ---
function addToCart(id) {
const product = products.find(p => p.id === id);
const existing = cart.find(item => item.id === id);
if (existing) existing.quantity++;
else cart.push({ ...product, quantity: 1 });
updateCartUI();
showToast(`${product.name} added to cart`);
toggleCart(true); // Auto open
}
function removeFromCart(id) {
cart = cart.filter(item => item.id !== id);
updateCartUI();
}
function changeQuantity(id, delta) {
const item = cart.find(i => i.id === id);
if (!item) return;
item.quantity += delta;
if (item.quantity <= 0) {
removeFromCart(id);
} else {
updateCartUI();
}
}
function updateCartUI() {
// Badge
const badge = document.getElementById('cart-badge');
const totalItems = cart.reduce((sum, item) => sum + item.quantity, 0);
badge.innerText = totalItems;
if (totalItems > 0) {
badge.classList.remove('opacity-0', 'scale-0');
} else {
badge.classList.add('opacity-0', 'scale-0');
}
// Drawer Content
const container = document.getElementById('cart-items');
const totalEl = document.getElementById('cart-total');
if (cart.length === 0) {
container.innerHTML = `
<div class="h-full flex flex-col items-center justify-center text-gray-400 space-y-4">
<div class="w-20 h-20 bg-gray-50 rounded-full flex items-center justify-center">
<i class="fas fa-basket-shopping text-3xl text-gray-300"></i>
</div>
<p class="font-medium">Your basket is empty</p>
<button onclick="toggleCart()" class="text-brand-600 font-bold hover:underline">Start Shopping</button>
</div>`;
totalEl.innerText = "Rs. 0";
} else {
container.innerHTML = '';
let totalPrice = 0;
cart.forEach(item => {
totalPrice += item.price * item.quantity;
const el = document.createElement('div');
// Add animation class
el.className = 'flex gap-4 p-4 bg-white rounded-2xl border border-gray-100 shadow-sm animate-fade-in-up';
el.innerHTML = `
<img src="${item.image}" class="w-20 h-20 rounded-xl object-cover bg-gray-50">
<div class="flex-1 flex flex-col justify-between">
<div class="flex justify-between items-start">
<h4 class="font-bold text-gray-800 font-serif line-clamp-1">${item.name}</h4>
<button onclick="removeFromCart(${item.id})" class="text-gray-300 hover:text-red-500 transition px-2">
<i class="fas fa-times"></i>
</button>
</div>
<div class="flex justify-between items-end mt-3">
<div class="flex items-center gap-3 bg-gray-50 rounded-lg p-1">
<button onclick="changeQuantity(${item.id}, -1)" class="w-6 h-6 rounded-md bg-white shadow-sm border border-gray-100 flex items-center justify-center text-gray-600 hover:text-brand-600 hover:border-brand-200 transition-all active:scale-90">
<i class="fas fa-minus text-[10px]"></i>
</button>
<span class="text-sm font-bold text-gray-800 w-4 text-center">${item.quantity}</span>
<button onclick="changeQuantity(${item.id}, 1)" class="w-6 h-6 rounded-md bg-white shadow-sm border border-gray-100 flex items-center justify-center text-gray-600 hover:text-brand-600 hover:border-brand-200 transition-all active:scale-90">
<i class="fas fa-plus text-[10px]"></i>
</button>
</div>
<div class="font-bold text-brand-600 text-lg">Rs. ${(item.price * item.quantity).toFixed(0)}</div>
</div>
</div>
`;
container.appendChild(el);
});
totalEl.innerText = "Rs. " + totalPrice.toFixed(0);
}
}
function toggleCart(forceOpen = false) {
const drawer = document.getElementById('cart-drawer');
const overlay = document.getElementById('cart-overlay');
const isOpen = !drawer.classList.contains('translate-x-full');
if (forceOpen || !isOpen) {
// Open
drawer.classList.remove('translate-x-full');
overlay.classList.remove('hidden');
// Small delay to allow display:block to apply before opacity transition
requestAnimationFrame(() => {
overlay.classList.remove('opacity-0');
});
} else {
// Close
drawer.classList.add('translate-x-full');
overlay.classList.add('opacity-0');
setTimeout(() => {
overlay.classList.add('hidden');
}, 300);
}
}
function showToast(message) {
const toast = document.getElementById('toast');
document.getElementById('toast-message').innerText = message;
toast.classList.remove('translate-x-full');
setTimeout(() => {
toast.classList.add('translate-x-full');
}, 3000);
}
function toggleMobileMenu() {
document.getElementById('mobile-menu').classList.toggle('hidden');
document.getElementById('mobile-menu').classList.toggle('flex');
}
function checkout() {
if (cart.length === 0) {
showToast("Cart is empty!");
return;
}
alert("Proceeding to checkout...");
}
</script>
</body>
</html>