-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.html
198 lines (164 loc) · 5.74 KB
/
signup.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
<!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 Up</title>
<link rel="stylesheet" href="/topsection.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
<style>
form {
width: 380px;
margin: 40px auto;
text-align: center;
box-shadow: 3px 3px 8px gray;
padding: 30px;
}
h1 {
margin: 10px auto 30px auto;
color: brown;
font-weight: bolder;
}
input {
width: 80%;
height: 30px;
font-size: large;
}
input[type="submit"] {
background-color: rgb(8, 8, 95);
color: whitesmoke;
height: 35px;
border: none;
border-radius: 20px;
}
label {
margin: auto 150px auto 0;
font-weight: bold;
}
#signin {
width: 350px;
margin: 40px auto;
text-align: center;
}
#signin>span {
color: blue;
font-weight: 700;
cursor: pointer;
}
input[type="submit"]{
cursor: pointer;
}
@media all and (max-width:500px){
#logo{
width: 420px;
margin: auto;
}
#logo div{
width: 70%;
justify-content: space-between;
align-items: center;
}
#logo img{
width: 80%;
margin-top: 10px;
}
#topimg{
width: 420px;
margin: auto;
text-align: center;
}
#topimg>img{
width: 420px;
}
#signin{
margin-left: 60px;
}
}
</style>
</head>
<body>
<div id="topimg">
<img src="https://tpc.googlesyndication.com/simgad/5503378334793473371" alt="">
</div>
<div id="logo">
<div>Wednesday, Jul 20, 2022</div>
<div>
<img src="https://www.outlookindia.com/images/home_new_v4/logo_outlook.svg" alt="">
</div>
<div>
<a href="https://www.facebook.com/Outlookindia" target="_blank"><img
src="https://www.outlookindia.com/images/home_new_v4/facebook_top.svg" alt=""></a>
<a href="https://twitter.com/outlookindia/" target="_blank"><img
src="https://www.outlookindia.com/images/home_new_v4/twitter_top.svg" alt=""></a>
<a href="https://www.instagram.com/outlookindia/" target="_blank"><img
src="https://www.outlookindia.com/images/home_new_v4/instagram_top.svg" alt=""></a>
<a href="https://www.youtube.com/user/OutlookMagazine" target="_blank"><img
src="https://www.outlookindia.com/images/home_new_v4/youtube_top.svg" alt=""></a>
</div>
</div>
<form>
<h1>SIGN UP TO OUTLOOK</h1>
<label for="name">Enter Your Full Name</label><br>
<input type="text" placeholder="Full Name" id="name"><br><br>
<label for="email">Enter Your E-mail add</label><br>
<input type="email" placeholder="E-mail" id="email"><br><br>
<label for="mobile">Enter Mobile Number</label><br>
<input type="number" placeholder="Mobile No." id="mobile"><br><br>
<label for="password">Enter Your Password </label><br>
<input type="password" placeholder="Password" id="password"><br><br>
<input type="submit" id="submit">
</form>
<div id="signin">Already have an Account? <span>Log In</span></div>
</body>
</html>
<script>
let signupdata = JSON.parse(localStorage.getItem("SignupData")) || []
document.querySelector("form").addEventListener("submit", sub)
function sub() {
event.preventDefault()
let flag = false
let obj = {
"Name": document.querySelector("#name").value,
"E-mail": document.querySelector("#email").value,
"Mobile": document.querySelector("#mobile").value,
"Password": document.querySelector("#password").value
}
if (obj["Name"] == "") {
alert("Please enter Your Name");
return
}
if (obj["E-mail"] == "") {
alert("Please enter Your E-mail");
return
}
if (obj["Mobile"] == "") {
alert("Please enter Your Mobile Number");
return
}
if (obj["Password"] == "") {
alert("Please enter Password");
return
}
signupdata.push(obj)
localStorage.setItem("SignupData", JSON.stringify(signupdata));
flag = true;
document.querySelector("#name").value = "",
document.querySelector("#email").value = "",
document.querySelector("#mobile").value = "",
document.querySelector("#password").value = ""
if (flag == true) {
alert("Signup Successful")
window.location.href="http://127.0.0.1:5500/login.html"
}
}
document.querySelector("#signin>span").addEventListener("click",function(){
window.location.href="http://127.0.0.1:5500/login.html"
})
document.querySelector("#logo>div:nth-child(2)>img").addEventListener("click",logohome)
function logohome(){
window.location.href="http://127.0.0.1:5500/index.html"
}
</script>