-
Notifications
You must be signed in to change notification settings - Fork 0
/
silver.html
391 lines (360 loc) · 14.4 KB
/
silver.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
<!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">
<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="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<title>Silver</title>
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="silver.css" >
</head>
<body>
<!-- start topbar -->
<div class="top-menu">
<div class="gift-top">
<div>
<p> 1800-120-1434</p>
</div>
<div class="gift-top-inner">
<p> Corporate Gifting</p>
<p>Gift Cards</p>
<p>Store Locator</p>
<p>Corporate</p>
<p>Investors</p>
</div>
</div>
<div class="login-cart">
<div>
<a href="index.html"><img
src="https://cf-cdn.pcjeweller.com/public/uploads/settings/pcj-logo__592261435.png"
alt="pcg"></a>
</div>
<div id="searchbar">
<input type="text" placeholder="Search..">
</div>
<div class="login-cart login-data">
<a href="register.html#popup">
<h6>Login</h6>
</a>
<a href="register.html#popup">
<h6>Register</h6>
</a>
<a href="cart.html"><i class="fa fa-shopping-bag" aria-hidden="true"></i></a>
</div>
</div>
<div class="nav-menu">
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container1">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="rings.html">RINGS</a>
</li>
<li class="nav-item">
<a class="nav-link" href="earrings.html">EARRINGS</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="bestseller.html">BEST SELLER</a>
</li>
<li class="nav-item">
<a class="nav-link" href="alljewellery.html">ALL JEWELLERY</a>
</li>
<li class="nav-item">
<a class="nav-link" href="collections.html">COLLECTIONS</a>
</li>
<li class="nav-item">
<a class="nav-link" href="shipped.html">READY TO SHIP</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="gold-chain.html">GOLD CHAINS</a>
</li>
<li class="nav-item">
<a class="nav-link" href="silver.html">SILVER</a>
</li>
<li class="nav-item">
<a class="nav-link" href="coins.html">COINS</a>
</li>
<li class="nav-item digital-gold">
<a class="nav-link" href="gold-digital.html">DIGITAL GOLD</a>
</li>
</ul>
</div>
</div>
</nav>
</div>
</div>
<!-- end topbar -->
<div id="a">
<img style="height: 200px;" src="https://cf-cdn.pcjeweller.com/public/uploads/banner/Silver-Jewellery-category__1664344423.jpg" />
</div>
<div>
<h2>VIEW ALL SILVER </h2>
</div>
<div>
<p id="design">( 21 Designs )</p>
</div>
<div id="mainBox">
<h3>FILTER BY</h3>
<div class="filter-option">
<select id= "filter-price" onclick="filterPrice()">
<option value="">PRICE</option>
<option value="accending">High To Low</option>
<option value="decending">Low To High</option>
</select>
<select id="filter-material" onclick="filterMat()">
<option value="">BY MATERIAL</option>
<option value="Diamond">DIAMOND</option>
<option value="Gold">GOLD</option>
</select>
<select id = "filter-category" onclick="flterCat()">
<option value="">BY CATEGORY</option>
</select>
<select id= "filter-gender">
<option value="">BY GENDER</option>
<option value="">MEN</option>
<option value="">WOMEN</option>
</select>
</div>
<!-- DATA -->
<div id="container1"></div>
</div>
</body>
</html>
<script>
var silverData = [
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/s/SCLG00010-2_956.jpg",
name: "10 Gram Laxmi Ganesh Silver Coin - Round",
price: 881,
act_price: 979,
nature: "Metal 999 White",
specification: "",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/s/SER00010-1_55.jpg",
name: "The Diamond Silver Dragonfly Ear Cuff",
price: 7530,
act_price: 7930,
nature: "Metal 925 Sterling Silver Yellow",
specification: "Diamond IJ-I (0.08 ct)",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/c/CZBR00042-6_693.jpg",
name: "The Sureshukari Silver Bracelet",
price: 1744,
act_price: 1280,
nature: "Metal 925 Sterling Silver White",
specification: "",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/s/SBR00001-6_187.jpg",
name: "The Lion Link Diamond Silver Bracelet",
price: 28325,
act_price: 33323,
nature: "Metal 925 Sterling Silver Yellow",
specification: "Diamond IJ-I (0.24 ct)",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/s/SDS00006E-1_760.jpg",
name: "The Diamond Silver Betta Fish Ear Cuff",
price: 23707,
act_price: 25228,
nature: "Metal 925 Sterling Silver Yellow",
specification: "Diamond IJ-I (0.14 ct)",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/l/LR03347-6_969.jpg",
name: "The Diamond Silver Butterfly Ring",
price: 12257,
act_price: 15729,
nature: "Metal 925 Sterling Silver Yellow",
specification: "Diamond IJ-I (0.14 ct)",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/t/TORNG00002-6_130.jpg",
name: "The Ira Silver Toe Ring",
price: 1230,
act_price: 1699,
nature: "Metal 925 Sterling Silver White",
specification: "",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/s/SER00009-1_87.jpg",
name: "The Diamond Silver Honey Bee Ear Cuff",
price: 7816,
act_price: 8329,
nature: "Metal 925 Sterling Silver Yellow",
specification: "Diamond IJ-I (0.08 ct)",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/z/ZLR01654-6_568.jpg",
name: "The Kamala Silver Ring",
price: 1868,
act_price: 2230,
nature: "Metal 925 Sterling Silver White",
specification: "",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/z/ZLR01656-6_863.jpg",
name: "The Lankya Silver Ring",
price: 3283,
act_price: 3844,
nature: "Metal 925 Sterling Silver White",
specification: "",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/t/TP00020-5_179.jpg",
name: "The Om Silver Diamond Bracelet",
price: 2987,
act_price: 3245,
nature: "Silver",
specification: "",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/z/ZLR01661-6_950.jpg",
name: "The Ashriya Silver Ring",
price: 1715,
act_price: 1863,
nature: "Metal 925 Sterling Silver White",
specification: "",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/l/LR03346-6_409.jpg",
name: "The Diamond Silver Twin Elephant Ring",
price: 27066,
act_price: 29060,
nature: "Metal 925 Sterling Silver Yellow",
specification: "Diamond IJ-I (0.12 ct)",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/z/ZDS00024E-1_335.jpg",
name: "The Saanvika Silver Earrings",
price: 6701,
act_price: 8208,
nature: "Metal 925 Sterling Silver White",
specification: "",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/a/AUGGS00004-1_589.jpg",
name: "The 925 Silver Glass AUGGS00004",
price: 9416,
act_price: 11407,
nature: "Metal 925 Sterling White",
specification: "Gold",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/l/LR03343-6_232.jpg",
name: "The Diamond Silver Dragonfly Ring",
price: 15685,
act_price: 18654,
nature: "Metal 925 Sterling Silver Yellow",
specification: "Diamond IJ-I (0.11 ct)",
},
{
img_url:
"https://cf-cdn.pcjeweller.com/public/uploads/catalog/product/preview/a/AUGPT00023_286.jpg",
name: "The 925 Silver Pendant AUGPT00023",
price: 3914,
act_price: 4534,
nature: "Metal 925 Sterling White",
specification: "",
},
];
window.addEventListener("load", function (){
displayData(silverData)
});
function filterPrice(){
var selected = document.querySelector("#filter-price").value;
console.log(selected);
if(selected =="accending"){
silverData.sort(function (a, b){
return b.price - a.price;
});
displayData(silverData);
}
if(selected == "decending"){
silverData.sort(function (a, b){
return a.price - b.price;
});
displayData(silverData)
}
};
function filterCat() {
var selected = document.querySelector("#filter-category").value;
var filterData = silverData.filter(function(e){
return e.name.includes(selected);
})
displayData(filterData);
}
function filterMat(){
var selected = document.querySelector("#filter-material").value;
console.log(selected);
var filterData = silverData.filter(function(e){
return e.name.includes(selected)
});
displayData(filterData);
}
function displayData(silverData){
document.querySelector("#container1").innerText ="";
silverData.map(function (e){
var div = document.createElement("div");
var img = document.createElement("img");
img.src = e.img_url;
var p1 = document.createElement("p");
p1.innerText = e.name;
var p2 = document.createElement("p")
p2.setAttribute("id", "bestpricepar")
p2.innerText = "₹" + e.price +" "
var span = document.createElement("span");
var mark = document.createElement("del");
mark.innerText = "₹" + e.act_price;
span.append(mark);
p2.append(span);
var p3 = document.createElement("p");
p3.innerText = "You Save ₹" + [e.act_price - e.price] + " [" + Math.round(100 - (e.price / e.act_price) *100) + "%" + " off]"
var p4 = document.createElement("p")
p4.innerText = e.nature;
var p5 = document.createElement("p");
p5.innerText = e.specification;
var btn=document.createElement("button");
btn.innerText="Add to Card";
btn.addEventListener("click", function () {
addToCart(e);
});
div.append(img, p1, p2, p3, p4, p5, btn);
document.querySelector("#container1").append(div);
});
}
function addToCart(e){
var cartData=JSON.parse(localStorage.getItem("cartData"))||[];
console.log(cartData);
cartData.push(e);
localStorage.setItem("cartData",JSON.stringify(cartData));
alert("item added into the cart");
}
</script>