-
Notifications
You must be signed in to change notification settings - Fork 3
/
signup.html
282 lines (241 loc) · 9.88 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
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
<!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>LogIn</title>
<link rel="stylesheet" href="index.css">
<link rel="icon" href="https://www.mytheresa.com/skin/frontend/mytheresa/default/favicon.ico">
<style>
/* * {
font-weight: 500;
color: #757575;
} */
#signup_login_details {
font-size: 16px;
box-sizing: border-box;
display: flex;
width: 90%;
margin: auto;
font-weight: 500;
color: #757575;
}
#left_block {
/* border: 1px solid black; */
width: 50%;
padding: 0px 80px 0px 0px;
}
#right_block {
/* border: 1px solid black; */
width: 50%;
padding: 0px 0px 0px 80px;
}
#login_button {
width: 18%;
height: 40px;
font-size: 16px;
margin-top: 20px;
background-color: black;
color: white;
font-weight: 500;
}
#login_button:hover {
border: none;
cursor: pointer;
background-color: #666;
font-weight: 500;
}
#select_tag {
width: 102%;
height: 50px;
font-weight: 500;
}
form {
display: flex;
flex-direction: column;
margin: 10px auto;
font-weight: 500;
}
form * {
margin: 10px auto;
width: 100%;
padding: 10px 0px 10px 10px;
font-size: 16px;
font-weight: 500;
}
#check {
line-height: 25px;
font-weight: 500;
}
input[type="checkbox"] {
width: 16px;
height: 16px;
font-weight: 500;
}
#right_block a {
text-decoration: none;
color: black;
text-decoration: underline;
}
#submit_btn {
border: none;
width: 120px;
height: 40px;
font-size: 16px;
margin-top: 25px;
font-weight: 500;
}
.i_agree {
margin-top: 15px;
font-weight: 500;
}
#submit_btn:hover {
background-color: #dfdfdf;
/* font-weight: 500; */
}
/* h3 {
font-weight: 500;
}*/
</style>
</head>
<body>
<div id="navbar">
</div>
<div id="signup_login_details">
<div id="left_block">
<h3>CREATE AN ACCOUNT</h3>
<p>Please enter the following information to create your account.</p>
<input id="Ms." name="radio" class="radio_button" type="radio" value="Ms." checked><label
for="Ms.">Ms.</label>
<input id="Mrs." name="radio" class="radio_button" type="radio" value="Mrs"> <label for="Mrs.">Mrs.</label>
<input id="Mr." name="radio" class="radio_button" type="radio" value="Mr."> <label for="Mr.">Mr.</label>
<div>
<form action="" id="form_submit">
<select name="" id="select_tag" required>
<option value="">academic title</option>
<option value="Dr">Dr</option>
<option value="Prof">Prof</option>
<option value="Prof. Dr.">Prof. Dr.</option>
</select>
<input type="text" placeholder="First name *" id="first_name" class="" value="">
<input type="text" placeholder="Last name *" id="last_name" class="" value="">
<input type="text" placeholder="Email address *" id="email" class="" value="">
<input type="password" placeholder="Password *" id="password" class="" value="">
<input type="password" placeholder="Confirm password *" id="confirm_password" class="" value="">
</form>
<div id="check">
<input type="checkbox" id="agr_checkbox" checked style="display: inline;"><span> From now on I
will
receive the Mytheresa
Newsletter with selected
fashion offers. If I do not wish to receive the newsletter, I can unsubscribe at any time
free
of charge at [email protected].
</span>
<div class="i_agree">I agree that Mytheresa may insert analytical web beacons into the newsletter
and create a
personalized user profile based on my purchase and usage behavior, including sending a
notification when I have placed something in the shopping cart. Further details can be found
in
our Privacy Policy, clause 5. I understand that I can revoke my consent at any time by
emailing
[email protected].</div>
<div class="i_agree">* required fields</div>
<input type="submit" name="" id="submit_btn" value="Register">
</div>
</div>
</div>
<div id="right_block">
<h3>ALREADY REGISTERED?</h3>
<p>If you have an account with us, please log in.</p>
<form action="">
<input type="text" name="" id="email_login" class="radio_button" placeholder="Email Address *">
<input type="password" name="" id="password_login" class="radio_button" placeholder="Password *">
</form>
<p>* required fields</p>
<div><a href="./forgotPassword.html">Forgot Your Password?</a></div>
<div><button id="login_button">LOGIN</button></div>
<p>At Mytheresa, we keep your information secure. As a result, it will be necessary for you to log in to
your account before you are able to place an order or change the information on your account. You will
be asked to log in to complete your order even if you have already been greeted on the website.</p>
</div>
</div>
<div id="footer"></div>
</body>
</html>
<script type="module">
// to keep the value unchcked
// document.getElementById("agr_checkbox").checked = false
// document.getElementById("form_submit").addEventListener("submit", form_submit)
import navbar from "./navbar.js"
document.getElementById("navbar").innerHTML = navbar();
import footer from "./footer.js"
document.getElementById("footer").innerHTML = footer()
let arr = []
document.getElementById("submit_btn").addEventListener("click", submit_btn_fn)
function submit_btn_fn() {
if (document.getElementById("confirm_password").value == document.getElementById("password").value) {
var radios = document.getElementsByName('radio');
for (var radio of radios) {
if (radio.checked) {
var radio_value = radio.value;
}
}
// console.log(radio_value)
var obj = {
title: document.getElementById("select_tag").value,
radio_value: radio_value,
first_name: document.getElementById("first_name").value,
last_name: document.getElementById("last_name").value,
email: document.getElementById("email").value,
password: document.getElementById("password").value
}
console.log(document.getElementById("agr_checkbox").checked)
console.log()
// console.log(document.getElementsByClassName("radio_button").checked)
if (obj.title !== "" && document.getElementById("agr_checkbox").checked) {
arr.push(obj)
localStorage.setItem("signup_details", JSON.stringify(arr))
alert("signup SuccessFull, Please Login")
window.location.reload()
} else {
alert("please select Academic Title")
// throw new Error("Something went badly wrong!");
// console.log(obj)
}
}
else {
alert("Password doesn't match")
}
}
document.getElementById("login_button").addEventListener("click", login_btn)
function login_btn() {
let data = JSON.parse(localStorage.getItem("signup_details")) || []
// console.log(data.email)
// console.log(data)
let login_email = document.getElementById("email_login").value
let login_password = document.getElementById("password_login").value
// console.log(login_email)
let flag = false
for (let i = 0; i < data.length; i++) {
if (login_email == data[i].email && login_password == data[i].password) {
var obj = {
firstName: `${data[i].first_name}`,
lastName: `${data[i].last_name}`,
email: data[i].email
}
localStorage.setItem("userdetails", JSON.stringify(obj))
// final_username =
flag = true
}
}
if (flag == true) {
alert("login SuccessFull")
window.location.href = "index.html"
}
else {
alert("login failed")
}
}
</script>