-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmensskincare.html
360 lines (332 loc) · 12.1 KB
/
mensskincare.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
<!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>Men's Skincare</title>
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="./styles/mensskincare.css" />
<link rel="stylesheet" href="./styles/header.css" />
<link rel="stylesheet" href="./styles/footer.css" />
<link
rel="shortcut icon"
type="image/jpg"
href="https://media.glassdoor.com/sqll/2397264/strawberrynet-squarelogo-1561462036150.png"
/>
<style>
#mensskincare {
background-color: white;
color: #623381;
font-weight: bold;
}
</style>
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"
></script>
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
</head>
<script
src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
crossorigin="anonymous"
></script>
<body>
<div id="header"></div>
<div id="navbaroptions" class="bg"></div>
<!-- searching start here -->
<div id="newresults"></div>
<!-- searching end here -->
<div class="container" id="maincont">
<div id="left">
<div id="line">
<h6>Men's Skincare</h6>
<h2>S K I N C A R E</h2>
</div>
<h4>Refine by Brands</h4>
<div id="brands">
<div>
<input type="checkbox" id="mercari" /><label for=""
>111Skin (37)</label
>
</div>
<div><input type="checkbox" /><label for="">3LAB (6)</label></div>
<div>
<input type="checkbox" /><label for="">3W Clinic (68)</label>
</div>
<div>
<input type="checkbox" /><label for="">Academie (64)</label>
</div>
<div><input type="checkbox" /><label for="">Aesop (47)</label></div>
<div>
<input type="checkbox" /><label for="">Algenist (22)</label>
</div>
<div><input type="checkbox" /><label for="">ASHIYA (4)</label></div>
<div>
<input type="checkbox" /><label for="">Bellapierre s (2)</label>
</div>
<div>
<input type="checkbox" /><label for="">Cellex-C (44)</label>
</div>
<div><input type="checkbox" /><label for="">Decleor (55)</label></div>
<div>
<input type="checkbox" /><label for="">Clinique (193)</label>
</div>
<div>
<input type="checkbox" /><label for="">Erno Laszlo (43)</label>
</div>
<div>
<input type="checkbox" /><label for="">First Aid (1)</label>
</div>
<div><input type="checkbox" /><label for="">Guinot (99)</label></div>
<div>
<input type="checkbox" /><label for="">Rubinstein (32)</label>
</div>
<div><input type="checkbox" /><label for="">Kiehl's (58)</label></div>
<div><input type="checkbox" /><label for="">MAC (1)</label></div>
</div>
<div id="newarrivals">
<h3>Men's Skincare</h3>
<p>Skincare(10)</p>
<p>Make UP(5)</p>
<p>Hair Care(4)</p>
<p>Men's Cologne(6)</p>
<p>Women's Perfume(5)</p>
</div>
<div id="brands">
<div><input type="checkbox" /><label for="">Decleor (55)</label></div>
<div>
<input type="checkbox" /><label for="">Clinique (193)</label>
</div>
<div>
<input type="checkbox" /><label for="">Erno Laszlo (43)</label>
</div>
<div>
<input type="checkbox" /><label for="">First Aid (1)</label>
</div>
<div><input type="checkbox" /><label for="">Guinot (99)</label></div>
<div>
<input type="checkbox" /><label for="">Rubinstein (32)</label>
</div>
<div><input type="checkbox" /><label for="">Kiehl's (58)</label></div>
<div><input type="checkbox" /><label for="">MAC (1)</label></div>
<div>
<input type="checkbox" id="mercari" /><label for=""
>111Skin (37)</label
>
</div>
<div><input type="checkbox" /><label for="">3LAB (6)</label></div>
<div>
<input type="checkbox" /><label for="">3W Clinic (68)</label>
</div>
<div>
<input type="checkbox" /><label for="">Academie (64)</label>
</div>
<div><input type="checkbox" /><label for="">Aesop (47)</label></div>
<div>
<input type="checkbox" /><label for="">Algenist (22)</label>
</div>
</div>
</div>
<div id="right">
<div id="first">
<img
src="https://a.cdnsbn.com/images/English/category_EarlyBirdSale8offNov21_692_1.jpg"
alt=""
/>
</div>
<div id="topbrands">
<h4>TOP SKIN CARE BRANDS</h4>
<div>
<h6>BAREMINERALS</h6>
<h6>CHRISTIAN DIOR</h6>
<h6>CLINIQUE</h6>
<h6>ESTEE LAUDER</h6>
<h6>GIORGIO ARMANI</h6>
<h6>GIVENCHY</h6>
<h6>GUERLAIN</h6>
<h6>JANE IREDALE</h6>
<h6>LANCOME</h6>
<h6>LAURA MERCIER</h6>
<h6>NARS</h6>
<h6>YVES SAINT LAURENT</h6>
</div>
<div id="btn">
<button>View All Skin Care Brands ></button>
</div>
</div>
<div id="prodhead">
<div>11996 results for u</div>
<div id="prodbtn">
<h6>Worldwide RRP converted to INR.</h6>
<h5>View</h5>
<img
id="list"
src="https://www.logolynx.com/images/logolynx/00/00b9c1e4e9ef5c58b11ddecb020b8776.png"
/>
<img
id="grid"
src="https://static.thenounproject.com/png/246685-200.png"
/>
<select id="select" onchange="getchange()">
<option value="sortbypop">SORT BY POPULARITY</option>
<option value="lowpri">LOWEST PRICE</option>
<option value="AtoZ">BRAND A-Z</option>
<option value="ZtoA">HIGHEST PRIZE</option>
</select>
</div>
<h5>Men's Skincare</h5>
</div>
<div id="products"></div>
</div>
</div>
<div id="imge"></div>
<!-- FOOTER JS END -->
<div id="footerEndPush"></div>
<!-- FOOTER JS END -->
<script
type="module"
src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"
></script>
<script
nomodule
src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"
></script>
</body>
</html>
<script src="./js elements/mensskincare.js"></script>
<script type="module">
import { headerupper, navbarbelow } from "./js elements/header.js";
let head = document.getElementById("header");
head.innerHTML = headerupper();
let navbaroptions = document.getElementById("navbaroptions");
navbaroptions.innerHTML = navbarbelow();
// END FOOTER JS PART
var searchdata = document.getElementById("inputdata");
let dbs = document.getElementById("searchableData");
dbs.addEventListener("click", fetchData);
async function fetchData() {
let itemneedned = searchdata.value;
let res = await fetch(
`https://serpapi.com/search.json?engine=google&q=${itemneedned}&google_domain=google.com&gl=us&hl=en&tbm=shop&start=8&num=8&api_key=a97958c2af388fd67fa25a5ffff96640f9c08804383e96d7a5048e372e559f73`
);
let data = await res.json();
console.log(data);
let showdatainpage = document.getElementById("newresults");
let items = data.shopping_results;
showdatainpage.style.display = "grid";
showdatainpage.style.gridTemplateColumns = "auto auto auto auto";
showdatainpage.style.gap = "2%";
showdatainpage.style.marginLeft = "2%";
items.forEach((d) => {
let div = document.createElement("div");
div.style.width = "250px";
let img = document.createElement("img");
img.src = d.thumbnail;
img.style.width = "200px";
img.style.marginLeft = "25px";
img.style.height = "250px";
let name = document.createElement("p");
name.style.color = "blue";
name.style.marginLeft = "3%";
name.innerText = d.title;
let price = document.createElement("p");
price.innerText = d.price;
let addtocartbtn = document.createElement("button");
addtocartbtn.innerText = "Add to cart";
addtocartbtn.backgroundColor = "white";
addtocartbtn.style.marginLeft = "3%";
div.append(img, name, price, addtocartbtn);
showdatainpage.append(div);
});
}
// --------------------------------drop down effect for search tab-----------------------------
let onlineSearch = document.getElementById("onlineSearch");
// onlineSearch.addEventListener("click");
let searchinpdata = document.getElementById("inputdata");
var sets;
searchinpdata.addEventListener("input", startsearchingfordata);
function startsearchingfordata(e) {
onlineSearch.textContent = e.target.value;
var inpt = searchinpdata.value;
debounce(startshowofsug, 3000);
function debounce(startshowofsug, time) {
if (sets) {
clearTimeout(sets);
}
sets = setTimeout(() => {
startshowofsug(inpt);
}, time);
}
if (inpt != " ") {
let searchR = document.getElementById("onlineSearch");
searchR.style.display = "block";
searchR.style.backgroundColor = "white";
let out = searchinpdata.value;
console.log(out);
}
if (inpt == "") {
let searchR = document.getElementById("onlineSearch");
searchR.style.display = "none";
let showdatainpage = document.getElementById("newresults");
showdatainpage.innerHTML = null;
}
}
async function startshowofsug(data) {
onlineSearch.textContent = null;
let res = await fetch(
`https://serpapi.com/search.json?engine=google&q=${data}&google_domain=google.com&gl=us&hl=en&tbm=shop&start=8&num=8&api_key=a97958c2af388fd67fa25a5ffff96640f9c08804383e96d7a5048e372e559f73`
);
let respdata = await res.json();
let newdata = respdata.shopping_results;
console.log(respdata.shopping_results);
newdata.forEach(function (d) {
let p = document.createElement("p");
p.innerText = d.title;
p.onclick = function () {
console.log(d);
showMoreInfo(d);
};
onlineSearch.append(p);
});
}
function showMoreInfo(d) {
let showdatainpage = document.getElementById("newresults");
showdatainpage.style.marginLeft = "20%";
let div = document.createElement("div");
div.style.width = "250px";
let img = document.createElement("img");
img.src = d.thumbnail;
img.style.width = "200px";
img.style.marginLeft = "25px";
img.style.height = "250px";
let name = document.createElement("p");
name.style.color = "blue";
name.style.marginLeft = "3%";
name.innerText = d.title;
let price = document.createElement("p");
price.innerText = d.price;
let addtocartbtn = document.createElement("button");
addtocartbtn.innerText = "Add to cart";
addtocartbtn.backgroundColor = "white";
addtocartbtn.style.marginLeft = "3%";
div.append(img, name, price, addtocartbtn);
showdatainpage.append(div);
}
var footerEndPush = document.getElementById("footerEndPush");
import footer from "./js elements/footer.js";
footerEndPush.innerHTML = footer();
// END FOOTER JS PART
</script>