-
Notifications
You must be signed in to change notification settings - Fork 2
/
jeansclick.html
334 lines (249 loc) · 9.16 KB
/
jeansclick.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
<!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>Women Jeans</title>
<script
src="https://kit.fontawesome.com/24c494a6b6.js"
crossorigin="anonymous"
></script>
<style>
#mainBox{
/* border: 1px solid black; */
width: 75%;
/* margin: auto; */
/* height: 600px; */
display: grid;
grid-template-columns: repeat(2,1fr);
grid-template-rows: auto;
gap: 20px;
margin-top: 100px;
margin-left: 250px;
}
#imageBox{
/* height:auto; */
width: 80%;
/* border: 1px solid red; */
margin-left: 100px;
}
#imageBox:hover{
cursor: lens;
}
#sideBox{
/* border: 1px solid red; */
width: 75%;
/* height: 700px; */
}
#ratingStar{
margin-left: 130px;
margin-top: -40px;
/* border: 1px solid red; */
}
#sathmai{
display: flex;
margin-top: -25px;
/* border: 1px solid red; */
}
#change{
margin-left: 10px;
text-decoration: line-through;
font-size: 25px;
color: gray;
}
#badlav{
font-size: 25px;
font-weight: 700;
}
#red{
color: red;
font-size: 20px;
padding-top: 8px;
margin-left: 6px;
}
#inclus{
color: gray;
font-size: 12px;
margin-top: -20px;
}
#align{
display: flex;
}
#quantity{
color: gray;
}
#inputSize{
padding: 0px 30px;
margin-left: 10px;
border: 1px solid gray;
}
#bag{
margin-top: 30px;
width: 80%;
/* margin: auto; */
padding: 10px 0px;
margin-left: 40px;
font-size: 20px;
background-color: teal;
color: white;
border: none;
margin-bottom: 15px;
}
#unorder{
color: gray;
padding-top: 15px;
}
#sign{
display: flex;
justify-content: space-between
}
#sign2{
display: flex;
justify-content: space-between
}
</style>
</head>
<body>
<div id="mainBox">
<div id="imageBox"></div>
<div id="sideBox">
</div>
</div>
</body>
</html>
<script>
var data =JSON.parse(localStorage.getItem("clickData")) || []
var userData=JSON.parse(localStorage.getItem("bagData")) || []
data.map(function(el){
document.querySelector("#imageBox")
var image = document.createElement("img")
image.src=el.image
image.style="width:100%"
imageBox.append(image)
document.querySelector("#sideBox")
var h2=document.createElement("h3")
h2.innerText="BEWAKOOF"
var para = document.createElement("p")
para.innerText=el.name
para.style="color:gray"
var star = document.createElement("div")
star.setAttribute("id","star")
var starImage = document.createElement('img')
starImage.src="https://images.bewakoof.com/web/fill-1-2x-1622112875.webp"
var starImage2 = document.createElement('img')
starImage2.src="https://images.bewakoof.com/web/fill-1-2x-1622112875.webp"
var starImage3 = document.createElement('img')
starImage3.src="https://images.bewakoof.com/web/fill-1-2x-1622112875.webp"
var starImage4 = document.createElement('img')
starImage4.src="https://images.bewakoof.com/web/fill-1-2x-1622112875.webp"
var starImage5 = document.createElement('img')
starImage5.src="https://images.bewakoof.com/web/fill-1-2x-1622112875.webp"
star.append(starImage,starImage2,starImage3,starImage4,starImage5)
var ratingBox= document.createElement("div")
ratingBox.setAttribute("id","ratingStar")
var rating = document.createElement("h3")
rating.innerText="5.0/5 (Based on 15 Ratings)"
ratingBox.append(rating)
var div = document.createElement("div")
div.setAttribute("id","sathmai")
var span=document.createElement("p")
span.innerText=el.price;
span.setAttribute("id","badlav")
var spantwo=document.createElement("p")
spantwo.innerText=el.hprice;
spantwo.setAttribute("id","change")
var spanthree = document.createElement("p")
spanthree.innerText="(50% OFF)"
spanthree.setAttribute("id","red")
div.append(span,spantwo,spanthree)
var inclusive = document.createElement("p")
inclusive .innerText="Inclusives Of Taxes"
inclusive.setAttribute("id","inclus")
var line = document.createElement("hr")
var paragr = document.createElement("p")
paragr.innerText="Tribe member get an extra discount of ₹20 and FREE shipping .Learn"
var smallLine = document.createElement("p")
smallLine.innerText="More"
var selectBox=document.createElement("div")
selectBox.setAttribute("id","align")
var qty = document.createElement("p")
qty.innerText="QTY :"
qty.setAttribute("id","quantity")
var input=document.createElement("select")
input.setAttribute("id","inputSize")
var option2 = document.createElement("option")
option2.innerText=1
var option3= document.createElement("option")
option3.innerText=2
var option4 = document.createElement("option")
option4.innerText=3
var option5 = document.createElement("option")
option5.innerText=4
var option6 = document.createElement("option")
option6.innerText=5
var option7 = document.createElement("option")
option7.innerText=6
var option8 = document.createElement("option")
option8.innerText=7
var option9 = document.createElement("option")
option9.innerText=8
var option10 = document.createElement("option")
option10.innerText=9
var option11 = document.createElement("option")
option11.innerText=10
input.append(option2,option3,option4,option4,option5,option6,option7,option8,option9,option10,option11)
selectBox.append(qty,input)
var bag = document.createElement("button")
bag.innerText="ADD TO BAG"
bag.setAttribute("id","bag")
bag.addEventListener("click",function(){
clickFun(el)
window.location.href="cart.html"
})
var lineThir = document.createElement("hr")
var unorder = document.createElement("ul")
unorder.setAttribute("id","unorder")
var list1 = document.createElement("li")
list1.innerText="Impact resistant hard plastic case"
list1.style="padding-bottom:15px;font-size:18px"
var list2 = document.createElement("li")
list2.innerText="Matte finish high definition printing"
list2.style="padding-bottom:15px;font-size:18px"
var list3 = document.createElement("li")
list3.innerText="Easy access to standard buttons and ports"
list3.style="padding-bottom:15px;font-size:18px"
var list4 = document.createElement("li")
list4.innerText="Sleek profile"
list4.style="padding-bottom:15px;font-size:18px"
unorder.append(list1,list2,list3,list4)
var lineFour = document.createElement("hr")
var lineSec = document.createElement("hr")
var plusDiv=document.createElement("div")
plusDiv.setAttribute("id","sign")
var likhna = document.createElement("h3")
likhna.innerText="SAVE EXTRA WITH 4 OFFERS"
var plus = document.createElement("h2")
plus.innerText="+"
plus.setAttribute("id","plus")
plus.style="font-weight:bold;font-size:25px"
plusDiv.append(likhna,plus)
var lineSev = document.createElement("hr")
var plusDiv2=document.createElement("div")
plusDiv2.setAttribute("id","sign2")
var likhna2 = document.createElement("h3")
likhna2.innerText="PRODUCT DESCRIPTION"
var plus2 = document.createElement("h2")
plus2.innerText="+"
plus2.setAttribute("id","plus")
plus2.style="font-weight:bold;font-size:25px"
plusDiv2.append(likhna2,plus2)
sideBox.append(h2,para,star,ratingBox,div,inclusive,line,paragr,smallLine,lineSec,selectBox,bag,lineThir,unorder,lineFour,plusDiv,lineSev,plusDiv2)
document.querySelector("#mainBox")
})
function clickFun(el){
userData.push(el)
localStorage.setItem("bagData",JSON.stringify(userData))
window.location.href="cart.html"
}
</script>