-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsignUp.html
218 lines (214 loc) · 6.12 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
<!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" />
<!-- script file of font awesome -->
<script src="https://kit.fontawesome.com/63c7c4276d.js" crossorigin="anonymous"></script>
<title>Sign-up</title>
<link rel="icon" href="https://shesheshow.com/wp-content/uploads/2019/07/GLobe-2.jpg">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
}
#logoStrip {
display: flex;
justify-content: center;
align-items: center;
height: 48px;
box-shadow: 0px 1px 0px 0px rgb(0 11 38 / 12%);
}
#logoStrip img {
width: 135px;
}
#formContainer {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
form > div:first-child {
text-align: left;
padding: 24px 0 12px;
color: #141d38;
}
form {
display: flex;
flex-direction: column;
padding: 0 1.5rem;
max-width: 28rem;
}
input {
margin: 12px 0;
padding: 16px 12px;
border-radius: 0.5rem;
border: 1px solid #727483;
}
.checkBoxDiv {
display: flex;
align-items: center;
font-size: 14px;
margin: 10px 0 0;
}
.checkBoxDiv2 {
margin: 15px 0 15px;
/* border: 1px solid #000; */
}
.checkBox {
width: 18px;
height: 18px;
margin-right: 10px;
}
.checkBox:hover {
cursor: pointer;
}
.checkBoxDiv + div {
font-size: 14px;
}
p {
margin-top: 10px;
font-size: 14px;
}
.termsAndCondition {
color: #3662d8;
}
.termsAndCondition:hover {
text-decoration: underline;
}
#submit {
background-color: #3662d8;
color: #fff;
font-weight: bold;
font-size: 18px;
}
#submit:hover {
cursor: pointer;
}
form > div:last-child {
margin: 10px auto 0;
}
form > div:last-child > a {
color: #3662d8;
text-decoration: none;
}
form > div:last-child > a:hover {
text-decoration: underline;
}
.fa-solid {
position: fixed;
top: 10px;
left: 10px;
color: #3662d8;
}
#continueWith{
width: 100%;
padding: 24px 24px 0;
}
#continueWith > div {
margin: 8px auto 24px;
max-width: 101px;
font-size: 14px;
}
#continueWith > div:last-child {
max-width: 90px;
display: flex;
justify-content: space-between;
}
</style>
</head>
<body>
<div id="logoStrip">
<a href="index.html">
<i class="fa-solid fa-2x fa-arrow-left"></i>
</a>
<a href="index.html">
<img src="https://www.expedia.co.in/_dms/interstitial/logo.svg?locale=en_GB&siteid=27" alt=""/>
</a>
</div>
<div id="formContainer">
<form>
<div>
<h1>Create an account</h1>
</div>
<input type="email" id="email" placeholder="Email address" required />
<input type="text" id="firstName" placeholder="First name" required />
<input type="text" id="Surname" placeholder="Surname" required />
<input type="password" id="password" placeholder="Password" />
<div class="checkBoxDiv">
<input type="checkbox" class="checkBox" />
<span>Keep me signed in</span>
</div>
<div>
Selecting this checkbox will keep you signed into your account on this
device until you sign out. Do not select this on shared devices.
</div>
<div class="checkBoxDiv2">
<input type="checkbox" class="checkBox" />
<span
>I'd like to receive travel deals, special offers and other
information from Expedia via email.</span
>
</div>
<div>
<p>
By creating an account, I agree to the Expedia
<span class="termsAndCondition">Terms and Conditions</span>,
<span class="termsAndCondition">Privacy Statement</span> and
<span class="termsAndCondition">Expedia Rewards Terms and Conditions</span>
.
</p>
</div>
<input type="submit" value="Continue" id="submit" />
<div>Already have an a account? <a href="signin.html">Sing in</a></div>
</form>
</div>
<div id="continueWith">
<div>or continue with</div>
<div>
<i class="fa-brands fa-lg fa-apple"></i>
<i class="fa-brands fa-lg fa-facebook-square"></i>
<i class="fa-brands fa-lg fa-google"></i>
</div>
</div>
</body>
</html>
<script>
let formTag = document.querySelector("form");
formTag.addEventListener("submit", getDataFromSignUp);
let userArrFromSignUp = JSON.parse(localStorage.getItem("signupData")) || [];
//function to get data from sign up form and store it in localStorage.
function getDataFromSignUp() {
event.preventDefault();
let userObjFromSignUp = {
signUpEmail: formTag.email.value,
signUpFirstName: formTag.firstName.value,
signUpSurname: formTag.Surname.value,
signUpPassword: formTag.password.value,
};
if (checkIfEmailExists(userObjFromSignUp.signUpEmail)) {
userArrFromSignUp.push(userObjFromSignUp);
localStorage.setItem("signupData", JSON.stringify(userArrFromSignUp));
alert(
"Signup successful. Please sign in to continue"
);
window.location.href = "signIn.html";
} else {
alert("Account already exists with this email");
}
}
//function that checks if the account with same email is exist or not.
function checkIfEmailExists(email) {
let filtered = userArrFromSignUp.filter(function (elem) {
return elem.signUpEmail === email;
});
if (filtered.length > 0) {
return false;
} else {
return true;
}
}
</script>