forked from dikshaa2000/shop.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.html
163 lines (134 loc) · 4.59 KB
/
login.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
<!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">
<!-- GOOGLE FONT -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Oswald&family=Roboto&display=swap" rel="stylesheet">
<!-- FONTAWESOME -->
<script src="https://kit.fontawesome.com/40ce6520f1.js" crossorigin="anonymous"></script>
<title>Document</title>
<link rel="stylesheet" href="styles/index.css"> <!-- CSS FOR HEADER & FOOTER -->
<style>
.container {
display: flex;
flex-direction: row;
gap: 45px;
/* border: 1px solid rgb(107, 41, 41); */
width: 70%;
height: 300px;
margin: auto;
margin-top: 150px;
margin-bottom: 20px;
}
#right {
/* border: 1px solid #ff0000; */
width: 40%;
height: 100%;
font-family: sans-serif;
font-size: 15px;
color: #202340;
padding-top: 50px;
}
#create_btn:hover {
background-color: rgb(52, 52, 117);
color: white;
cursor: pointer;
}
#create_btn {
background-color: white;
padding: 10.4px;
border: 0.5px solid red;
width: 65%;
font-size: 16px;
font-weight: bold;
}
#signin_btn {
background-color: rgb(52, 52, 117);
color: white;
width: 100%;
font-family: sans-serif;
padding: 10.4px;
font-size: 16px;
margin: 20px 0px 10px;
cursor: pointer;
border: none;
border-radius: 2px;
}
#password, #email {
padding: 10px;
width: 280px;
margin: 5px 5px 0px 0px;
background-color: white;
border-radius: 2px;
border: 0.5px solid #202340;
}
label {
font-family: sans-serif;
color: #202340;
}
#right>p>u:hover {
color: aqua;
cursor: pointer;
}
</style>
</head>
<body>
<!-- HEADER COMP START -->
<div id="header-import-div">
</div>
<!-- HEADER COMP END -->
<div class="container">
<div id="left">
<h1>Sign in</h1>
<label>
Email address:</br>
<input type="email" id="email" placeholder="yourname@example.com">
</label>
</br> <label> Password:
<br>
<input type="text" id="password" placeholder="Please enter your password">
</label>
</br>
<label><u>Forgot your Password?</u></label>
</br>
</br>
<input id="signin_btn" type="submit" value="Sign In" />
</div>
<div id="right">
<h2>Don't have an account?</h2>
<p>With a SHOP.COM account, you can enjoy the following benefits: up to 50%
<span><img src="https://img.shop.com/Image/resources/images/cashback-icon.svg" width="15px" alt=""></span> Cashback on eligible purchases, redeem discount coupons, order status and history, saved payment options and addresses, exclusive
emails and more. <u>Learn more</p>
</u>
<input id="create_btn" type="submit" value="Create your new account" />
</div>
</div>
<!-- FOOTER COMP START -->
<div id="footer-import-div">
</div>
<!-- FOOTER COMP END-->
</body>
</html>
<script src="scripts/index.js" type="module"></script>
<script>
document.querySelector("#signin_btn").addEventListener("click", signIN);
var regUser = JSON.parse(localStorage.getItem("userDatabase"));
function signIN() {
// alert("hello")
var email = document.getElementById("email").value;
var password = document.getElementById("password").value;
for (i = 0; i < regUser.length; i++) {
if (regUser[i].email == email && regUser[i].password == password) {
alert("User Successfully Login");
localStorage.setItem("islogin","true");
window.location.href = "index.html";
} else {
alert("User Successfully Not Login")
}
}
}
</script>