-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremove.html
140 lines (133 loc) · 3.52 KB
/
remove.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
<!DOCTYPE html>
<html lang="pt-br">
<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>Remove</title>
<style>
body {
background-color: rgb(243, 73, 73);
}
section {
text-align: center;
margin-top: 8rem;
background-color: rgb(243, 73, 73);
}
#user {
width: 110px;
}
#letter {
width: 20px;
margin-bottom: -10px;
}
#padlock {
width: 18px;
margin-bottom: -6px;
}
#log,
#key {
border: none;
border-bottom: 1px black dotted;
background-color: aquamarine;
}
#key:focus,
#log:focus {
outline: 0;
background-color: aquamarine;
}
p {
margin-top: 30px;
}
footer{
font-size: 10px;
font-weight: bolder;
font-style: italic;
position: absolute;
left:1vw;
bottom: 1vw;
}
</style>
</head>
<body>
<section>
<form action="" method="post">
<img id="user" src="./assets/profile.png" alt="User log" />
<p>
<label for="log">
<img id="letter" src="./assets/email.png" alt="letter" />
</label>
<input
type="email"
name="log"
id="log"
placeholder=" your.e-mail@mail.com"
required
title="Informe um e-mail no formato padrão!"
/>
</p>
<p>
<label for="key">
<img id="padlock" src="./assets/padlock.png" alt="padlock" />
</label>
<input
type="password"
name="key"
id="key"
placeholder=" 6 - digits"
maxlength="6"
required
title="A senha pode conter letras maiúsculas e minúsculas, e números!"
onclick="tMail()"
readonly
/>
</p>
<p>
<input
type="button"
id="rButton"
value="REMOVE"
onclick="remove()"
disabled
/>
</p>
</form>
</section>
<footer>M.Gomes and Celo-Gomes© Technology Institute </footer>
<script>
let userMail
let userKey
let index
let indexKey
let mail = JSON.parse(localStorage.getItem("recMail")) || ""
let pass = JSON.parse(localStorage.getItem("recKey"))
function tMail() {
userMail = document.querySelector("#log").value
if (userMail.includes("@") && userMail.includes(".com")) {
index = mail.indexOf(userMail)
document.querySelector("#key").readOnly = false
document.querySelector("#rButton").disabled = false
} else {
alert("Informe um e-mail no formato padrão!")
}
}
function remove() {
console.log(mail)
userKey = document.querySelector("#key").value
if (userKey.length == 6) {
if (mail.includes(userMail) && pass.includes(userKey)) {
localStorage.clear()
alert("Todos usuários removidos!")
document.location.href = "index.html"
} else {
index = ""
alert("Verifique usuário e senha!")
document.location.reload(true)
}
} else {
alert("Informe 6 digitos entre letras e números e confirme!")
}
}
</script>
</body>
</html>