-
Notifications
You must be signed in to change notification settings - Fork 5
/
bag.html
514 lines (504 loc) · 14.2 KB
/
bag.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
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
<!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>BAG</title>
<style>
* {
margin: 0px;
}
body{
font-family: Whitney,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
font-size: 13px;
}
#upar {
width: 100%;
height: 70px;
box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px,
rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
display: flex;
}
#logo {
height: 60%;
display: flex;
margin-top: 10px;
margin-left: 20px;
}
.checkout {
display: flex;
gap: 20px;
list-style-type: none;
align-items: center;
margin-left: 26%;
}
#safe {
display: flex;
justify-content: right;
margin-left: 300px;
align-items: center;
}
#safe > img {
height: 60%;
}
#contain {
width: 90%;
display: flex;
margin: auto;
/* border: 1px solid; */
/* height:600px; */
}
#boxes {
width: 45%;
height: 100%;
margin: auto;
/* border: 1px solid; */
}
#boxes1 {
height: 50px;
margin-top: 20px;
/* border: 1px solid; */
box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px,
rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
display: flex;
}
#boxes1 > p {
display: flex;
align-items: center;
margin-left: 20px;
}
#boxes1 > button {
height: 70%;
display: block;
margin: auto;
background-color: white;
color: red;
border: 1px solid;
cursor: pointer;
margin-right: 15px;
}
#boxes2 {
margin-top: 10px;
/* border: 1px solid; */
box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px,
rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
}
#boxes2 > h3 {
margin-left: 20px;
color: teal;
}
#text {
font-size: 14px;
color: grey;
list-style-type: circle;
}
#textButton {
color: red;
background-color: white;
border: 0px;
margin-left: 20px;
cursor: pointer;
}
#dili {
margin-top: 10px;
height: 30px;
/* border:1px solid; */
box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px,
rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
display: flex;
}
#dili > img {
height: 90%;
margin-left: 20px;
}
#dili > p {
display: flex;
text-align: center;
align-items: center;
font-size: 13px;
margin-left: 10px;
color: teal;
}
#pricebox {
display: flex;
gap: 10px;
}
/* #boxe{
display:flex;
margin-left:5px;
border:1px solid;
} */
#products {
display: grid;
grid-template-columns: 1fr;
gap: 10px;
margin-top: 30px;
}
#pic {
height: 200px;
width: 100%;
}
#line {
color: grey;
text-decoration: line-through;
}
#line + p {
color: red;
}
#saman > div + div {
justify-content: center;
margin: auto;
}
#saman > div {
margin: auto;
}
#saman {
height: auto;
gap: 10px;
margin-top: 10px;
box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px,
rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
}
#moreText > li {
margin-bottom: 15px;
}
#pricedetail {
margin-top: 10px;
margin-left: 20px;
color: grey;
width: 50%;
/* box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px; */
}
#pricedetail > h3 {
margin-left: 10px;
}
#pricedetail > div {
display: flex;
margin-top: 15px;
margin-left: 10px;
margin-right: 10px;
justify-content: space-between;
/* width: 40%; */
}
#pricedetail > div > p + p {
color: red;
}
#order {
display: flex;
justify-content: space-between;
width: 48%;
margin-top: 25px;
/* box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px; */
margin-left: 23px;
padding: 5px;
}
#order > p + p {
color: blue;
}
#free {
display: flex;
gap: 5px;
}
#karoo {
text-decoration: line-through;
color: black;
}
#karoo + p {
color: rgb(9, 213, 9);
}
#button {
width: 45%;
margin-top: 20px;
margin-left: 40px;
padding: 5px;
background-color: red;
color: white;
border: 0px;
font-size: 17px;
cursor: pointer;
}
#click {
margin-top: 30px;
cursor: pointer;
}
</style>
</head>
<body>
<div id="upar">
<a href="index.html"><img
id="logo"
src="https://upload.wikimedia.org/wikipedia/commons/d/d5/Myntra_logo.png"
alt="pic"
/></a>
<ol class="checkout">
<li class="step1 active" style="color: teal;">BAG</li>
<li class="divider">---------</li>
<li class="step2">ADDRESS</li>
<li class="divider">---------</li>
<li class="step step3">PAYMENT</li>
</ol>
<div id="safe">
<img
src="https://constant.myntassets.com/checkout/assets/img/sprite-secure.png"
alt="pics"
/>
<p>100% Secure</p>
</div>
</div>
<div id="contain">
<div id="boxes">
<div id="boxes1">
<p>Check delievery time and services</p>
<button>Enter Pincode</button>
</div>
<div id="boxes2">
<h3>Available offers</h3>
<ul id="text">
<li>
10% instant discount on IDFC first Bank Cards on a minimum spend
of rup 2,500.TCA
</li>
<span id="points">........</span>
<span id="moreText">
<li>
10% cashback upto Rs 100 on Paytm pospaid transcation on a min
spend of Rs 1000 .TCA
</li>
<li>
5% unlimited cashback on Flipkart Axis bank Credit card .TCA
</li>
<li>
15% cashback upto Rs 150 on FreeCharge Paylater Transaction .TCA
</li>
<li>
10% Cashback upto Rs 200 on OLA money postpaid or wallet
transaction on a min spend of Rs 1000 .TCA
</li>
<li>
Upto Rs 500 cashback on mobikwick wallet transcation on a min
spend of Rs.999 use code ullukapatha on Mobikwick.TCA
</li>
<li>
5% Cashback upto Rs 150 on a minnium spend of Rs 1500 with
payzap.TCA
</li>
</span>
</ul>
<button onclick="toggleText()" id="textButton">show more</button>
</div>
<div id="dili">
<img
src="https://constant.myntassets.com/checkout/assets/img/ship-free.webp"
alt="dil"
/>
<p>Yay! no convience free on this order</p>
</div>
<div id="products">
<div id="boxe"></div>
</div>
</div>
<div>
<div id="rightpart">
<img
src="https://assets.myntassets.com/f_webp,dpr_1.5,q_60,w_400,c_limit,fl_progressive/assets/images/2022/1/14/d63fc446-4087-4e07-b2dd-1d060368d2661642184399341-Banner_Login-page-400.png"
/>
</div>
<div id="pricedetail">
<h3>PRICE DETAILS</h3>
<div>
<p>Total MRP</p>
<p id="total">$0</p>
</div>
<div>
<p>Discount MRP</p>
<p id="karo">$0</p>
</div>
<div>
<p>Coupon Discount</p>
<p>Apply Coupon</p>
</div>
<div>
<p>Convinience Free</p>
<div id="free">
<p id="karoo">$11</p>
<p>Free</p>
</div>
</div>
</div>
<div>
<div id="order">
<p>Total Amount</p>
<p id="end">$0</p>
</div>
<div>
<button id="button">Place Order</button>
</div>
</div>
</div>
</div>
</body>
</html>
<script>
function toggleText() {
var points = document.getElementById("points");
var showmoretext = document.getElementById("moreText");
var buttontext = document.getElementById("textButton");
if (points.style.display === "none") {
showmoretext.style.display = "none";
points.style.display = "inline";
buttontext.innerHTML = "show more";
} else {
showmoretext.style.display = "inline";
points.style.display = "none";
buttontext.innerHTML = "show less";
}
}
// var mensData = [
// {
// image_url:
// "https://content.shop4reebok.com/static/Product-EX4296/reebok_EX4296_1.jpg.plp",
// name: "MEN'S REEBOK RUNNING ROADMAP SHOES",
// price: "1170",
// strikedoffprice: 2599,
// },
// {
// image_url:
// "https://content.shop4reebok.com/static/Product-EX3921/reebok_EX3921_1.jpg.plp",
// name: "MEN'S REEBOK SWIM ARUBA FLIP SLIPPERS ",
// price: 699,
// strikedoffprice: 999,
// },
// {
// image_url:
// "https://content.shop4reebok.com/static/Product-EX4160/reebok_EX4160_1.jpg.plp",
// name: " MEN'S REEBOK RUNNING AUSTIN SHOES",
// price: 945,
// strikedoffprice: 2099,
// },
// {
// image_url:
// "https://content.shop4reebok.com/static/Product-GL2296/reebok_GL2296_1.jpg.plp",
// name: "WOMEN'S REEBOK PRINT LEGGINGS ",
// price: 1549,
// strikedoffprice: 1799,
// },
// {
// image_url:
// "https://content.shop4reebok.com/static/Product-GT2338/reebok_GT2338_1.jpg.plp",
// name: "WOMEN'S REEBOK SLEEVE TEE",
// price: 699,
// strikedoffprice: 1245,
// },
// {
// image_url:
// "https://content.shop4reebok.com/static/Product-GL2841/adidas_GL2841_1.jpg.plp",
// name: "WOMEN'S REEBOK PP TIGHTS",
// price: 749,
// strikedoffprice: 1299,
// },
// {
// image_url:
// "https://content.shop4reebok.com/static/Product-GL2842/adidas_GL2842_1.jpg.plp",
// name: "WOMEN'S REEBOK PP TIGHTS",
// price: 749,
// strikedoffprice: 1299,
// },
// {
// image_url:
// "https://content.shop4reebok.com/static/Product-GK6777/reebok_GK6777_1.jpg.plp",
// name: "WOMEN'S REEBOK CLASSIC LEGGINGS",
// price: 1399,
// strikedoffprice: 2799,
// },
// ];
var sum = 0;
var sum1 = 0;
var sum2 = 0;
// localStorage.setItem("mens", JSON.stringify(mensData));
var contain = JSON.parse(localStorage.getItem("bag_arr"));
// document.querySelector("#total").innerText=sum;
contain.forEach(function (elem, index) {
var baxes = document.createElement("div");
baxes.setAttribute("id", "saman");
baxes.style.display = "flex";
var bax = document.createElement("div");
var image = document.createElement("img");
image.setAttribute("src", elem.image_url);
image.setAttribute("id", "pic");
bax.append(image);
var bax2 = document.createElement("div");
var productname = document.createElement("h3");
productname.innerText = elem.name;
var pricebox = document.createElement("div");
pricebox.setAttribute("id", "pricebox");
var price = document.createElement("p");
price.innerText = elem.price;
var offer = document.createElement("p");
offer.setAttribute("id", "line");
offer.innerText = elem.pprice;
sum = sum + Number(elem.pprice);
sum1 = sum1 + Number(elem.price);
// document.querySelector("#total").innerText=sum;
var off = document.createElement("p");
off.innerText = elem.off;
var ik = document.createElement("p");
ik.innerText = "Brand :" + elem.brand;
ik.style.color = "grey";
ik.style.fontSize = "13px";
ik.style.marginBottom = "10px";
pricebox.append(price, offer, off);
var butt = document.createElement("button");
butt.innerText = "Remove";
butt.style.color = "blue";
butt.setAttribute("id", "click");
butt.style.borderColor = "blue";
butt.style.border = "1px solid";
butt.style.marginLeft = "50px";
butt.addEventListener("click", function () {
kuj(elem, index);
// contain.parentElement.remove();
});
var sele = document.createElement("select");
var sele1 = document.createElement("option");
sele1.innerText = 1;
var sele2 = document.createElement("option");
sele2.innerText = 2;
var sele3 = document.createElement("option");
sele3.innerText = 3;
var sele4 = document.createElement("option");
sele4.innerText = 4;
sele.append(sele1, sele2, sele3, sele4);
sele.style.borderColor = "teal";
sele.style.border = "2px solid";
sele.style.borderColor = "teal";
sele.style.borderRadius = "5px";
sum = sum * Number(sele.value);
bax2.append(productname, ik, pricebox, sele, butt);
// sum=sum*sele.value
baxes.append(bax, bax2);
document.querySelector("#boxe").append(baxes);
});
sum2 = sum - sum1;
document.querySelector("#total").innerText = sum;
document.querySelector("#karo").innerText = "-" + sum2;
var sum4 = 0;
sum4 = sum - sum2;
document.querySelector("#end").innerText = sum4;
function kuj(elem, index) {
contain.splice(index, 1);
localStorage.setItem("bag_arr", JSON.stringify(contain));
window.location.reload();
}
let price_obj = {}
price_obj.mrp = sum
price_obj.discount = sum2
price_obj.total = sum4
localStorage.setItem("price_obj", JSON.stringify(price_obj))
let button = document.querySelector("#button")
button.addEventListener("click", gotoadd)
function gotoadd() {
event.preventDefault()
window.location.href="address.html"
}
</script>