-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.html
370 lines (310 loc) · 9.7 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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Signup - Primetek</title>
<link rel="icon" type="image/x-icon" href="prime-logo.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/izitoast/1.4.0/css/iziToast.min.css" integrity="sha512-O03ntXoVqaGUTAeAmvQ2YSzkCvclZEcPQu1eqloPaHfJ5RuNGiS4l+3duaidD801P50J28EHyonCV06CUlTSag==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/izitoast/1.4.0/js/iziToast.min.js" integrity="sha512-Zq9o+E00xhhR/7vJ49mxFNJ0KQw1E1TMWkPTxrWcnpfEFDEXgUiwJHIKit93EW/XxE31HSI5GEOW06G6BF1AtA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<style>
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
body{
background-image: -webkit-linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),url("index-bg.jpg");
background-size: cover !important;
background-repeat: no-repeat;
background-position: center;
background-color: rgb(28,28,28);
color: whitesmoke;
font-family: 'Poppins', sans-serif;
min-height: 100vh;
padding: 30px;
}
header{
text-align: center;
margin-bottom: 40px;
}
header h3 {
color: rgba(255, 255, 255, 0.7);
margin-bottom: 10px;
font-weight: 300;
}
#prime-logo{
width: 50px;
height: auto;
display: block;
margin: auto;
}
h1{
position: relative;
}
h1::after{
content: "";
position: absolute;
top: 110%;
left: 50%;
transform: translate(-50%);
width: 20%;
height: 2px;
background: yellow;
}
form{
color: whitesmoke;
width: 100%;
}
label{
display: flex;
height: max-content;
width: 100%;
position: relative;
margin: 15px 0;
border-bottom: 1px solid whitesmoke;
border-radius: 10px;
transition-duration: .25s;
}
label:hover {
border-bottom: 1px solid royalblue;
}
label span{
font-size: 22px !important;
opacity: .6;
/* position: absolute;
top: 5px;
left: 10px;*/
min-width: 40px; /* set a minimum width for the icon */
padding: 10px; /* make sure the icon is centered vertically */
text-align: center; /* horizontally center the icon */
}
label input{
color: whitesmoke;
width: 100%;
background: transparent;
padding: 10px 15px;
border: none;
outline: none;
transition-duration: .25s;
}
select{
display: block;
margin: 15px auto;
color: whitesmoke;
width: 480px;
max-width: 100%;
background: transparent;
padding: 10px 40px;
border: none;
border-bottom: 1px solid whitesmoke;
border-radius: 10px;
outline: none;
}
button{
background-image: linear-gradient(to left, purple, royalblue);
border: 1px solid whitesmoke;
border-radius: 30px;
color: whitesmoke;
outline: none;
padding: 10px;
width: 100%;
margin-top: 30px;
margin-bottom: 30px;
font-size: 1em;
}
button:active{
opacity: .6;
}
p{
margin-top: 16px;
text-align: center;
opacity: .8;
font-size: 10px;
}
#p-login{
font-size: 12px;
}
a{
color: royalblue;
}
</style>
</head>
<body>
<header>
<h3>Welcome to Primetek!</h3>
<img id="prime-logo" src="prime-logo.png" alt="">
<h1>Register</h1>
</header>
<main>
<form id="form" action="login.html" name="signupForm" method="POST" netlify>
<label for="firstname">
<span class="material-icons">
person_outline
</span>
<input id="firstName" name="firstname" type="text" placeholder="First Name">
</label>
<label for="lastname">
<span class="material-icons">
person_outline
</span>
<input id="lastName" name="lastname" type="text" placeholder="Last Name">
</label>
<label for="phone">
<span class="material-icons">
phone
</span>
<input id="phone" name="phone-number" type="number" placeholder="Phone Number">
<div id="error"></div>
</label>
<label for="password">
<span class="material-icons">
lock
</span>
<input id="password" name="password" type="password" placeholder="Password">
</label>
<label>
<span class="material-icons">
lock
</span>
<input id="cpassword" name="confirm-password" type="password" placeholder="Confirm Password">
</label>
<label for="invite">
<span class="material-icons">
verified_user
</span>
<input id="invite_code" name="invite_code" type="number" placeholder="Invitation Code">
</label>
<button onclick="storeMe()" id="signup" type="button">Sign up</button>
</form>
<p id="p-login"> Already have account? <a href="login.html">Login.</a></p>
<p>
By signing up to this website, you agree to our <a href="terms.html">Terms & Conditions</a>
</p>
</main>
<footer>
</footer>
<script>
"use strict";
const url = new URLSearchParams(window.location.search);
const id = url.get('id');
const inviteCode = document.getElementById('invite_code');
inviteCode.value = id;
if(inviteCode.value == ""){
inviteCode.readOnly = false;
}
else{
inviteCode.readOnly = true;
}
</script>
<script>
iziToast.settings({
timeout: 3000,
resetOnHover: true,
transitionIn: 'flipInX',
transitionOut: 'flipOutX',
position: 'topRight',
onOpening: function() {
console.log('callback abriu!');
},
onClosing: function() {
console.log("callback fechou!");
}
});
const form = document.getElementById('form')
function storeMe() {
var firstname = document.getElementById('firstName').value;
var lastname = document.getElementById('lastName').value;
var phone = document.getElementById('phone').value;
var password = document.getElementById('password').value;
var confirmPassword = document.getElementById('cpassword').value;
/* if (localStorage.getItem('userphone') || localStorage.getItem('userpassword')) {
iziToast.error({
title: 'Error!',
message: 'You are already a member! Creating multiple accounts is discouraged!',
});
}
else*/ if (firstname === "") {
iziToast.error({
title: 'Error!',
message: 'Please enter your first name!'
});
//alert('Please enter your first name')
}
else if (lastname === "") {
iziToast.error({
title: 'Error!',
message: 'Please enter your last name!'
});
//alert('Please enter your last name!')
}
else if (phone === "") {
iziToast.error({
title: 'Error!',
message: 'Please enter your phone number!'
});
// alert('Please enter your phone number!')
}
else if (phone.length < 10 || phone.length > 11) {
iziToast.error({
title: 'Error!',
message: 'Your phone number must be 10 or 11 characters long!'
});
//alert('Your phone number is not correct!')
}
else if (password === "") {
iziToast.error({
title: 'Error!',
message: 'Please enter a strong password!'
});
//alert('Please enter your password!')
}
else if (password.length !== 8) {
iziToast.error({
title: 'Error!',
message: 'Your password must be 8 characters long!'
});
// alert('Your password must be 8 characters long!')
}
else if (confirmPassword === "") {
iziToast.error({
title: 'Error!',
message: 'Please enter your password again to confirm!'
});
//alert('Please enter your password again to confirm!')
}
else if (confirmPassword !== password) {
iziToast.error({
title: 'Error!',
message: 'Password does not match!'
});
//alert('Password does not match!')
}
else {
localStorage.setItem('username', firstname);
localStorage.setItem('userlastname', lastname);
localStorage.setItem('userphone', phone);
localStorage.setItem('userpassword', password);
var today = new Date();
var date = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = date + ' ' + time;
var signUpDate = dateTime;
localStorage.setItem('signUpDate', signUpDate);
iziToast.success({
title: 'Congrats',
message: 'Registration completed!',
});
//alert('Registration completed!');
setTimeout(submitForm, 2500);
}
}
function submitForm() {
form.submit();
//window.location.replace("login.html");
}
</script>
<!--<script src="number-validator.js"></script>-->
</body>
</html>