-
Notifications
You must be signed in to change notification settings - Fork 1
/
signin.html
76 lines (63 loc) · 2.07 KB
/
signin.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
<!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>Singin Page</title>
<style>
.body {
background-color: lightsalmon;
}
.signin {
/* border: 1px solid black; */
height: 500px;
width: 50%;
margin: auto;
text-align: center;
background-color: white;
margin-top: 150px;
justify-content: center;
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}
.form>input {
height: 30px;
border-radius: 2.5px;
outline: none;
width: 88%;
border: 1px solid;
margin-top: 7%;
padding-top: 1%;
}
</style>
</head>
<body id="body">
<div class="signin">
<!---signcon-->
<h1>SIGN IN</h1>
<form class="form">
<input id="mail" type="text" placeholder="Enter Email ID">
<input id="passwd" type="password" placeholder="Enter Password">
<input type="submit" value="Sign In">
</form>
</div>
</body>
</html>
<script>
document.querySelector("form").addEventListener("submit", formSubmit);
var userData = JSON.parse(localStorage.getItem("DataOfUsers"));
function formSubmit(event) {
event.preventDefault();
var email = document.querySelector("#mail").value;
var Password = document.querySelector("#passwd").value;
if (userData.mail == email && userData.passwd == Password) {
alert("login successful")
window.location.href = "footballProducts.html"
} else if (userData.mail == email && userData.passwd !== Password || userData.mail !== email && userData.passwd == Password) {
alert("Wrong ID or Password");
window.location.href = "signin.html";
} else {
alert("create an account First");
}
}
</script>