-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
820 lines (663 loc) · 27.3 KB
/
index.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
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
function homePage(value) {
sessionStorage.setItem("sport" , value);
window.document.location.href = "./sportkit.html";
}
function sportKitPage() {
d = sessionStorage.getItem("dark")
if(d === '1') {
document.getElementsByClassName("x")[0].classList.add("body-dark")
kits = document.getElementsByClassName("kit-card")
for(let i=0;i<kits.length;i++) {
kits[i].classList.add("kit-card-dark");
}
bgs = document.getElementsByClassName("img-background")
for(let i=0;i<bgs.length;i++) {
bgs[i].classList.add("img-background-dark");
}
}
else {
document.getElementsByClassName("x")[0].classList.remove("body-dark")
kits = document.getElementsByClassName("kit-card")
for(let i=0;i<kits.length;i++) {
kits[i].classList.remove("kit-card-dark");
}
bgs = document.getElementsByClassName("img-background")
for(let i=0;i<bgs.length;i++) {
bgs[i].classList.remove("img-background-dark");
}
}
sport = sessionStorage.getItem("sport");
if(sport === 'cricket') {
document.getElementsByClassName("title")[0].textContent = "Cricket - Kits";
document.getElementById("cricket-extra").classList.remove("d-none");
var cricketCard = document.getElementsByClassName("cricket-card");
for(var i = 0; i < cricketCard.length; i++) {
cricketCard[i].classList.remove("col-lg-6");
cricketCard[i].classList.add("col-lg-4");
}
document.getElementsByClassName("img-fluid")[0].src ="Assets/landing/gloves11.png";
document.getElementsByClassName("img-fluid")[1].src ="Assets/landing/aus2.png";
document.getElementsByClassName("img-fluid")[2].src ="Assets/landing/bat1.png";
document.getElementsByClassName("kit-name")[0].textContent = "Gloves";
document.getElementsByClassName("kit-name")[2].textContent = "Bats";
descs = ["View our brand new collection of confortable, blisterless, grippy, gloves, now with new shock absorption."]
descs.push("Support your favourite team and show the power of the crowd by checking out our jersey merch shelf.")
descs.push("Check out our new varieties of high quality willow bats, that will provide you optimum performance")
kit_descs = document.getElementsByClassName("kit-desc");
console.log(descs)
for(let i=0;i<3;i++) {
kit_descs[i].textContent = descs[i];
}
}
else {
descs = ["Decide your speed, acceleration, precision and control by deciding on our new variety of boots."]
descs.push("Support your favourite team and show the power of the crowd by checking out our jersey merch shelf.")
kit_descs = document.getElementsByClassName("kit-desc");
console.log(descs)
for(let i=0;i<2;i++) {
kit_descs[i].textContent = descs[i];
}
}
}
var swaps=[0,0,0,0,0,0]
let new_src = "Assets/football_jerseys/"
let locs=["RMFC/","MANU/","PSG/","FRA/","GER/","JUV/"]
function loadProductsPages(value) {
var sportValue = value[0] === "C" ? "cricket" : "football";
sessionStorage.setItem("sport" , sportValue);
sessionStorage.setItem("kit" , value);
window.document.location.href = "./products.html";
}
function loadProductsPage(value) {
sessionStorage.setItem("kit" , document.getElementsByClassName("title")[0].textContent[0] + value);
window.document.location.href = "./products.html";
}
function productsPage() {
d = sessionStorage.getItem("dark")
if(d === '1') {
document.getElementsByClassName("x")[0].classList.add("body-dark")
kits = document.getElementsByClassName("product-card")
for(let i=0;i<kits.length;i++) {
kits[i].classList.add("product-card-dark");
}
bgs = document.getElementsByClassName("img-background")
for(let i=0;i<bgs.length;i++) {
bgs[i].classList.add("img-background-dark");
}
}
else {
document.getElementsByClassName("x")[0].classList.remove("body-dark")
kits = document.getElementsByClassName("product-card")
for(let i=0;i<kits.length;i++) {
console.log("a")
kits[i].classList.remove("product-card-dark");
}
bgs = document.getElementsByClassName("img-background")
for(let i=0;i<bgs.length;i++) {
bgs[i].classList.remove("img-background-dark");
}
}
var sport = sessionStorage.getItem("sport")
var kit = sessionStorage.getItem("kit");
sessionStorage.setItem("toggle" , "1");
if(sport === "cricket") {
var title = document.getElementsByClassName("title")[0];
var productName = "Cricket - ";
if(kit[1] === '1') {
productName += "Gloves";
var cricketCard = document.getElementsByClassName("cricket-card");
var toggleButton = document.getElementsByClassName("btn-product-card-outline");
var customiseButton = document.getElementsByClassName("btn-product-card");
for(var i = 0; i < cricketCard.length; i++) {
cricketCard[i].classList.add("d-none");
toggleButton[i].classList.add("d-none");
customiseButton[i].style.width = "100%";
}
var imgSrc = "Assets/cricket_gloves/gloves";
document.getElementsByClassName("img-fluid")[0].src = imgSrc + "11.png";
document.getElementsByClassName("product-name")[0].textContent = "Kauna 2.1";
document.getElementsByClassName("product-desc")[0].textContent = "The safest pair of gloves with stunning green look!";
document.getElementsByClassName("img-fluid")[1].src = imgSrc + "21.png";
document.getElementsByClassName("product-name")[1].textContent = "Beast Pro";
document.getElementsByClassName("product-desc")[1].textContent = "Turn on 'THE BEAST MODE' before the start of play.";
document.getElementsByClassName("img-fluid")[2].src = imgSrc + "31.png";
document.getElementsByClassName("product-name")[2].textContent = "Pace 2.4";
document.getElementsByClassName("product-desc")[2].textContent = "Comfort, Stylish, and Safety is what 'Pace 2.4' provides you!";
}
else if(kit[1] === '2') {
productName += "Jerseys";
var imgSrc = "Assets/cricket_jerseys/";
document.getElementsByClassName("img-fluid")[0].src = imgSrc + "aus1.png";
document.getElementsByClassName("product-name")[0].textContent = "Australia";
document.getElementsByClassName("product-desc")[0].textContent = "Get on with the Aussies jersey and shout out - 'SAY NO TO DIE'!";
document.getElementsByClassName("img-fluid")[1].src = imgSrc + "eng1.png";
document.getElementsByClassName("product-name")[1].textContent = "England";
document.getElementsByClassName("product-desc")[1].textContent = "The cup has come home after a very long time, let's celebrate it.";
document.getElementsByClassName("img-fluid")[2].src = imgSrc + "ind1.png";
document.getElementsByClassName("product-name")[2].textContent = "India";
document.getElementsByClassName("product-desc")[2].textContent = "Support the Men in Blue, who cares if they wear whites against The Kiwis.";
document.getElementsByClassName("img-fluid")[3].src = imgSrc + "nz1.png";
document.getElementsByClassName("product-name")[3].textContent = "New Zealand";
document.getElementsByClassName("product-desc")[3].textContent = "Love the 'Sport', Love the 'Country', and Love 'The Kiwis Kindness'!";
document.getElementsByClassName("img-fluid")[4].src = imgSrc + "sa1.png";
document.getElementsByClassName("product-name")[4].textContent = "South Africa";
document.getElementsByClassName("product-desc")[4].textContent = "We are 'The Most Unluckiest', do support us with our awesome jerseys.";
document.getElementsByClassName("img-fluid")[5].src = imgSrc + "wi1.png";
document.getElementsByClassName("product-name")[5].textContent = "West Indies";
document.getElementsByClassName("product-desc")[5].textContent = "We once ruled this arena, just for wait 'THE GREATEST COMEBACK'!";
}
else {
productName += "Bats";
var cricketCard = document.getElementsByClassName("cricket-card");
var toggleButton = document.getElementsByClassName("btn-product-card-outline");
var customiseButton = document.getElementsByClassName("btn-product-card");
for(var i = 0; i < cricketCard.length; i++) {
cricketCard[i].classList.add("d-none");
toggleButton[i].classList.add("d-none");
customiseButton[i].style.width = "100%";
}
var imgSrc = "Assets/cricket_bats/bat";
document.getElementsByClassName("img-fluid")[0].src = imgSrc + "1.png";
document.getElementsByClassName("product-name")[0].textContent = "Kauna 2.0";
document.getElementsByClassName("product-desc")[0].textContent = "Bring on the 'classy' cover drives and on drives.";
document.getElementsByClassName("img-fluid")[1].src = imgSrc + "2.png";
document.getElementsByClassName("product-name")[1].textContent = "Beast 1.0";
document.getElementsByClassName("product-desc")[1].textContent = "Can someone see the ball? Please don't hurt it too much!";
document.getElementsByClassName("img-fluid")[2].src = imgSrc + "3.png";
document.getElementsByClassName("product-name")[2].textContent = "Pace Pro";
document.getElementsByClassName("product-desc")[2].textContent = "Elegancy and Timing is the best way of playing it!";
}
title.textContent = productName;
}
swaps=[0,0,0,0,0,0]
var kit_temp = sessionStorage.getItem("kit")
if(kit_temp === 'F1') {
var toggleButton = document.getElementsByClassName("btn-product-card-outline");
var customiseButton = document.getElementsByClassName("btn-product-card");
for(var i = 0; i < 6; i++) {
toggleButton[i].classList.add("d-none");
customiseButton[i].style.width = "100%";
}
descs = Array()
descs.push("Fast used to be fast enough. Gear up and ghost everyone.")
descs.push("It shows no mercy. It feels no pity. Mute your enemies.")
descs.push("Touch and Control. go on take our most innovative boot.")
descs.push("Reflection of power, speed and agility. Let's Superfly")
descs.push("inject a tounh of flair to our game. It IS revolutionary")
descs.push("Speed, Acceleration and Mystrey. Feel like a king with us.")
prodesc = document.getElementsByClassName("product-desc")
for(let i=0; i<6; i++) {
prodesc[i].textContent = descs[i];
}
}
if(kit_temp === 'F2') {
document.getElementsByClassName("title")[0].textContent = "Football - Jerseys";
teams = Array()
teams.push("Real Madrid FC");
teams.push("Man. Utd. FC");
teams.push("Paris Saint Germain");
teams.push("France");
teams.push("Germany");
teams.push("Juventus FC");
descs = Array()
descs.push("For all those haters from FCB, we are 'The Club of the Century'. Hala Madrid!")
descs.push("There is a reason why we are known as 'The Red Devils'. Concilio Et Labore!")
descs.push("Seems everyone wants an attacking trio just like we have. Paris est Magique!")
descs.push("Isn't it simply great feeling to be a 'The World Champion'?. Allez les Bleus!")
descs.push("Our cannons will be attacking, when we have a wall defending us. #Zsmmm!!")
descs.push("It's rejoice and celebrate as the KING(GOAT) plays for us. Fino Alla Fine!")
prodesc = document.getElementsByClassName("product-desc")
for(let i=0; i<6; i++) {
prodesc[i].textContent = descs[i];
}
ProductCards = document.getElementsByClassName("product-name")
for(let i=0; i<6; i++) {
ProductCards[i].textContent = teams[i]
}
productImages = document.getElementsByClassName("img-fluid")
for(let i=0; i<6; i++) {
productImages[i].src = new_src+locs[i]+"1.png";
}
for(let i=0; i<6; i++) {
document.getElementsByClassName("btn-product-card-outline")[i].textContent = "AWAY";
}
}
}
function toggleButton(value) {
var kit_temp = sessionStorage.getItem("kit")
if(kit_temp === "F2") {
changeimg(parseInt(value)-1);
return;
}
var imgSrc = "Assets/cricket_jerseys/";
switch(value) {
case "1" :
var img = document.getElementsByClassName("img-fluid")[0];
if(img.src[img.src.length - 5] === "1")
img.src = imgSrc + "aus2.png";
else
img.src = imgSrc + "aus1.png";
break;
case "2" :
var img = document.getElementsByClassName("img-fluid")[1];
if(img.src[img.src.length - 5] === "1")
img.src = imgSrc + "eng2.png";
else
img.src = imgSrc + "eng1.png";
break;
case "3" :
var img = document.getElementsByClassName("img-fluid")[2];
if(img.src[img.src.length - 5] === "1")
img.src = imgSrc + "ind2.png";
else
img.src = imgSrc + "ind1.png";
break;
case "4" :
var img = document.getElementsByClassName("img-fluid")[3];
if(img.src[img.src.length - 5] === "1")
img.src = imgSrc + "nz2.png";
else
img.src = imgSrc + "nz1.png";
break;
case "5" :
var img = document.getElementsByClassName("img-fluid")[4];
if(img.src[img.src.length - 5] === "1")
img.src = imgSrc + "sa2.png";
else
img.src = imgSrc + "sa1.png";
break;
case "6" :
var img = document.getElementsByClassName("img-fluid")[5];
if(img.src[img.src.length - 5] === "1")
img.src = imgSrc + "wi2.png";
else
img.src = imgSrc + "wi1.png";
break;
}
var val = "1";
if(img.src[img.src.length - 5] === "2")
val = "2";
sessionStorage.setItem("toggle" , val)
}
function changeimg(i) {
swaps[i] = (swaps[i]+1)%3;
var imgtag = swaps[i]+1;
document.getElementsByClassName("img-fluid")[i].src = new_src+locs[i]+imgtag+".png";
new_toggle_names=["AWAY","THIRD","HOME"];
document.getElementsByClassName("btn-product-card-outline")[i].textContent = new_toggle_names[swaps[i]];
}
function loadCustomPage(value) {
kit_temp = sessionStorage.getItem("kit")
if(kit_temp === 'F1' && value =='1') {
sessionStorage.setItem("brand","adidas")
}
if(kit_temp === 'F1' && value =='2') {
sessionStorage.setItem("brand","adidas")
}
if(kit_temp === 'F1' && value =='3') {
sessionStorage.setItem("brand","nike")
}
if(kit_temp === 'F1' && value =='4') {
sessionStorage.setItem("brand","nike")
}
if(kit_temp === 'F1' && value =='5') {
sessionStorage.setItem("brand","puma")
}
if(kit_temp === 'F1' && value =='6') {
sessionStorage.setItem("brand","puma")
}
if(kit_temp === 'F2' && value =='1') {
sessionStorage.setItem("brand","adidas")
sessionStorage.setItem("swaps", swaps)
}
if(kit_temp === 'F2' && value =='2') {
sessionStorage.setItem("brand","adidas")
sessionStorage.setItem("swaps", swaps)
}
if(kit_temp === 'F2' && value =='3') {
sessionStorage.setItem("brand","nike")
sessionStorage.setItem("swaps", swaps)
}
if(kit_temp === 'F2' && value =='4') {
sessionStorage.setItem("brand","nike")
sessionStorage.setItem("swaps", swaps)
}
if(kit_temp === 'F2' && value =='5') {
sessionStorage.setItem("brand","adidas")
sessionStorage.setItem("swaps", swaps)
}
if(kit_temp === 'F2' && value =='6') {
sessionStorage.setItem("brand","adidas")
sessionStorage.setItem("swaps", swaps)
}
if(kit_temp === 'C1' && value == '1') {
sessionStorage.setItem("brand","1")
}
if(kit_temp === 'C1' && value == '2') {
sessionStorage.setItem("brand","2")
}
if(kit_temp === 'C1' && value == '3') {
sessionStorage.setItem("brand","3")
}
if(kit_temp === 'C2' && value == '1') {
sessionStorage.setItem("brand","1")
}
if(kit_temp === 'C2' && value == '2') {
sessionStorage.setItem("brand","2")
}
if(kit_temp === 'C2' && value == '3') {
sessionStorage.setItem("brand","3")
}
if(kit_temp === 'C2' && value == '4') {
sessionStorage.setItem("brand","4")
}
if(kit_temp === 'C2' && value == '5') {
sessionStorage.setItem("brand","5")
}
if(kit_temp === 'C2' && value == '6') {
sessionStorage.setItem("brand","6")
}
if(kit_temp === 'C3' && value == '1') {
sessionStorage.setItem("brand","1")
}
if(kit_temp === 'C3' && value == '2') {
sessionStorage.setItem("brand","2")
}
if(kit_temp === 'C3' && value == '3') {
sessionStorage.setItem("brand","3")
}
sessionStorage.setItem("product", value);
window.document.location.href = "./purchase.html";
}
function customPage() {
d = sessionStorage.getItem("dark")
if(d === '1') {
document.getElementsByClassName("x")[0].classList.add("body-dark")
kits = document.getElementsByClassName("purchase-card")
for(let i=0;i<kits.length;i++) {
kits[i].classList.add("purchase-card-dark");
}
bgs = document.getElementsByClassName("imgbackground")
for(let i=0;i<bgs.length;i++) {
bgs[i].classList.add("imgbackground-dark");
}
bgs = document.getElementsByClassName("imgbackground-sm")
for(let i=0;i<bgs.length;i++) {
bgs[i].classList.add("imgbackground-sm-dark");
}
document.getElementById("purchase-brand").classList.add("purchase-brand-dark");
} else {
document.getElementsByClassName("x")[0].classList.remove("body-dark")
kits = document.getElementsByClassName("purchase-card")
for(let i=0;i<kits.length;i++) {
kits[i].classList.remove("purchase-card-dark");
}
bgs = document.getElementsByClassName("imgbackground")
for(let i=0;i<bgs.length;i++) {
bgs[i].classList.remove("imgbackground-dark");
}
bgs = document.getElementsByClassName("imgbackground-sm")
for(let i=0;i<bgs.length;i++) {
bgs[i].classList.remove("imgbackground-sm-dark");
}
document.getElementById("purchase-brand").classList.remove("purchase-brand-dark");
}
var kit_temp = sessionStorage.getItem("kit");
var pro_temp = sessionStorage.getItem("product");
var brand = sessionStorage.getItem("brand")
pro_title=[]
if(kit_temp === 'F1') {
i = parseInt(pro_temp)-1
pro_title = ["Adidas X Ghosted","Adidas Predator 20.3","Nike Phantom","Nike Superfly 8 Elite","Puma Future Z","Puma Ultra"]
document.getElementById("purchase-title").textContent = pro_title[i]
descs = Array()
descs.push("Fast used to be fast enough. Gear up and ghost everyone.")
descs.push("It shows no mercy. It feels no pity. Mute your enemies.")
descs.push("Touch and Control. go on take our most innovative boot.")
descs.push("Reflection of power, speed and agility. Let's Superfly")
descs.push("inject a tounh of flair to our game. It IS revolutionary")
descs.push("Speed, Acceleration and Mystrey. Feel like a king with us.")
purdesc = document.getElementById("purchase-desc")
purdesc.textContent = descs[i];
purbrand = document.getElementById("purchase-brand")
purbrand.textContent = brand;
prices = ["4,999.00","6,599.00","9,995.00","21,995.00","9,599.00","15,999.00"]
purprice = document.getElementById("price-rupee")
purprice.textContent = prices[i];
loc_src = "Assets/football_boots/"
boot_locs = ["Adidas_Ghosted/","Adidas_Predator/","Nike_Phantom/","Nike_Superfly/","Puma_Future/","Puma_Ultra/"]
purimages = document.getElementsByClassName("img-fluid")
for(let j=0; j<5; j++) {
purimages[j].src = loc_src+boot_locs[i]+(j+1)+".png"
}
sizes = document.getElementsByClassName("color-circle")
for(let j=0; j<sizes.length; j++) {
sizes[j].textContent = (j+7)
}
} else if(kit_temp === 'F2') {
i = parseInt(pro_temp)-1
teams = Array()
teams.push("Real Madrid FC");
teams.push("Man. Utd. FC");
teams.push("Paris Saint Germain");
teams.push("France");
teams.push("Germany");
teams.push("Juventus FC");
document.getElementById("purchase-title").textContent = teams[i]
descs = Array()
descs.push("For all those haters from FCB, we are 'The Club of the Century'. Hala Madrid!")
descs.push("There is a reason why we are known as 'The Red Devils'. Concilio Et Labore!")
descs.push("Seems everyone wants an attacking trio just like we have. Paris est Magique!")
descs.push("Isn't it simply great feeling to be a 'The World Champion'?. Allez les Bleus!")
descs.push("Our cannons will be attacking, when we have a wall defending us. #Zsmmm!!")
descs.push("It's rejoice and celebrate as the KING(GOAT) plays for us. Fino Alla Fine!")
purdesc = document.getElementById("purchase-desc")
purdesc.textContent = descs[i];
purbrand = document.getElementById("purchase-brand")
purbrand.textContent = brand;
prices = ["5,499.00","4,999.00","4,699.00","4,499.00","4,499.00","4,999.00"]
purprice = document.getElementById("price-rupee")
purprice.textContent = prices[i];
loc_src = new_src
boot_locs = locs
addup = sessionStorage.getItem("swaps")
purimages = document.getElementsByClassName("img-fluid")
piccontainer = document.getElementsByClassName("img-container-width-sm")
piccontainer[0].classList.add("d-none")
piccontainer = document.getElementsByClassName("hor-img")
piccontainer[0].classList.add("d-none")
purimages[0].src = loc_src+boot_locs[i]+(1+parseInt(addup[2*i]))+".png"
console.log(addup)
} else if(kit_temp === 'C1') {
purimages = document.getElementsByClassName("img-fluid")
piccontainer = document.getElementsByClassName("img-container-width-sm")
piccontainer[0].classList.add("d-none")
piccontainer = document.getElementsByClassName("hor-img")
piccontainer[0].classList.add("d-none")
var imgSrc = "Assets/cricket_gloves/gloves";
purimages[0].src = imgSrc + brand + "1" + ".png";
purprice = document.getElementById("price-rupee")
var price = "2999.99";
if(brand === "1") price = "3999.99";
else if(brand === "2") price = "5999.99";
purprice.textContent = price;
purbrand = document.getElementById("purchase-brand")
purbrand.textContent = "kookaburra";
var title = "Kauna 2.1";
if(brand === "2") title = "Beast Pro";
else if(brand === "3") title = "Pace 2.4";
document.getElementById("purchase-title").textContent = title
var desc = "The safest pair of gloves with stunning green look!";
if(brand === "2")
desc = "Turn on 'THE BEAST MODE' before the start of play."
else if(brand === "3")
desc = "Comfort, Stylish, and Safety is what 'Pace 2.4' provides you!"
purdesc = document.getElementById("purchase-desc")
purdesc.textContent = desc;
} else if(kit_temp === 'C2') {
purimages = document.getElementsByClassName("img-fluid")
piccontainer = document.getElementsByClassName("img-container-width-sm")
piccontainer[0].classList.add("d-none")
piccontainer = document.getElementsByClassName("hor-img")
piccontainer[0].classList.add("d-none")
var toggle = sessionStorage.getItem("toggle");
var imgSrc = "Assets/cricket_jerseys/";
if(brand === "1") imgSrc += "aus";
else if(brand === "2") imgSrc += "eng";
else if(brand === "3") imgSrc += "ind";
else if(brand === "4") imgSrc += "nz";
else if(brand === "5") imgSrc += "sa";
else if(brand === "6") imgSrc += "wi";
purimages[0].src = imgSrc + toggle + ".png";
purprice = document.getElementById("price-rupee")
purprice.textContent = "1999.00";
purbrand = document.getElementById("purchase-brand")
var team = "ca";
var title = "Australia";
var desc = "Get on with the Aussies jersey and shout out - 'SAY NO TO DIE'!";
if(brand === "2") {
team = "ecb";
title = "England";
desc = "The cup has come home after a very long time, let's celebrate it.";
} else if(brand === "3") {
team = "bcci";
title = "India";
desc = "Support the Men in Blue, who cares if they wear whites against The Kiwis.";
} else if(brand === "4") {
team = "nzc";
title = "New Zealand";
desc = "Love the 'Sport', Love the 'Country', and Love 'The Kiwis Kindness'!";
} else if(brand === "5") {
team = "csa";
title = "South Africa";
desc = "We are 'The Most Unluckiest', do support us with our awesome jerseys.";
} else if(brand === "6") {
team = "wicb";
title = "West Indies";
desc = "We once ruled this arena, just for wait 'THE GREATEST COMEBACK'!";
}
purbrand.textContent = team;
document.getElementById("purchase-title").textContent = title
purdesc = document.getElementById("purchase-desc")
purdesc.textContent = desc;
} else if(kit_temp === 'C3') {
purimages = document.getElementsByClassName("img-fluid")
piccontainer = document.getElementsByClassName("img-container-width-sm")
piccontainer[0].classList.add("d-none")
piccontainer = document.getElementsByClassName("hor-img")
piccontainer[0].classList.add("d-none")
var imgSrc = "Assets/cricket_bats/bat";
purimages[0].src = imgSrc + brand + ".png";
purprice = document.getElementById("price-rupee")
var price = "4999.99";
if(brand === "1") price = "7999.99";
else if(brand === "2") price = "11999.99";
purprice.textContent = price;
purbrand = document.getElementById("purchase-brand")
purbrand.textContent = "kookaburra";
var title = "Kauna 2.0";
if(brand === "2") title = "Beast 1.0";
else if(brand === "3") title = "Pace Pro";
document.getElementById("purchase-title").textContent = title
var desc = "Bring on the 'classy' cover drives and on drives.";
if(brand === "2")
desc = "Can someone see the ball? Please don't hurt it too much!"
else if(brand === "3")
desc = "Elegancy and Timing is the best way of playing it!"
purdesc = document.getElementById("purchase-desc")
purdesc.textContent = desc;
sizes = document.getElementsByClassName("color-circle")
for(let j=0; j<sizes.length; j++) {
sizes[j].textContent = (j+7)
}
}
}
function imgswap(value) {
var temp = document.getElementsByClassName("img-fluid")[0].src
document.getElementsByClassName("img-fluid")[0].src = document.getElementsByClassName("img-fluid")[value].src
document.getElementsByClassName("img-fluid")[value].src = temp
}
function choose_size(value) {
circles = document.getElementsByClassName("color-circle")
for(let i=0; i<4; i++) {
if(value === i){
if(!circles[i].classList.contains("btn-product-card")) {
circles[i].classList.remove("btn-product-card-outline")
circles[i].classList.add("btn-product-card")
}
} else {
if(!circles[i].classList.contains("btn-product-card-outline")) {
circles[i].classList.remove("btn-product-card")
circles[i].classList.add("btn-product-card-outline")
}
}
}
}
function choose_star(value) {
stars = document.getElementsByClassName("fa-star")
for(let i=0; i<value; i++) {
if(!stars[i].classList.contains("fas")) {
stars[i].classList.remove("far")
stars[i].classList.add("fas")
}
}
for(let i=value; i<5; i++) {
if(!stars[i].classList.contains("far")) {
stars[i].classList.add("far")
stars[i].classList.remove("fas")
}
}
}
function changeHeart(value) {
if(!document.getElementsByClassName("fa-heart")[value].classList.contains("fas")) {
document.getElementsByClassName("fa-heart")[value].classList.remove("far")
document.getElementsByClassName("fa-heart")[value].classList.add("fas")
} else {
document.getElementsByClassName("fa-heart")[value].classList.add("far")
document.getElementsByClassName("fa-heart")[value].classList.remove("fas")
}
}
var dark = sessionStorage.getItem("dark");
if(dark != null) {
if(dark === "1") {
document.getElementsByClassName("form-check-input")[0].checked = true;
applyLandingDarkMode();
} else {
document.querySelector("body").classList.remove("body-dark");
removeLandingDarkMode();
}
}
var switchButton = document.getElementsByClassName("form-check-input")[0];
switchButton.addEventListener("click" , function(event) {
if(event.target.checked === true) {
applyLandingDarkMode();
sessionStorage.setItem("dark" , "1");
} else {
removeLandingDarkMode();
sessionStorage.setItem("dark" , "0");
}
});
function applyLandingDarkMode() {
document.querySelector("body").classList.add("body-dark");
document.querySelector(".bg-landing").classList.add("landing-page-dark")
var card = document.getElementsByClassName("sport-card");
for(var i = 0; i < card.length; i++) {
card[i].classList.add("sport-card-dark");
}
var introCard = document.getElementsByClassName("sport-intro-card");
for(var i = 0; i < introCard.length; i++) {
introCard[i].classList.add("sport-intro-card-dark");
}
}
function removeLandingDarkMode() {
document.querySelector("body").classList.remove("body-dark");
document.querySelector(".bg-landing").classList.remove("landing-page-dark")
var card = document.getElementsByClassName("sport-card");
for(var i = 0; i < card.length; i++) {
card[i].classList.remove("sport-card-dark");
}
var introCard = document.getElementsByClassName("sport-intro-card");
for(var i = 0; i < introCard.length; i++) {
introCard[i].classList.remove("sport-intro-card-dark");
}
}