-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
251 lines (208 loc) · 10.7 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="Styles/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<title>login logout</title>
</head>
<body>
<div class="container" id="container">
<div class="form-container sign-up-container mobileView onSignInButtonClickShow">
<div class="form">
<div class="row">
<div class="col-12">
<h1>Create Account</h1>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="social-container">
<a href="#" class="social"><i class="fab fa-github"></i></a>
<a href="#" class="social"><i class="fab fa-google-plus-g"></i></a>
<a href="#" class="social"><i class="fab fa-linkedin-in"></i></a>
</div>
</div>
<div class="col-12">
<span>or use your email for registration</span>
</div>
</div>
<div class="row">
<!-- <input autocomplete="rutjfkde" onfocus="fieldReset(event)" type='text' data-language='en' class="datepicker-here" data-position="top left"
id="dob" name=""> -->
<input onnput="nameValidate(event)" class="inputBox" id="nameSignUp" type="text" placeholder="Name:" />
<input oninput="emailVerify(event)" class="inputBox" id="emailSignUp" type="email" placeholder="Email:" />
<input id="dobSignUp" data-language='en' placeholder="DOB:" type='text' class="datepicker-here"
data-position="top left" style="border : none; border-bottom : 1px solid #e6e3e3" />
<div style="text-align: left; width : 100%;font-weight: 100;color: #797979;margin-top: 3px">
Gender:
</div>
<div style="text-align: left;margin-top:8px;margin-left:3px">
<select id="genderSignUp" style="width: 100%;height: 30px;border: none;border-bottom: 1px solid #e6e3e3; background : white;outline: none; border-radius : 0" name="Gender">
<option value="Male" selected>Male</option>
<option value="Female">Female</option>
</select>
</div>
<input id="experienceSignUp" class="inputBox" type="number" placeholder="Experience(Yrs)" />
<input id="domainSignUp" class="inputBox" type="text" placeholder="Domain" />
<input oninput="verifyPassword(event)" id="passwordSignUp" class="inputBox" type="password" placeholder="Password" />
<input oninput="matchPassword(event)" id="conformPassword" class="inputBox" type="password" placeholder="Confirm Password" />
</div>
<div>
</div>
<button id="signup">Sign Up</button>
</div>
</div>
<div class="form-container sign-in-container mobileView showOnSignIn">
<div class="form">
<h1>Sign in</h1>
<div class="social-container">
<a href="#" class="social"><i class="fab fa-github"></i></a>
<a href="#" class="social"><i class="fab fa-google-plus-g"></i></a>
<a href="#" class="social"><i class="fab fa-linkedin-in"></i></a>
</div>
<span>or use your account</span>
<input oninput="emailVerify(event)" class="inputBox" id="email" type="email" placeholder="Email" />
<input oninput="verifyPassword(event)" class="inputBox" id="password" type="password" placeholder="Password" />
<a href="Html/forgetPassword.html">Forgot your password?</a>
<button id="signInButton" class="signIn">Sign In</button>
<div class="showOnMobile">
<p>
Or
</p>
<button class="signUpButton">Sign Up</button>
</div>
</div>
</div>
<div class="overlay-container mobileDisplayNone">
<div class="overlay">
<div style="position: absolute; left : 0;top:5px; display: inline-block;margin-left:5px">
<img style="height: 100px;width: 100px;" src="Assets/whiteLogo.svg" alt="Quadro">
</div>
<!-- <div style="display: inline-block;top:0; position: absolute; left : 50px;top:5px; line-height: 100px">
Quadro
</div> -->
<div class="overlay-panel overlay-left">
<h1>Create New Account</h1>
<!-- <p>To keep connected with us please login with your personal info</p> -->
<a style="margin-top:120px" href="Html/forgetPassword.html">forget password?</a>
<button style="margin-top:20px" class="ghost" id="signIn">Already have an account?</button>
</div>
<div class="overlay-panel overlay-right">
<div style="position: absolute; left : 0;top:5px; display: inline-block;margin-left:5px">
<img style="height: 100px;width: 100px;" src="Assets/whiteLogo.svg" alt="Quadro">
</div>
<!-- <div style="display: inline-block;top:0; position: absolute;top:5px; left : 50px; line-height: 100px">
Quadro
</div> -->
<h1>Hey, Welcome Back!</h1>
<a style="margin-top:120px" href="forgetPassword.html">forget password?</a>
<!-- <p>Enter your personal details and start journey with us</p> -->
<button style="margin-top:20px" class="ghost" id="signUp">Create new account?</button>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('#signInButton').click(function () {
var email = $('#email').val();
var password = $('#password').val();
let status = [];
if (password < 6){
status.push("false");
document.getElementById("password").style.borderColor = "red";
document.getElementById("password").placeholder = "Please enter valid input";
} else {
status.push("true");
}
if(status.includes("false")){
return false
} else {
// fetch call
fetch("https://dscquadro.herokuapp.com/auth/login", {
method: "post",
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
//make sure to serialize your JSON body
body: JSON.stringify({
email,
password,
})
})
.then((response) => {
return response.json()
//do something awesome that makes the world a better place
})
.then(data => {
// let token = data.token;
console.log("hi get token from here", data.token);
sessionStorage.setItem("token", data.token)
if (data.token) {
window.location.href = "Html/homePage.html";
} else {
console.log("Maa chuda")
}
})
}
});
console.log("Hello")
$('.signUpButton').click(function () {
console.log("Bye")
$('.showOnSignIn').css("display", "none");
$('.onSignInButtonClickShow').css("display", "block");
});
$('#signup').click(function () {
console.log("hey sign me up")
var email = $('#emailSignUp').val();
var name = $('#nameSignUp').val();
var dob = $('#dobSignUp').val();
var gender = $('#genderSignUp').val();
var experience = $('#experienceSignUp').val();
var domain = $('#domainSignUp').val();
var password = $('#passwordSignUp').val();
fetch("https://dscquadro.herokuapp.com/auth/signup", {
method: "post",
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
//make sure to serialize your JSON body
body: JSON.stringify({
name,
email,
dob,
gender,
password,
experience,
domain,
})
})
.then((response) => {
return response.json()
console.log("hey sign me2 up");
//do something awesome that makes the world a better place
})
.then(data => console.log("ghnjk",data.message))
});
});
</script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin="anonymous"></script>
<script src="Js/app.js"></script>
</body>
</html>