-
Notifications
You must be signed in to change notification settings - Fork 0
/
adminSignup.html
161 lines (135 loc) · 4.45 KB
/
adminSignup.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
<!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>Admin Signup</title>
<style>
body{
font-family: Roboto, Rubik, Noto Kufi Arabic, Noto Sans JP, sans-serif;
color: #323338;
font-size: 14px;
}
#AdminSignup{
width: 60%;
margin: auto;
}
#Title {
width: 100%;
margin: auto;
text-align: left;
}
#Title>h2 {
text-align: center;
font-size: 24px;
}
#signups {
width: 100%;
margin: auto;
border: 1px solid #c3c6d4;
padding-top: 20px;
}
#signups>div:nth-child(1) {
width: 45%;
margin: auto;
}
#signups>div:nth-child(1)>p {
text-align: center;
}
#signups>div:nth-child(1)>p>a {
font-size: 14px;
color: #666666;
}
.inputs_admin {
display: block;
display: block;
width: 100%;
height: 32px;
border-radius: 1px;
border: 1px solid #c3c6d4;
margin: 7px 0px 28px 0px;
}
.red>span {
color: red;
}
.button {
width: 90%;
margin: auto;
margin-top: 20px;
margin-bottom: 20px;
display: flex;
justify-content: center;
}
button {
background-color: #0060B9;
color: white;
padding: 10px 30px;
font-size: 14px;
border: none;
}
</style>
</head>
<body>
<div id="AdminSignup">
<div id="Title">
<h2>Create an Admin Account</h2>
</div>
<div id="signups">
<div>
<label class="red" for=""><span>*</span>First Name</label>
<input id="fname" required class="inputs_admin" type="text">
<label class="red" for=""><span>*</span>Last Name</label>
<input id="lname" required class="inputs_admin" type="text">
<label for="" class="red"><span>*</span>Email</label>
<input required id="mail" type="text" class="inputs_admin">
<label for="" class="red"><span>*</span>Confirm Email</label>
<input id="cmail" required type="email" class="inputs_admin">
<label for="" class="red"><span>*</span>Phone</label>
<input id="phone" required type="number" class="inputs_admin">
<label for="" class="red"><span>*</span>Password</label>
<input required id="password" type="password" class="inputs_admin">
<p class="red"><a href="">Privacy Policy</a></p>
<div class="button"><button id="CA">CREATE ACCOUNT</button></div>
</div>
</div>
<hr>
</div>
</body>
</html>
<script>
document.querySelector("#CA").addEventListener("click", Signup);
document.querySelector("#CA").addEventListener("click", Reset);
document.querySelector("#CA").addEventListener("click", move);
let count=0;
let signupJS = JSON.parse(localStorage.getItem("signupLS")) || [];
function Signup() {
let signupJS = JSON.parse(localStorage.getItem("signupLS")) || [];
let mail = document.querySelector("#mail").value;
let password = document.querySelector("#password").value;
if (mail === "" || password === "") {
return alert("Please, Fill all the details.")
}
else {
let obj = { mail, password };
signupJS.push(obj);
localStorage.setItem("signupLS", JSON.stringify(signupJS));
alert("Signup Successful.");
count++;
}
}
function Reset(){
document.querySelector("#fname").value="";
document.querySelector("#lname").value="";
document.querySelector("#mail").value="";
document.querySelector("#cmail").value="";
document.querySelector("#phone").value="";
document.querySelector("#password").value="";
}
function move(){
console.log(count);
if(count===1){
return window.location.href= "adminSignin.html";
}
}
</script>