-
Notifications
You must be signed in to change notification settings - Fork 0
/
women_credobeauty..html
339 lines (289 loc) · 13.6 KB
/
women_credobeauty..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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="container">
<div id="navbar"></div>
<div id="main"></div>
</div>
<!-- body section -->
<select id="filter" onchange="filterCat()">
<option value="">FILTER CATEGORY</option>
<option value="LIP CARE">LIP CARE</option>
<option value="EYE BROW LINER">EYE BROW LINER</option>
<option value="BODY OIL">BODY OIL</option>
<option value="HAIR STYLE">HAIR STYLE</option>
<option value="BODY CLEANERS">BODY CLEANERS</option>
<option value="MAKEUP CREAM">MAKEUP CREAM</option>
<option value="BODY LOTION">BODY LOTION</option>
<option value="BODY PERFUME">BODY PERFUM</option>
<option value="BROW BRUSH">BROW BRUSH</option>
</select>
<select id="sortPrice" onchange="sortPrice()">
<option value="">Sort by price</option>
<option value="low">Low to high</option>
<option value="high">High to low</option>
</select>
<div id="container1">
</div>
</body>
</html>
<script type="module">
// navbar section
// body part section
var womenData = [
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/Kinship2022_SelfReflectSport_Product_1080px_360x.jpg?v=1645225195",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/Kinship_2022_SelfReflectSport_Texture_1080px.jpg?v=1645253233",
name: "Self Reflect Sport Sunscreen Broad Spectrum SPF 60",
price: "28.00",
brand: "KINSHIP",
category: "LIP CARE"
}, {
brand: "Han Skincare Cosmetics",
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/HANCleanMascaraBlack_360x.png?v=1645062631",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/HANCleanMascaraBlack-Lifestyle1.png?v=1645062612",
name: "HAN Clean Mascara",
price: "20.00",
category: "EYE BROW LINER"
}, {
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/Kinship_2021_NakedApple_ProductPDP_1800px_360x.jpg?v=1644876709",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/Kinship_2021_NakedApple_Texture_0197_1080px_alt.jpg?v=1644881030",
name: "Naked Apple Oil-Free Blemish Control Gel Cleanser",
price: "23.00",
brand: "KINSHIP",
category: "BODY OIL"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/Hero-LuminCollection_360x.png?v=1644630233",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/Hero-LuminMushroom.png?v=1644630210",
name: "Lumin Collection",
price: "139.00",
brand: "Wildling",
category: "HAIR STYLE"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/27-Rosiers-Extra-Ordinaire-Illuminator-Kit-1-Dark_360x.png?v=1644443431",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/27-Rosiers-Extra-Ordinaire-Illuminator-Kit-2-Light.png?v=1644443328",
name: "Extra/Ordinaire Skin Illuminator Full Spectrum Collection",
price: "88.00",
brand: "27 Rosiers",
category: "BODY CLEANERS"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/gold_extraordinaire.png?v=1644546368",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/27-Rosiers-Extra-Ordinaire-Look-1-Raya-Gold-2_1cd07751-895d-4607-bd10-cabf348e0a25.jpg?v=1644540992",
name: "Extra/Ordinaire Skin Illuminator",
price: "32.00",
brand: "27 Rosiers",
category: "MAKEUP CREAM"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/ereperez-eco-duo-sharpener-01-white_360x.jpg?v=1644284952",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/ereperez-eco-duo-sharpener-03-white.jpg?v=1644284783",
name: "Eco Duo Sharpener",
price: "11.00",
brand: "Ere Perez",
category: "HAIR STYLE"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/EP_Curler_White_360x.jpg?v=1644284819",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/ere-perez-charlotte-look-2-07.jpg?v=1644285014",
name: "Spectacular Eyelash Curler",
price: "19.00",
brand: "Ere Perez",
category: "BODY LOTION"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/Soundstage_Hero_1080x1080_6021a809-2d27-4497-aae2-dc631e2681f8.jpg?v=1644016748",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/Soundstage_Cat_1000x1000_1.png?v=1644016898",
name: "Dewy Gloss",
price: "26.00",
brand: "Youthforia",
category: "EYE KINER"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/BlushBrush_Hero2_1080x1080_ec9d1440-5fa9-4be2-8c3c-a47e085f8172_360x.png?v=1644016776",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/BlushBrush_Hero1_1080x1080_bb27d0a7-c4d5-4c51-8250-d5e1b3101436.png?v=1644016711",
name: "Youthforia Blush Brush",
price: "18.00",
brand: "Youthforia",
category: "BROW BRUSH"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/Untitleddesign-2022-02-08T134355.521_360x.png?v=1644359175",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/ARCSMEAR.jpg?v=1644346246",
name: "The Advanced Response Complex Face | Neck Cream",
price: "128.00",
brand: "Maya Chia",
category: "BODY LOTION"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/Credo-KW-Primer-Bottle-Uncapped_360x.jpg?v=1643770577",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/819869029677_Model-Bottle.jpg?v=1643827697",
name: "The Beautiful Primer",
price: "55.00",
brand: "Kjaer Weis",
category: "HAIR STYLE"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/APRESBottle.jpg?v=1643763570",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/APRES50mlbottle_box.jpg?v=1643775219",
name: "APRÈS Eau De Parfum",
price: "105.00",
brand: "Ellis Brooklyn",
category: "BODY PERFUME"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/APRESBottle.jpg?v=1643763570",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/OTK-BSBS-4_02.jpg?v=1644278216",
name: "Bestsellers Bodycare Set",
price: "48.00",
brand: "OSEA",
category: "BODY CLEANERS"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/GlowcurrantBooster_03_360x.jpg?v=1643666207",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/GlowcurrantBooster_02_Edit.jpg?v=1643675385",
name: "Bestsellers Bodycare Set",
price: "10.00",
brand: "OSEA",
category: "BODY CLEANERS"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/CredoBFBBox1D_360x.jpg?v=1643668387",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/CredoBFBonOrange1.jpg?v=1643668422",
name: "Credo Clean Starter Kit - Black Founded Brands Collection",
price: "75.00",
brand: "Credo",
category: "BODY CLEANERS"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/DermatologicalStrength2oz_Top_360x.png?v=1643674555",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/DermatologicalStrength2oz_Open.png?v=1643231436",
name: "Dermatological Strength Shea Butter",
price: "25.00",
brand: "Ellis Brooklyn",
category: "BODY PERFUME"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/athrrosequartzquad_360x.jpg?v=1643088448",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/Athr_rosequartzquad_4_1.12.22.jpg?v=1643088448",
name: "Rose Quartz Quad",
price: "20.00",
brand: "Ellis Brooklyn",
category: "MAKEUP CREAM"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/HR_FINEFRAGRANCE_FOG_OG.png?v=1642625428",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/Fog.jpg?v=1642622958",
name: "Fog Eau de Parfum",
price: "120.00",
brand: "Maya Chia",
category: "BODY PERFUME"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/OTK-BSDS-4_01_360x.jpg?v=1642191687",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/OTK-BSDS-4_02.jpg?v=1642217230",
name: "Bestsellers Discovery Set",
price: "40.00",
brand: "OSEA",
category: "BODY PERFUME"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/EyelinerBrush_360x.jpg?v=1641610655",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/CredoBrushGroup_c320602d-0203-47cd-ab9d-426d8ac4f9d7.png?v=1644284861",
name: "Eyeliner Brush",
price: "22.00",
brand: "OSEA",
category: "BROW BRUSH"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/01_21-595-HTC-04-10_resized_CREDO_360x.jpg?v=1641529524",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/04_Nourish_StillLife_PDP_CREDO.jpg?v=1641529521",
name: "Nourish Ultra-Hydrating Body Crème",
price: "22.00",
brand: "Ellis Brooklyn",
category: "LIP CARE"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/01_21-595-HTC-04-10_resized_CREDO_360x.jpg?v=1641529524",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/MakingMoves_MilkyCleanser_Lifestyle_UM_Edit.jpg?v=1641412775",
name: "Making Moves Milky Cleanser",
price: "34.00",
brand: "Kjaer Weis",
category: "BODY CLEANERS"
},
{
imgUrl1: "https://cdn.shopify.com/s/files/1/0637/6147/products/ursa_major_golden_hour_recovery_cream_at_credo_beauty_1.jpg?v=1572517167",
imgUrl2: "https://cdn.shopify.com/s/files/1/0637/6147/products/Untitled-Session0127.square.jpg?v=1602885623",
name: "Golden Hour Recovery Cream",
price: "48.00",
brand: "KINSHIP",
category: "BODY LOTION"
},
];
var cartArr = JSON.parse(localStorage.getItem("cartItem")) || [];
displayData(womenData);
function displayData(womenData) {
document.querySelector("#container1").innerHTML = ""
womenData.map(function (data) {
var div = document.createElement("div");
div.setAttribute("id", "eachdiv")
var image = document.createElement("img");
image.src = data.imgUrl1;
// image.setAttribute("src", data.imgUrl1);
var brand = document.createElement("p");
brand.textContent = data.brand;
brand.setAttribute("id","brandname")
var name1 = document.createElement("p");
name1.textContent = data.name;
var price = document.createElement("p");
price.textContent = `Price : $ ${data.price}`;
let div1 = document.createElement("div");
div1.setAttribute("id", "button")
var but = document.createElement("button");
but.textContent = " Add to cart"
but.onclick=()=> {
localStorage.setItem("Cart_Items",JSON.stringify(data))
alert("Succesfully added")
};
div1.append(but)
div.append(image, brand, name1, price, div1);
div.onclick=()=>{
localStorage.setItem("Clicked_items",JSON.stringify(data))
window.location.href="product.html"
}
document.querySelector("#container1").append(div);
});
};
function filterCat() {
var selected = document.querySelector("#filter").value;
var filterlist = womenData.filter(function (elem) {
return elem.category == selected;
});
console.log(filterlist)
displayData(filterlist)
};
function sortPrice() {
// console.log(filterlist)
var selected = document.querySelector("#sortPrice").value;
if (selected == "low") {
womenData.sort(function (a, b) {
return Number(a.price) - Number(b.price);
});
}
if (selected == "high") {
womenData.sort(function (a, b) {
return Number(b.price) - Number(a.price);
});
}
displayData(womenData)
}
</script>