-
Notifications
You must be signed in to change notification settings - Fork 1
/
womenpage.js
609 lines (596 loc) · 21.8 KB
/
womenpage.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
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
let womenClothing = [
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/f127a618/nasty-gal-designer-champagne-Cowl-Back-Satin-Wrap-Maxi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Cowl Back Satin Wrap Maxi Dress",
product_id: "women1",
category: "Dresses",
price: 103,
price2: 72,
gender: "women",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/b7f02410/nasty-gal-designer-beige-Sequin-Embellished-Strappy-Tulle-Maxi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Natural Sequin Embellished Strappy Tulle Maxi Dress",
product_id: "women2",
category: "Dresses ",
price: 365,
price2: 256,
gender: "women",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/2a93cbd9/jean-paul-gaultier-brown-X-Lotta-Volkova-Sheer-Knit-Top.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Brown X Lotta Volkova Sheer Knit Top",
product_id: "women3",
category: "Top",
price: 396,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/a588672c/nasty-gal-designer-green-Warehouse-Sequin-Halter-Drape-Back-Midi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Green Warehouse Sequin Halter Drape Back Midi Dress",
product_id: "women4",
category: "Dresses",
price: 126,
price2: 86,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/a3586e8c/nasty-gal-designer-blue-Floral-Jacquard-Balloon-Sleeve-Skater-Mini-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Blue Floral Jacquard Balloon Sleeve Skater Mini Dress",
product_id: "women5",
category: "Mini Dress",
price: 72,
price2: 51,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/8ac9632e/nasty-gal-designer-pink-Midi-Shirt-Dress-In-Print.jpeg",
brand: "Nasty Gal",
product_name: "Women's Pink Midi Shirt Dress In Print",
product_id: "women6",
category: "Dresses",
price: 67,
price2: 19,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/5810cf6b/jean-paul-gaultier-green-X-Lotta-Volkova-Satin-And-Mesh-Bra-Top.jpeg",
brand: "Nasty Gal",
product_name: "Women's Green X Lotta Volkova Satin And Mesh Bra Top",
product_id: "women7",
category: "Top",
price: 574,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/9b5a2cab/nasty-gal-designer-white-Playing-For-Flower-Floral-Midi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's White Playing For Flower Floral Midi Dress",
product_id: "women8",
category: "Dresses",
price: 62,
price2: 34,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/1d2b640b/jean-paul-gaultier-brown-X-Lotta-Volkova-High-rise-Flared-Pants.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Brown X Lotta Volkova High-rise Flared Pants",
product_id: "women9",
category: "Pants",
price: 396,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/48271bd8/jean-paul-gaultier-Beige-X-Lotta-Volkova-Top-semitrasparente-in-maglia.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Natural X Lotta Volkova Sheer Knit Top",
product_id: "women10",
category: "Top",
price: 396,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/7a7d757a/nasty-gal-designer-black-Recycled-Plunging-V-Neck-Slit-Midi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Recycled Plunging V Neck Slit Midi Dress",
product_id: "women11",
category: "Dresses",
price: 47,
price2: 37,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/d5b3db80/jean-paul-gaultier-beige-X-Lotta-Volkova-High-rise-Flared-Pants.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Natural X Lotta Volkova High-rise Flared Pants",
product_id: "women12",
category: "Pants",
price: 396,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/5b2352bd/nasty-gal-designer-black-Embellished-Sequin-Fringe-Trim-Bodycon-Mini-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Black Embellished Sequin Fringe Trim Mini Dress",
product_id: "women13",
category: "Mini Dress",
price: 219,
price2: 153,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/6756dac4/nasty-gal-designer-olive-Sequin-Split-Front-Midi-Tea-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Green Sequin Split Front Midi Tea Dress",
product_id: "women14",
category: "Dresses",
price: 117,
price2: 47,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/4c1fe1da/jean-paul-gaultier-blue-Pleated-Leather-Minidress.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Blue Pleated Leather Minidress",
product_id: "women15",
category: "Mini Dress",
price: 1321,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/3e072fc6/nasty-gal-designer-orange-Sheer-Sleeve-Maxi-Slit-Wrap-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Orange Sheer Sleeve Maxi Slit Wrap Dress",
product_id: "women16",
category: "Dresses",
price: 88,
price2: 30,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/07d0e3b7/nasty-gal-designer-green-Satin-Balloon-Sleeve-Wrap-Maxi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Green Satin Balloon Sleeve Wrap Maxi Dress",
product_id: "women17",
category: "Dresses",
price: 68,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/42fb250c/nasty-gal-designer-cream-Cowl-Back-Satin-Wrap-Maxi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Natural Cowl Back Satin Wrap Maxi Dress",
product_id: "women18",
category: "Dresses",
price: 103,
price2: 72,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/0a7f3e90/jean-paul-gaultier-beige-X-Lotta-Volkova-Double-breasted-Cutout-Wool-Blazer.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Natural X Lotta Volkova Double-breasted Cutout Wool Blazer",
product_id: "women19",
category: "Blazer",
price: 1164,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/f25ba4c0/nasty-gal-designer-rose-Satin-Balloon-Sleeve-Wrap-Maxi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Satin Balloon Sleeve Wrap Maxi Dress",
product_id: "women20",
category: "Dresses",
price: 97,
price2: 68,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/eb02a65b/jean-paul-gaultier-brown-X-Lotta-Volkova-Blazer-mit-Cut-outs.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Brown X Lotta Volkova Cutout Blazer",
product_id: "women21",
category: "Blazer",
price: 1054,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/f79062a1/nasty-gal-designer-champagne-Sequin-V-Neck-Angel-Sleeve-Maxi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Metallic Sequin V Neck Angel Sleeve Maxi Dress",
product_id: "women22",
category: "Dresses",
price: 190,
price2: 133,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/d26b2aa0/jean-paul-gaultier-green-X-Lotta-Volkova-Lace-up-Satin-And-Mesh-leggings.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Green X Lotta Volkova Lace-up Satin And Mesh leggings",
product_id: "women23",
category: "Pants",
price: 1070,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/a9d43d90/jean-paul-gaultier-black-X-Lotta-Volkova-Lace-up-Satin-And-Mesh-leggings.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Black X Lotta Volkova Lace-up Satin And Mesh leggings",
product_id: "women24",
category: "Pants",
price: 1070,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/net-a-porter/12fceeb1/jean-paul-gaultier-black-Lotta-Volkova-Bustier-Aus-Satin-Mit-Schnurung.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Black + Lotta Volkova Lace-up Satin Bralette",
product_id: "women25",
category: "Top",
price: 679,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/d7b1d89a/jean-paul-gaultier-black-Fitted-Blazer.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Black X Lotta Volkova Fitted Blazer",
product_id: "women26",
category: "Mini Dress",
price: 966,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/9120b814/nasty-gal-designer-white-Balloon-Sleeve-Sequin-Embellished-Mini-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's White Balloon Sleeve Sequin Embellished Mini Dress",
product_id: "women27",
category: "Mini Dress",
price: 190,
price2: 133,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/2fe282c9/nasty-gal-designer-off-white-Ruched-Bust-Tie-Back-Midi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's White Ruched Bust Tie Back Midi Dress",
product_id: "women28",
category: "Dresses",
price: 88,
price2: 44,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/24927641/nasty-gal-designer-pink-Blurred-Print-Satin-Column-Maxi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Pink Blurred Print Satin Column Maxi Dress",
product_id: "women29",
category: "Dresses",
price: 97,
price2: 68,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/a725b25d/jean-paul-gaultier-black-High-rise-Shorts.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Black X Lotta Volkova High-rise Shorts",
product_id: "women30",
category: "Shorts",
price: 642,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/f49db2a4/jean-paul-gaultier-black-X-Lotta-Volkova-Gonna-a-tubino-in-lana.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Black X Lotta Volkova Lace-up Wool Pencil Skirt",
product_id: "women31",
category: "Skirts",
price: 814,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/683daba1/nasty-gal-designer-green-Floral-Print-Funnel-Neck-Midi-Smock-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Green Floral Print Funnel Neck Midi Smock Dress",
product_id: "women32",
category: "Mini Dress",
price: 67,
price2: 21,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/1ceb04cf/jean-paul-gaultier-black-X-Lotta-Volkova-High-Rise-Hose.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Black X Lotta Volkova Wide-leg Pants",
product_id: "women33",
category: "Pants",
price: 455,
price2: "🚚"
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/mytheresa/64d538c3/jean-paul-gaultier-beige-X-Lotta-Volkova-Low-rise-Wool-Straight-Pants.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Natural X Lotta Volkova Low-rise Wool Straight Pants",
product_id: "women34",
category: "Pants",
price: 705,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/sachinandbabi/cc65aa2a/sachin-babi-SilverCharcoal-Simone-Gown.jpeg",
brand: "Sachin & Babi",
product_name: "Women's Gray Simone Gown",
product_id: "women35",
category: "Gown",
price: 795,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/fb52678e/nasty-gal-designer-lime-Petite-Jacquard-Satin-Tie-Back-Mini-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Green Petite Jacquard Satin Tie Back Mini Dress",
product_id: "women36",
category: "Mini Dress",
price: 73,
price2: 51,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/ssense/5fb5a500/jean-paul-gaultier-Multicolor-Ssense-Exclusive-Tulle-Long-Dress.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Black Ssense Exclusive Tulle Long Dress",
product_id: "women37",
category: "Dresses",
price: 800,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/6daef09a/nasty-gal-designer-champagne-Satin-Ruffle-Detail-Strappy-Wrap-Maxi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Natural Satin Ruffle Detail Strappy Wrap Maxi Dress",
product_id: "women38",
category: "Dresses",
price: 82,
price2: 57,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/577ec21a/nasty-gal-designer-black-Cropped-Strapless-Seam-Detail-Corset-Top.jpeg",
brand: "Nasty Gal",
product_name: "Women's Black Cropped Strapless Seam Detail Corset Top",
product_id: "women39",
category: "Top",
price: 67,
price2: 47,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/f9600c4f/nasty-gal-designer-purple-Satin-Angel-Sleeve-Tie-Side-Maxi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Purple Satin Angel Sleeve Tie Side Maxi Dress",
product_id: "women40",
category: "Dresses",
price: 88,
price2: 68,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/ca6b4970/nasty-gal-designer-beige-Satin-Cowl-Maxi-Slip-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Natural Satin Cowl Maxi Slip Dress",
product_id: "women41",
category: "Dresses",
price: 82,
price2: 57,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/selfridges/91a8b700/jean-paul-gaultier-Beige-Black-Nude-Mona-Lisa-Printed-Stretch-jersey-Mini-Dress.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Natural Mona Lisa Printed Stretch-jersey Mini Dress",
product_id: "women42",
category: "Mini Dress",
price: 395,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/f9600c4f/nasty-gal-designer-purple-Satin-Angel-Sleeve-Tie-Side-Maxi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Purple Satin Angel Sleeve Tie Side Maxi Dress",
product_id: "women43",
category: "Mini Dress",
price: 88,
price2: 62,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/f9600c4f/nasty-gal-designer-purple-Satin-Angel-Sleeve-Tie-Side-Maxi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Purple Satin Angel Sleeve Tie Side Maxi Dress",
product_id: "women44",
category: "Mini Dress",
price: 88,
price2: 62,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/sachinandbabi/f13dd662/sachin-babi-Ivory-Audra-Gown.jpeg",
brand: "Sachin & Babi",
product_name: "Women's White Audra Gown",
product_id: "women45",
category: "Gown",
price: 795,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/ssense/dada235a/jean-paul-gaultier-BlackRedGre-Multi-label-Turtleneck.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Black Multi-label Turtleneck",
product_id: "women46",
category: "Mini Dress",
price: 465,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/ssense/dada235a/jean-paul-gaultier-BlackRedGre-Multi-label-Turtleneck.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Black Multi-label Turtleneck",
product_id: "women47",
category: "Mini Dress",
price: 465,
price2: "🚚",
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/2c5646e1/nasty-gal-designer-rose-V-Neck-Wrap-Satin-Maxi-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Pink Satin Long Sleeve Wrap Maxi Dress",
product_id: "women48",
category: "Dresses",
price: 73,
price2: 51,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/nastygal/9c7500fe/nasty-gal-designer-multi-Floral-Print-Strapless-Mini-Dress.jpeg",
brand: "Nasty Gal",
product_name: "Women's Floral Print Strapless Mini Dress",
product_id: "women49",
category: "Mini Dress",
price: 47,
price2: 67,
},
{
img:
"https://cdna.lystit.com/200/250/tr/photos/ssense/35116aac/jean-paul-gaultier-Multicolor-Ssense-Exclusive-Tulle-Midi-Skirt.jpeg",
brand: "Jean Paul Gaultier",
product_name: "Women's Ssense Exclusive Tulle Midi Skirt",
product_id: "women50",
category: "Mini Dress",
price: 610,
price2: "🚚",
},
]
let womendata = document.getElementById( "box" );
let womendataLS = JSON.parse( localStorage.getItem( "cartData" ) ) || [];
function displayProducts( womenClothing ) {
womendata.innerHTML = "";
womenClothing.forEach( function ( elem ) {
let product = document.createElement( "div" );
let product1 = document.createElement( "div" );
let product2 = document.createElement( "div" );
let product3 = document.createElement( "div" );
let img = document.createElement( "img" );
img.src = elem.img;
let name = document.createElement( "p" )
name.innerText = elem.brand
let product_name = document.createElement( "p" )
product_name.innerText = elem.product_name
let price = document.createElement( "h3" )
price.innerText = "$" + elem.price
let btn = document.createElement( "button" )
btn.innerText = "Add To Cart"
btn.addEventListener( "click", function () {
if ( btnFunc( elem.product_id ) == true ) {
alert( "Product added Successfully" );
womendataLS.push( elem );
// console.log(womendataLS);
localStorage.setItem( "cartData", JSON.stringify( womendataLS ) )
} else {
alert( "Product already in the cart" )
}
} )
elem.quant = 1;
product1.append( img )
product2.append( name, product_name, price )
product3.append( btn )
product.append( product1, product2, product3 );
womendata.append( product )
} )
// localStorage.setItem("cartData",JSON.stringify(womenClothing))
}
displayProducts( womenClothing )
document.querySelector( "#Category" ).addEventListener( "change", function () {
let val = document.querySelector( "#Category" ).value;
if ( val == "All" ) {
displayProducts( womenClothing );
}
else {
let filtered = womenClothing.filter( function ( elem ) {
return elem.category == val;
} )
displayProducts( filtered );
}
} )
document.querySelector( "#Brand" ).addEventListener( "change", function () {
let val = document.querySelector( "#Brand" ).value;
if ( val == "All" ) {
displayProducts( womenClothing );
}
else {
let filtered = womenClothing.filter( function ( elem ) {
return elem.brand == val;
} )
displayProducts( filtered );
}
} )
document.querySelector( "#SortPrice" ).addEventListener( "change", function () {
let val = document.querySelector( "#SortPrice" ).value;
if ( val == "Ascending" ) {
womenClothing.sort( function ( a, b ) {
if ( a.price < b.price ) return -1
if ( a.price > b.price ) return 1
return 0;
} )
displayProducts( womenClothing );;
}
else if ( val == "Descending" ) {
womenClothing.sort( function ( a, b ) {
if ( a.price < b.price ) return 1
if ( a.price > b.price ) return -1
return 0;
} )
displayProducts( womenClothing );;
}
} )
function btnFunc( id ) {
for ( let i = 0; i < womendataLS.length; i++ ) {
if ( womendataLS[ i ].product_id == id ) {
return false;
}
}
return true;
}
document.querySelector( "#navbar" ).style.width = "100%";
document.querySelector( "#navbar" ).style.height = "105px";