-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
472 lines (444 loc) · 22.6 KB
/
index.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
<!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>Olx Clone</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>
<div class="login_email hidden" id="email">
<div class="email_login">
<div class="icons_flex">
<i class="fa-solid fa-arrow-left" onclick="backEmail()"></i>
<i class="fa-solid fa-xmark close__btn" onclick="closeEmail()"></i>
</div>
<img src="./images/emal__login.svg" alt="">
<h2>Enter Your Email</h2>
<input type="text" id="emailLogin" placeholder="Email">
<button class="next_button" onclick="login()">Login</button>
<p>We won't reveal your email to anyone else nor use it to send you spam.</p>
</div>
</div>
<div class="login_phone hidden" id="phone">
<div class="phone_login">
<div class="icons_flex">
<i class="fa-solid fa-arrow-left" onclick="backPhone()"></i>
<i class="fa-solid fa-xmark close__btn" onclick="closePhone()"></i>
</div>
<img src="./images/email__login.svg" alt="">
<h2>Enter Your phone</h2>
<input type="text" id="phoneLogin" placeholder="Phone Number">
<button disabled class="next_button" onclick="loginPhone()"> Next</button>
<p>We won't reveal your phone number to anyone else nor use it to send you spam.</p>
</div>
</div>
<div class="signUp hidden" id="signUp">
<div class="signUp_account">
<div class="icons_flex">
<i class="fa-solid fa-arrow-left" onclick="backSignUp()"></i>
<i class="fa-solid fa-xmark close__btn" onclick="closeSignUp()"></i>
</div>
<img src="./images/email__login.svg" alt="">
<h2>Create Your Account</h2>
<input type="text" id="name" placeholder="Name">
<input type="text" id="signEmail" placeholder="Email">
<input type="text" id="signphone" placeholder="Phone Number">
<input type="text" id="gender" placeholder="Gender">
<button class="next_button" id="button" onclick="signUp()">Create an Account</button>
<p>We won't reveal your phone number to anyone else nor use it to send you spam.</p>
</div>
</div>
<div class="login hidden" id="login">
<div class="login_form">
<i class="fa-solid fa-xmark close__btn" onclick="closeLogin()"></i>
<img src="./images/logo.svg" alt="">
<h1>WELCOME TO OLX</h1>
<h2>The trusted community of buyers and sellers.</h2>
<button href="" class="loginSign_button"><img src="./images/facebok.svg" alt=""> Continue with
Facebook</button>
<button href="" class="loginSign_button" onclick="createAccountPage()"><img src="./images/googleIcon.svg"
alt=""> Create Your Account</button>
<button href="" class="loginSign_button" onclick="emailLogin()"><img src="./images/email.svg" alt="">
Continue With Email</button>
<button href="" class="loginSign_button" onclick="phoneLogin()"><img src="./images/phone.svg" alt="">
Continue with Phone</button>
<p>By continuing, you are accepting
<b>OLX Terms </b> of use and <b>Privacy Policy</b></p>
</div>
</div>
<div class="back_to_top hidden" id="top">
<h3> <i class="fa-solid fa-angle-up"></i>Back To Top</h3>
</div>
<div class="same__color">
<div class="small__navbar">
<div class="small__navbar_logo">
<svg height="20" viewBox="0 0 36.289 20.768" alt="Logo">
<path
d="M18.9 20.77V0h4.93v20.77zM0 10.39a8.56 8.56 0 1 1 8.56 8.56A8.56 8.56 0 0 1 0 10.4zm5.97-.01a2.6 2.6 0 1 0 2.6-2.6 2.6 2.6 0 0 0-2.6 2.6zm27 5.2l-1.88-1.87-1.87 1.88H25.9V12.3l1.9-1.9-1.9-1.89V5.18h3.27l1.92 1.92 1.93-1.92h3.27v3.33l-1.9 1.9 1.9 1.9v3.27z">
</path>
</svg>
</div>
<div class="actions__links">
<a href="https://www.olx.com.pk/motors/">
<svg xmlns="http://www.w3.org/2000/svg" width="88.9" height="33" alt="OLX Motors" class="_1a6eed8f">
<defs>
<linearGradient id="a" x1=".5" x2=".5" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#ddd"></stop>
<stop offset="1" stop-color="#fff"></stop>
</linearGradient>
</defs>
<path stroke="rgba(0,0,0,0)"
d="M40 20.5h1v-6.2l3 6.2h.6l2.8-6.2v6.2h1v-8.3h-1L44.1 19l-3-6.8H40zm18.3-4.2A4.1 4.1 0 0 0 54 12a4.1 4.1 0 0 0-4.2 4.3 4.1 4.1 0 0 0 4.2 4.3 4.1 4.1 0 0 0 4.2-4.3zm-7.3 0a3 3 0 0 1 3-3.3 3 3 0 0 1 3.2 3.3 3 3 0 0 1-3 3.3 3 3 0 0 1-3.2-3.3zm8.2-3.3h2.3v7.5h1V13H65v-1h-5.7zm15 3.3A4.1 4.1 0 0 0 70 12a4.1 4.1 0 0 0-4.2 4.3 4.1 4.1 0 0 0 4.2 4.3 4.1 4.1 0 0 0 4.2-4.3zm-7.2 0a3 3 0 0 1 3-3.3 3 3 0 0 1 3 3.3 3 3 0 0 1-3 3.3 3 3 0 0 1-3-3.3zm13.2-1.7c0 1-.6 1.6-1.8 1.6h-1.6V13h1.6c1.2 0 1.8.6 1.8 1.6zM75.7 12v8.4h1V17H78l2 3.4h1.3l-2-3.5a2.4 2.4 0 0 0 2-2.4c0-1.4-1-2.5-3-2.5zm12.7 6c0-3-4.5-1.7-4.5-3.8 0-1 .7-1.4 1.6-1.4a1.5 1.5 0 0 1 1.6 1.2h1.2a2.5 2.5 0 0 0-2.7-2.1c-1.7 0-2.8 1-2.8 2.3 0 3 4.5 1.7 4.5 4 0 .7-.6 1.3-1.7 1.3a1.5 1.5 0 0 1-1.7-1.4h-1.2c0 1.4 1.3 2.4 3 2.4a2.5 2.5 0 0 0 2.7-2.4z">
</path>
<path fill="url(#a)" d="M0 16.5a16.5 16.5 0 1 1 33 0 16.5 16.5 0 0 1-33 0z" opacity=".6"></path>
<path
d="M24.7 13.5a1.1 1.1 0 0 0-1.4-.7l-.6.2-1-2.2-.4-.1a16 16 0 0 0-4.8-.7 12 12 0 0 0-4.3.7l-.3.1-1 2.3h-.5a1.1 1.1 0 0 0-.6 2v.2a4 4 0 0 0-.4 1.5v4a2.1 2.1 0 0 0 0 .6.7.7 0 0 0 .8.5h1.6a.7.7 0 0 0 .8-.5 2.1 2.1 0 0 0 0-.7v-.3a47.1 47.1 0 0 0 8.3 0v.3a2.1 2.1 0 0 0 0 .7.7.7 0 0 0 .8.5h1.6a.7.7 0 0 0 .7-.5 2.1 2.1 0 0 0 .1-.7v-4a3.7 3.7 0 0 0-.4-1.5V15h.3a1.1 1.1 0 0 0 .7-1.5zm-12.2-2.1a11.3 11.3 0 0 1 4-.6 15.2 15.2 0 0 1 4.6.6l.9 1.8a17.6 17.6 0 0 1-4.3.4H17a28.2 28.2 0 0 1-5.4-.3zm-.6 9.3a2.2 2.2 0 0 1 0 .4h-1.7a2.2 2.2 0 0 1 0-.4V20a1 1 0 0 0 .3 0l1.4.2v.4zm11.4 0a2.2 2.2 0 0 1 0 .4h-1.6a2.2 2.2 0 0 1 0-.4v-.4H23a1 1 0 0 0 .4-.2zm.5-6.5l-1.2.4.5 1a3 3 0 0 1 .3 1.2V18l-.1.7c0 .3-.2.7-.5.7-3 .3-4.5.5-6 .5s-3-.2-6.2-.5c-.2 0-.3-.3-.4-.6V18a17 17 0 0 1 0-1 3.2 3.2 0 0 1 .3-1.3l.5-1-1-.2a.3.3 0 0 1-.2-.4.3.3 0 0 1 .4-.3l1.1.4a23.6 23.6 0 0 0 5 .3h1.4a17.9 17.9 0 0 0 4.6-.5h.3l1-.4a.3.3 0 0 1 .4.3.3.3 0 0 1-.2.4z">
</path>
<path
d="M12 16a1.2 1.2 0 1 0 1.1 1.2A1.2 1.2 0 0 0 12 16zm0 1.6a.4.4 0 1 1 .3-.4.4.4 0 0 1-.4.4zm9.6-1.6a1.2 1.2 0 1 0 1.2 1.2 1.2 1.2 0 0 0-1.2-1.2zm0 1.6a.4.4 0 1 1 .5-.4.4.4 0 0 1-.5.4zm-7.8.2h6v.8h-6z">
</path>
</svg></a>
<a href="https://www.olx.com.pk/properties/" class="ac22b0e1">
<svg xmlns="http://www.w3.org/2000/svg" width="97.25" height="33" alt="OLX Property"
class="_1a6eed8f">
<defs>
<linearGradient id="a" x1=".5" x2=".5" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#ddd"></stop>
<stop offset="1" stop-color="#fff"></stop>
</linearGradient>
</defs>
<path stroke="rgba(0,0,0,0)"
d="M41.1 16.64v-3.07h1.6c1.25 0 1.78.58 1.78 1.55 0 .94-.53 1.52-1.78 1.52zm4.5-1.52c0-1.37-.93-2.45-2.9-2.45H40v8.36h1.1v-3.49h1.6c2.08 0 2.9-1.15 2.9-2.42zm5.82.01c0 .94-.54 1.6-1.77 1.6h-1.6v-3.16h1.6c1.25 0 1.77.61 1.77 1.57zm-4.47-2.46v8.36h1.1v-3.42h1.31l2 3.42h1.3l-2.1-3.5a2.36 2.36 0 0 0 2-2.4c0-1.36-.94-2.45-2.9-2.45zm15.3 4.18a4.12 4.12 0 0 0-4.2-4.28 4.13 4.13 0 0 0-4.2 4.28 4.13 4.13 0 0 0 4.2 4.27 4.12 4.12 0 0 0 4.2-4.27zm-7.3 0a3.05 3.05 0 0 1 3.1-3.33 3.05 3.05 0 0 1 3.07 3.33 3.06 3.06 0 0 1-3.08 3.32 3.06 3.06 0 0 1-3.09-3.32zm9.82-.2v-3.08h1.6c1.25 0 1.78.58 1.78 1.55 0 .94-.53 1.52-1.77 1.52zm4.5-1.53c0-1.36-.93-2.44-2.9-2.44h-2.7v8.35h1.1v-3.49h1.6c2.08 0 2.9-1.15 2.9-2.42zm5.85-2.46h-4.5v8.37h4.5v-.9h-3.4v-2.88h3.04v-.9h-3.04v-2.8h3.4zm6.14 2.48c0 .93-.54 1.6-1.78 1.6h-1.6v-3.17h1.6c1.25 0 1.78.61 1.78 1.57zm-4.48-2.47v8.36h1.1v-3.42h1.32l1.98 3.42h1.3l-2.1-3.5a2.36 2.36 0 0 0 2-2.4c0-1.36-.94-2.45-2.9-2.45zm6.78.9h2.29v7.46h1.1v-7.47h2.27v-.89h-5.66zm9.04 4.3v3.16h1.1v-3.15l2.72-5.2h-1.2l-2.07 4.23-2.07-4.24h-1.2z">
</path>
<path fill="url(#a)" d="M0 16.5a16.5 16.5 0 1 1 33 0 16.5 16.5 0 0 1-33 0z" opacity=".57">
</path>
<path
d="M25.03 21.92v-9.35l-4.99-1.66v1.05l4 1.33v8.59h-5V7.85h-8.38v14.08h-.4v1h15.17v-1zm-6.98-11.68v11.68h-6.4V8.84h6.4z">
</path>
<path
d="M15.17 10.3h1.61v.8h-1.6zm-2.42 0h1.6v.8h-1.6zm2.42 1.6h1.61v.81h-1.6zm-2.42 0h1.6v.81h-1.6zm2.42 2.42h1.61v.81h-1.6zm-2.42 0h1.6v.81h-1.6zm2.42 1.62h1.61v.8h-1.6zm-2.42 0h1.6v.8h-1.6zm2.42 2.42h1.61v.8h-1.6zm-2.42 0h1.6v.8h-1.6zm8.87-4.04h.8v.81h-.8zm-1.62 0h.8v.81H20zm1.62 1.62h.8v.8h-.8zm-1.62 0h.8v.8H20zm1.62 2.42h.8v.8h-.8zm-1.62 0h.8v.8H20z">
</path>
</svg></a>
</div>
</div>
<div class="second__navbar">
<div class="second-navbar__logo">
<a href="./index.html">
<svg viewBox="0 0 36.289 20.768" alt="Logo">
<path
d="M18.9 20.77V0h4.93v20.77zM0 10.39a8.56 8.56 0 1 1 8.56 8.56A8.56 8.56 0 0 1 0 10.4zm5.97-.01a2.6 2.6 0 1 0 2.6-2.6 2.6 2.6 0 0 0-2.6 2.6zm27 5.2l-1.88-1.87-1.87 1.88H25.9V12.3l1.9-1.9-1.9-1.89V5.18h3.27l1.92 1.92 1.93-1.92h3.27v3.33l-1.9 1.9 1.9 1.9v3.27z">
</path>
</svg>
</a>
</div>
<div class="select_option">
<i class="fa-solid fa-search"></i>
<input type="text" placeholder="Jamshed Town, Karachi">
</div>
<div class="search__bar">
<input type="text" id="txt" placeholder="Find Cars, Mobile Phones and more...">
<i class="fa-solid fa-search" onclick="search()"></i>
</div>
<div class="login__sell" id="login__sell">
<button href="" class="login__btn" onclick="openLogin()">Login</button>
<button onclick="sell()" class="sell__btn">+ Sell</button>
</div>
</div>
</div>
<div class="third__navbar">
<div class="select__itself">
<a href="">All category</a>
</div>
<div class="links" id="links">
</div>
</div>
<div class="ad">
<img src="./images/ad.jpg" alt="">
</div>
<div class="fresh__recomandation">
<h1>Fresh recommendations</h1>
<div class="cards__container" id="cards">
<!-- <div class="card">
<div class="img__featured">
<img src="./images/img1.jpg" alt="">
<p class="featured">featured</p>
</div>
<div class="card__content">
<div class="card__content-gap">
<div class="name__heart">
<h4>Toyota witz</h4>
<i class="fa-solid fa-heart"></i>
</div>
<h2>Rs 2,850,000</h2>
</div>
<h5>Jamshed Quaters , Karachi </h5>
</div>
</div> -->
</div>
<div class="load__more">
<button class="load__more-btn">Load More</button>
</div>
</div>
<footer>
<div class="footer_the_olx_app_section">
<img src="./images/mobile.webp" alt="">
<div class="footer_olx_content">
<h1>Try The Olx App</h1>
<h3>
Buy, sell and find just about anything using the app on your mobile.
</h3>
</div>
<div class="line"></div>
<div class="get__your_app_today">
<h4>Get Your App Today</h4>
<div class="apps">
<img src="./images/apple.svg" alt="">
<img src="./images/google.svg" alt="">
<img src="./images/app_galery.svg" alt="">
</div>
</div>
</div>
<div class="footer__real">
<div class="footer__content">
<div class="lists">
<ul>
<h4>POPULAR category</h4>
<li>Cars</li>
<li>Flats for rent</li>
<li>Mobile Phones</li>
<li>Jobs</li>
</ul>
<ul>
<h4>POPULAR category</h4>
<li>Cars</li>
<li>Flats for rent</li>
<li>Mobile Phones</li>
<li>Jobs</li>
</ul>
<ul>
<h4>POPULAR category</h4>
<li>Cars</li>
<li>Flats for rent</li>
<li>Mobile Phones</li>
<li>Jobs</li>
</ul>
<ul>
<h4>POPULAR category</h4>
<li>Cars</li>
<li>Flats for rent</li>
<li>Mobile Phones</li>
<li>Jobs</li>
</ul>
</div>
<div class="follow_us">
<h4>FOLLOW US</h4>
<div class="icons">
<i class="fa-brands fa-facebook-f"></i>
<i class="fa-brands fa-instagram"></i>
<i class="fa-brands fa-twitter"></i>
<i class="fa-brands fa-instagram"></i>
</div>
<div class="apps">
<img src="./images/apple.svg" alt="">
<img src="./images/google.svg" alt="">
<img src="./images/app_galery.svg" alt="">
</div>
</div>
</div>
<div class="footer__bottom">
<p>Free Classifieds in Pakistan . © 2006-2023 OLX</p>
</div>
</div>
</footer>
</body>
<script>
var categories = [
"Mobile Phones",
"Cars",
"Motercycles",
"House",
"Tv - Video - Audio",
"Tablets",
"Land & Ports"
]
categories.map((data) => {
document.getElementById("links").innerHTML += `
<button onclick="categorySet(this)">${data}</button>
`
})
function showData() {
var data = JSON.parse(localStorage.getItem("users"))
var email = localStorage.getItem("email")
var isAuthenticated = localStorage.getItem("isAuthenticated")
for (let i = 0; i < data.length; i++) {
if (email == data[i].email && isAuthenticated === "true") {
document.getElementById("login__sell").innerHTML = `
<img class="avatar" onclick="profilePage()" width="60px"src="./images/avatar.png" />
<button onclick="sell()" class="sell__btn">+ Sell</button>
`
}
}
}
function sell() {
var data = JSON.parse(localStorage.getItem("users"))
var email = localStorage.getItem("email")
var isAuthenticated = localStorage.getItem("isAuthenticated")
var flage = true;
for (let i = 0; i < data.length; i++) {
if (email == data[i].email && isAuthenticated === "true") {
flage = false
window.location.href = "./sell.html"
}
}
if (flage === true) {
document.getElementById("login").classList.remove("hidden")
}
}
function profilePage() {
window.location.href = "./profile.html"
}
showData()
var data = JSON.parse(localStorage.getItem("products")) || []
data.map((card, index) => {
document.getElementById("cards").innerHTML += `
<div onclick="productDetail(${index})" class="card">
<div class="img__featured">
<img src="${card.image}" alt="">
<p class="featured">featured</p>
</div>
<div class="card__content">
<div class="card__content-gap">
<div class="name__heart">
<h4>${card.name}</h4>
<i class="fa-solid fa-heart"></i>
</div>
<h2>Rs ${card.price}</h2>
</div>
<h5>${card.location}</h5>
</div>
</div>
`
})
function productDetail(index) {
console.log(data);
localStorage.setItem("productName", data[index].name)
localStorage.setItem("name", data[index].profileName)
localStorage.setItem("description", data[index].description)
localStorage.setItem("image", data[index].image)
localStorage.setItem("price", data[index].price)
localStorage.setItem("location", data[index].location)
localStorage.setItem("phone", data[index].profilePhone)
localStorage.setItem("phoneShow", data[index].phoneShow)
window.location.href = "./productDetails.html"
}
function openLogin() {
document.getElementById("login").classList.remove("hidden");
}
function closeLogin() {
document.getElementById("login").classList.add("hidden")
}
function emailLogin() {
document.getElementById("email").classList.remove("hidden");
document.getElementById("login").classList.add("hidden")
}
function closeEmail() {
document.getElementById("email").classList.add("hidden")
}
function backEmail() {
document.getElementById("email").classList.add("hidden")
document.getElementById("login").classList.remove("hidden");
}
function phoneLogin() {
document.getElementById("phone").classList.remove("hidden");
document.getElementById("login").classList.add("hidden")
}
function closePhone() {
document.getElementById("phone").classList.add("hidden")
}
function backPhone() {
document.getElementById("phone").classList.add("hidden")
document.getElementById("login").classList.remove("hidden");
}
function createAccountPage() {
document.getElementById("signUp").classList.remove("hidden");
document.getElementById("login").classList.add("hidden")
}
function closeSignUp() {
document.getElementById("signUp").classList.add("hidden")
}
function backSignUp() {
document.getElementById("signUp").classList.add("hidden")
document.getElementById("login").classList.remove("hidden");
}
function signUp() {
let data = JSON.parse(localStorage.getItem("users")) ? JSON.parse(localStorage.getItem("users")) : []
let flage = false
for (let i = 0; i < data.length; i++) {
if (data[i].email === document.getElementById("signEmail").value) {
flage = true
alert("You have entered a duplicate email address")
}
}
if (flage === false) {
let users = []
let obj = {
name: document.getElementById("name").value,
email: document.getElementById("signEmail").value,
gender: document.getElementById("gender").value,
phone: document.getElementById("signphone").value,
isAuthenticated: true
}
users = JSON.parse(localStorage.getItem("users")) ? JSON.parse(localStorage.getItem("users")) : []
users.push(obj)
localStorage.setItem("users", JSON.stringify(users))
document.getElementById("signUp").classList.add("hidden");
document.getElementById("email").classList.remove("hidden");
}
}
function login() {
let email = document.getElementById("emailLogin").value;
let users = JSON.parse(localStorage.getItem("users")) || []
var flage = false;
for (let i = 0; i < users.length; i++) {
if (users[i].email === email) {
flage = true;
alert("You have successfully Login");
localStorage.setItem("name", users[i].name);
localStorage.setItem("email", email);
localStorage.setItem("phone", users[i].phone);
localStorage.setItem("gender", users[i].gender);
localStorage.setItem("isAuthenticated", users[i].isAuthenticated);
window.location.reload()
break;
}
}
if (flage === false) {
alert("Please enter a valid email and password");
}
}
function loginPhone() {
let email = document.getElementById("phoneLogin").value;
let users = JSON.parse(localStorage.getItem("users"))
var flage = false;
for (let i = 0; i < users.length; i++) {
if (users[i].phone === phone) {
flage = true;
alert("You have successfully Login");
localStorage.setItem("name", users[i].name);
localStorage.setItem("email", email);
localStorage.setItem("phone", user[i].phone);
localStorage.setItem("isAuthenticated", user[i].isAuthenticated);
document.getElementById("phone").classList.add("hidden")
if (flage == false) {
alert("Please enter a valid email and password");
}
}
}
}
</script>
</html>