-
Notifications
You must be signed in to change notification settings - Fork 2
/
emailsignup.html
108 lines (87 loc) · 2.95 KB
/
emailsignup.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
<!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>Document</title>
<style>
body{
background-color: rgb(252, 243, 223);
}
#main{
height:600px;
width:70%;
text-align: center;
margin:auto;
background-color: white;
box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;;
padding: 10px;
}
h3{
color: rgb(128, 210, 235);
margin-bottom: 30px;
margin-top: 30px;
}
#h1_log{
margin-bottom: 80px;
margin-top: 80px;
}
#email{
padding: 15px 40px;
font-size: 30px;
margin-bottom: 40px;
}
#pass{
padding: 15px 40px;
font-size: 30px;
}
#SIGN{
border: 0px;
border-radius: 10px;
padding: 15px 200px;
font-size: 30px;
background-color: gray;
color:white;
margin-top: 20px;
}
*:focus{
outline: none;
}
</style>
</head>
<body>
<div id="main">
<h1 id="h1_log">Log in to your account</h1>
<form id="form" action="">
<input id="email" type="mail" placeholder="Enter email" required>
<br>
<input id="pass" type="password" placeholder="Enter password" required>
<br>
<input id="SIGN" type="submit" value="SIGN IN">
</form>
<h1 id="show_res"></h1>
<h3>Forgot Password?</h3>
</div>
</body>
</html>
<script>
document.querySelector("#form").addEventListener("submit",checkFunc)
function checkFunc(){
event.preventDefault()
var userData = JSON.parse(localStorage.getItem("saveSignup"))
let iemail=document.getElementById("email").value;
let ipass=document.getElementById("pass").value;
for(var i=0 ;i<userData.length ;i++)
{ if(iemail==userData[i].email && ipass==userData[i].password)
{
// document.querySelector("#show_res").innerHTML="Login success";
// document.querySelector("#show_res").style.color="green"
}
else{
document.querySelector("#show_res").innerHTML="wrong credentials";
document.querySelector("#show_res").style.color="red"
}
}
}
</script>