-
Notifications
You must be signed in to change notification settings - Fork 1
/
top-products.html
325 lines (305 loc) · 11.9 KB
/
top-products.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Egona</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<script
src="https://kit.fontawesome.com/dad41bef55.js"
crossorigin="anonymous"
></script>
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Poppins:wght@400;500&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="public/styles.css" />
</head>
<body>
<!-- banner-->
<div class="banner">
<div class="flex">
<p class="text-white w-4/5 mx-auto text-center py-3">
Bountiful Harvest! Reap Savings: Up to 50% off Local Produce & FREE
Delivery 🇳🇬
</p>
</div>
</div>
<div class="gbl-container">
<div class="w-0.5 text-white_smoke"></div>
<!-- Header section-->
<div class="sticky top-0 z-50 bg-white">
<header class="flex justify-between items-center mt-4">
<a href="index.html">
<img class="w-8" src="images/logo.svg" alt="" />
</a>
<nav class="flex gap-10 ml-32">
<a href="index.html">Home</a>
<a href="contact.html">Contact</a>
<a href="#">About</a>
<a href="signup.html">Sign up</a>
</nav>
<div class="flex gap-8 items-center justify-center">
<div
class="flex items-center gap-8 py-1.5 px-4 m-1.5 bg-white_smoke rounded-md"
>
<input
class="opacity-80 outline-none bg-white_smoke w-full"
type="search"
placeholder="What are you looking for?"
/>
<button>
<i class="fa-brands fa-searchengin"></i>
</button>
</div>
<div>
<a class="inline-block" href="cart.html">
<i
class="fa-solid fa-cart-shopping color text-pakistan_green"
></i>
</a>
</div>
</div>
</header>
<div class="h-0.5 w-full bg-white_smoke mt-4"></div>
</div>
<!-- Header section-->
<!-- line-->
<!-- Main-->
<main>
<!-- Product section-->
<div class="relative">
<div
class="text-xs text-center p-2 bg-dark_pastel_green w-5 h-12 z-10 absolute left-0 top-[-3rem]"
>
<span class="ml-8 my-auto font-bold text-dark_pastel_green"
>Product</span
>
</div>
<h2 class="py-10 font-bold text-2xl">Top Products</h2>
<section class="flex justify-between">
<div class="card rounded-lg overflow-hidden">
<div>
<a
class="w-270 h-250 bg-white_smoke overflow-hidden mb-0 flex flex-col relative justify-start items-center hide rounded-lg"
href="#"
>
<span
class="text-xs text-center flex p-2 bg-dark_pastel_green w-10 h-8 absolute left-0 top-0"
>-25%</span
>
<img
class="w-160 h-160 my-auto hover:h-40 hover:w-36 rounded-lg"
src="images/watermelons-2636_640.jpg"
alt=""
/>
</a>
<div class="rounded-b-lg overflow-hidden">
<button
class="hidden w-full text-white_smoke bg-pakistan_green ext-white_smoke py-1.5 addToCartButton"
>
Add to cart
</button>
</div>
</div>
<div>
<h2 class="font-bold">Cucumber</h2>
</div>
<p class="text-sm text-dark_pastel_green">
₦27000
<span class="mr-2 line-through opacity-70 text-slate-500"
>₦36000</span
>
</p>
<div>
<i class="fa-solid fa-star text-yellow-700"></i>
<i class="fa-solid fa-star text-yellow-700"></i>
<i class="fa-solid fa-star text-yellow-700"></i>
<span class="font-bold opacity-60">(77%)</span>
</div>
</div>
<!-- Soya bean products-->
<div class="card rounded-lg overflow-hidden">
<div>
<a
class="w-270 h-250 bg-white_smoke overflow-hidden mb-0 flex flex-col relative justify-start items-center hide rounded-lg"
href="#"
>
<span
class="text-xs text-center flex p-2 bg-dark_pastel_green w-10 h-8 absolute left-0 top-0"
>-10%</span
>
<img
class="w-160 h-160 my-auto hover:h-40 hover:w-36 rounded-lg"
src="images/soy-bean-4994576_640.jpg"
alt=""
/>
</a>
<div class="rounded-b-lg overflow-hidden">
<button
class="hidden w-full text-white_smoke bg-pakistan_green ext-white_smoke py-1.5 addToCartButton"
>
Add to cart
</button>
</div>
</div>
<div>
<h2 class="font-bold">Soya Beans</h2>
</div>
<p class="text-sm text-dark_pastel_green">
₦7650
<span class="mr-2 line-through opacity-70 text-slate-500"
>₦8500</span
>
</p>
<div>
<i class="fa-solid fa-star text-yellow-700"></i>
<i class="fa-solid fa-star text-yellow-700"></i>
<i class="fa-solid fa-star text-yellow-700"></i>
<i class="fa-solid fa-star text-yellow-700"></i>
<i class="fa-solid fa-star text-yellow-700"></i>
<span class="font-bold opacity-60">(100%)</span>
</div>
</div>
<!-- Goat product-->
<div class="card rounded-lg overflow-hidden">
<div>
<a
class="w-270 h-250 bg-white_smoke overflow-hidden mb-0 flex flex-col relative justify-start items-center hide rounded-lg"
href="#"
>
<span
class="text-xs text-center flex p-2 bg-dark_pastel_green w-10 h-8 absolute left-0 top-0"
>-20%</span
>
<img
class="w-160 h-160 my-auto hover:h-40 hover:w-36 rounded-lg"
src="images/goat-4366206_640.jpg"
alt=""
/>
</a>
<div class="rounded-b-lg overflow-hidden">
<button
class="hidden w-full text-white_smoke bg-pakistan_green ext-white_smoke py-1.5 addToCartButton"
>
Add to cart
</button>
</div>
</div>
<div>
<h2 class="font-bold">Health Goat</h2>
</div>
<p class="text-sm text-dark_pastel_green">
₦2000
<span class="mr-2 line-through opacity-70 text-slate-500"
>₦25000</span
>
</p>
<div>
<i class="fa-solid fa-star text-yellow-700"></i>
<i class="fa-solid fa-star text-yellow-700"></i>
<i class="fa-solid fa-star text-yellow-700"></i>
<i class="fa-solid fa-star text-yellow-700"></i>
<span class="font-bold opacity-60">(80%)</span>
</div>
</div>
<div class="card rounded-lg overflow-hidden">
<div>
<a
class="w-270 h-250 bg-white_smoke overflow-hidden mb-0 flex flex-col relative justify-start items-center hide rounded-lg"
href="#"
>
<span
class="text-xs text-center flex p-2 bg-dark_pastel_green w-10 h-8 absolute left-0 top-0"
>-20%</span
>
<img
class="w-160 h-160 my-auto hover:h-40 hover:w-36 rounded-lg"
src="images/cucumbers-849269_640.jpg"
alt=""
/>
</a>
<div class="rounded-b-lg overflow-hidden">
<button
class="hidden w-full text-white_smoke bg-pakistan_green ext-white_smoke py-1.5 addToCartButton"
>
Add to cart
</button>
</div>
</div>
<div>
<h2 class="font-bold">Fresh Cucumber</h2>
</div>
<p class="text-sm text-dark_pastel_green">
₦3000
<span class="mr-2 line-through opacity-70 text-slate-500"
>₦4000</span
>
</p>
<div>
<i class="fa-solid fa-star text-yellow-700"></i>
<i class="fa-solid fa-star text-yellow-700"></i>
<i class="fa-solid fa-star text-yellow-700"></i>
<span class="font-bold opacity-60">(77%)</span>
</div>
</div>
</section>
</div>
</main>
</div>
<!-- Footer-->
<footer class="footer"></footer>
<!-- Script-->
<script>
const card = document.querySelector("hide");
const cards = document.querySelectorAll(".card");
cards.forEach((card) => {
const addToCartButton = card.querySelector(".addToCartButton");
const cardImage = card.querySelector(".card img");
let hoverTimeout;
const transitionDuration = "300ms"; // Adjust the duration as needed
card.addEventListener("mouseenter", () => {
clearTimeout(hoverTimeout);
hoverTimeout = setTimeout(() => {
addToCartButton.classList.remove("hidden");
cardImage.style.transform = "scale(1.1)";
addToCartButton.style.transform = "scale(1.1)";
card.style.transition = `transform ${transitionDuration} ease, box-shadow ${transitionDuration} ease`;
}, 300); // Adjust the delay as needed
});
card.addEventListener("mouseleave", () => {
clearTimeout(hoverTimeout);
hoverTimeout = setTimeout(() => {
addToCartButton.classList.add("hidden");
cardImage.style.transform = "scale(1)";
addToCartButton.style.transform = "scale(1)";
card.style.transition = `transform ${transitionDuration} ease, box-shadow ${transitionDuration} ease`;
}, 300); // Adjust the delay as needed
});
// Set a fixed width for the image
cardImage.style.width = "160px"; // Adjust the width as needed
});
let slideIndex = 0;
showSlides();
function showSlides() {
let i;
let slides = document.getElementsByClassName("mySlides");
let dots = document.getElementsByClassName("dot");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {
slideIndex = 1;
}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
slides[slideIndex - 1].style.display = "block";
dots[slideIndex - 1].className += " active";
setTimeout(showSlides, 2000); // Change image every 2 seconds
}
</script>
<script src="createFooter.js"></script>
</body>
</html>