-
Notifications
You must be signed in to change notification settings - Fork 4
/
signout.html
89 lines (81 loc) · 2.31 KB
/
signout.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
<!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>Sign Out</title>
<style>
*{
font-family: 'Roboto', sans-serif;
}
body{
background-color: whitesmoke;
color:#1A237E;
}
#upmsg{
text-align: center;
color:rgb(107, 55, 55);
}
#delData{
width:400px;
border:1px solid #24a3b5;
margin:auto;
background-color: #24a3b5;
border-radius:10px;
padding:4%;
}
#sbt2{
background-color: #FF5722;
color:white;
border:1px solid #FF5722;
font-weight: bolder;
font-size:smaller;
width:150px;
padding:0.8%;
border-radius: 5px;
}
#pass{
width:230px;
}
</style>
</head>
<body>
<h2 id="upmsg"> Missing you Already </h2>
<div id="delData">
<form >
<input id="pass" type="password" placeholder="Enter your password"></input>
<button id="sbt2" onclick="delTheData()">Submit</button>
</div>
</form>
<script>
let delData= JSON.parse(localStorage.getItem("activeUser"));
let firstmsg=document.getElementById("upmsg");
firstmsg.textContent+="😢😢😢"+delData[0].username;
var countforErr=0;
function delTheData(){
let enteredpass=document.getElementById("pass").value;
if(enteredpass!=""){
if(enteredpass==delData[0].Password){
localStorage.removeItem("activeUser");
alert("Sign Out Successful");
var arr=[];
localStorage.setItem("myOrders",JSON.stringify(arr));
localStorage.setItem("cart", JSON.stringify(arr));
localStorage.setItem("wishList", JSON.stringify(arr));
window.open("frontpage.html");
}
else {
alert("Wrong Password");
}
}
else{
countforErr++;
if(countforErr==delData.length){
alert("Please enter your password");
}
}
}
</script>
</body>
</html>