forked from GarimaSingh0109/Resum-Resume
-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.html
217 lines (179 loc) · 6.8 KB
/
signup.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign Up - LinkedIn Resume Builder</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
<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;
border: 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; /* Added for vertical alignment */
}
.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;
}
.logo {
font-size: 2rem; /* Decreased 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="text"],
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;
}
button:hover {
background-color: var(--soft-gold);
}
.login-btn {
background-color: var(--soft-gold);
margin-top: 10px;
}
.login-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: 30px 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;
}
.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>Create Your Account</h2>
<form action="#" method="POST">
<input id="name" type="text" placeholder="Full Name" required>
<input id="email" type="email" placeholder="Email Address" required>
<input id="password" type="password" placeholder="Password" required>
<input id="confirmPassword" type="password" placeholder="Confirm Password" required>
<button type="submit" class="signupbtn">Sign Up</button>
<form id="signupForm" action="#" method="POST">
<input type="text" placeholder="Full Name" required>
<input type="email" placeholder="Email Address" required>
<input type="password" placeholder="Password" required>
<input type="password" placeholder="Confirm Password" required>
<button type="submit">Sign Up</button>
</form>
<button class="login-btn" onclick="window.location.href='login.html'">Go to Login</button>
</div>
<div class="footer">
<p>Powered by Resume Builder © 2024</p>
</div>
<script>
const signUp = document.querySelector(".signupbtn");
signUp.addEventListener("click",(e)=>{
e.preventDefault();
const name = document.querySelector("#name").value;
const email = document.querySelector("#email").value;
const password = document.querySelector("#password").value;
const confirmPassword =document.querySelector("#confirmPassword").value;
if(!name || ! email || !password || ! confirmPassword){
alert(" all feilds required");
return;
}
const userData = {
name,email,password,confirmPassword
}
registerUser(userData);
});
const registerUser =async (user)=>{
try{
const res = await fetch("http://localhost:5000/auth/signup",{
method:"POST",
headers:{"content-type":"application/json"},
body:JSON.stringify(user)
});
const data = await res.json();
window.location.href = "http://127.0.0.1:5500/Resum-Resume/login.html";
}catch(error){
console.log(error.message);
alert(" check the credentails")
document.getElementById('signupForm').addEventListener('submit', function(event) {
event.preventDefault();
var formData = new FormData(this);
fetch('signup-process.php', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
if (data.success) {
window.location.href = 'index.html';
} else {
alert('Sign Up failed: ' + data.message);
}
}
</script>
</body>
</html>