forked from GarimaSingh0109/Resum-Resume
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.html
215 lines (171 loc) · 6.6 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login - LinkedIn Resume Builder</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="icon" href="images/favicon-removebg-preview.png">
<style>
:root {
--deep-teal: #003d4d;
--off-white: #f8f9fa;
--dark-slate: #2f4f4f;
--soft-gold: #d9c79e;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Verdana, Geneva, Tahoma, sans-serif;
outline: none;
text-decoration: none;
text-transform: capitalize;
transition: .2s linear;
}
body {
background-color: var(--off-white);
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
flex-direction: column;
}
.container {
background-color: white;
padding: 40px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
max-width: 400px;
width: 100%;
text-align: center;
position: relative; /* Allow footer positioning */
}
.logo {
font-size: 2rem; /* Adjusted size for single line */
color: var(--deep-teal);
font-weight: 600;
margin-bottom: 20px;
cursor: pointer; /* Change cursor to pointer */
}
.logo:hover {
color: var(--soft-gold); /* Change color on hover */
}
h2 {
color: var(--dark-slate);
margin-bottom: 20px;
}
input[type="email"],
input[type="password"] {
width: 100%;
padding: 12px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
width: 100%;
padding: 15px;
background-color: var(--deep-teal);
color: white;
border: none;
border-radius: 4px;
font-size: 18px;
cursor: pointer;
margin-top: 10px; /* Added margin for spacing */
}
button:hover {
background-color: var(--soft-gold);
}
.signup-btn {
background-color: var(--soft-gold);
margin-top: 10px;
}
.signup-btn:hover {
background-color: var(--deep-teal);
}
.footer {
margin-top: 20px; /* Space between container and footer */
text-align: center;
width: 100%; /* Ensure the footer takes full width */
background-color: var(--deep-teal); /* Background color for the footer */
color: white; /* Text color */
padding: 13px 0; /* Padding for spacing */
position: absolute; /* Positioning at the bottom */
bottom: 0; /* Align to the bottom */
}
.footer p {
color: #fff; /* Text color for footer */
font-size: 14px;
padding-top: 1rem;
}
.footer a {
color: var(--soft-gold);
text-decoration: none;
}
.footer a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<div class="logo" onclick="window.location.href='index.html'">Resum Resume</div>
<h2>Log In to Your Account</h2>
<form action="#" method="POST">
<input type="email" placeholder="Email Address " id="email" required>
<input type="password" placeholder="Password" id="password" required>
<button type="submit" id="signinbtn">Log In</button>
<form id="loginForm" action="#" method="POST">
<input type="email" placeholder="Email Address" required>
<input type="password" placeholder="Password" required>
<button type="submit">Log In</button>
</form>
<button class="signup-btn" onclick="window.location.href='signup.html'">Go to Signup</button>
</div>
<div class="footer">
<p>Powered by Resume Builder © 2024</p>
</div>
<script>
const signin = document.querySelector("#signinbtn");
signin.addEventListener("click",(e)=>{
e.preventDefault();
const email = document.querySelector("#email").value;
const password = document.querySelector("#password").value;
if( ! email || !password ){
alert(" all feilds required");
return;
}
const userData = {
email,password
}
loginUser(userData);
});
const loginUser =async (user)=>{
try{
const res = await fetch("http://localhost:5000/auth/signin",{
method:"POST",
credentials:"include",
redirect:"follow",
headers:{"content-type":"application/json"},
body:JSON.stringify(user)
});
if(!res.ok){
alert(" Incorrect Credentails");
return
}
const data = await res.json();
alert("Login Successfull")
window.location.href = "http://127.0.0.1:5500/Resum-Resume/index.html";
}catch(error){
console.log(error.message);
alert(" check the credentails")
}
}
</script>
</body>
</html>