forked from arghadipmanna101/Flipkart_Clone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
topdeals.js
89 lines (82 loc) · 2.08 KB
/
topdeals.js
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
const topdeals = [
{
"name":"Music instruments",
"description": " Brand : Osco",
"price": "₹ 4K",
"rating":"🌟4.5 ,",
"off": "30%off",
"imageUrl": "topDeal1.webp"
},
{
"name": "Earphones & Watches",
"description": " Brand : Loyal Brothers",
"price": "₹ 2.5k",
"rating":"🌟4.0 ,",
"off": "15%off",
"imageUrl": "topDeal2.webp"
},
{
"name": "Umbrellas",
"description": "Brand : We",
"price": "₹ 590",
"rating":"🌟4.1 ,",
"off": "23%off",
"imageUrl": "topDeal3.webp"
},
{
"name": "Teddy bear",
"description": "Brand : Love",
"price": "₹ 1.2k",
"rating":"🌟3.8 ,",
"off": "7%off",
"imageUrl": "topDeal4.webp"
},
{
"name": "Shoes",
"description":"Brand : Buma",
"price": "₹ 3.5k",
"rating":"🌟4.5 ,",
"off": "5%off",
"imageUrl": "topDeal5.webp"
},
{
"name": "Urbanic coat",
"description": "Brand : Rubic",
"price": "₹ 4.2k",
"rating":"🌟4.9 ,",
"off": "3%off",
"imageUrl": "topDeal6.webp"
},
{
"name": "Hoodies",
"description": "Brand : Looks",
"price": "₹ 2.5k",
"rating":"🌟3.2 ,",
"off": "19%off",
"imageUrl": "topDeal7.webp"
},
{
"name": "Mobiles",
"description": "Brand : Ninex",
"price": "₹ 56.5k",
"rating":"🌟4.6 ,",
"imageUrl": "topDeal8.webp"
}
]
function addTopdeals() {
const topdealsWrapper = $(".swiper-wrapper");
topdeals.map((t) => {
const slide = $("<div>").addClass("swiper-slide").html(`
<img src="./images/${t.imageUrl}" alt="">
<h4>${t.name}</h4>
<p>${t.description.substring(0, 50)}</p>
<p>${t.price}
${t.rating}
${t.off}</p>
`);
topdealsWrapper.append(slide);
});
}
$(document).ready(function() {
addTopdeals();
});