-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForgotPassword.html
More file actions
233 lines (200 loc) · 9.41 KB
/
Copy pathForgotPassword.html
File metadata and controls
233 lines (200 loc) · 9.41 KB
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forgot-Password</title>
</head>
<body>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f9; /* Light background color */
}
main {
max-width: 400px; /* Increased max width for the main container */
margin: 2rem auto 35vh; /* Centering the main section */
padding: 2rem;
background-color: #ffffff; /* White background for the form */
box-shadow: 0 2px 10px #4a90e2; /* Subtle shadow effect */
border-radius: 8px; /* Rounded corners */
display: flex; /* Use flexbox for main content */
text-align: center;
justify-content: center;
}
form {
display: flex;
flex-direction: column; /* Stack inputs vertically */
}
input {
margin-bottom: 1rem; /* Space between inputs */
padding: 0.8rem; /* Padding inside inputs */
border: 1px solid #ccc; /* Border style */
border-radius: 4px; /* Rounded corners */
font-size: 1rem; /* Font size for inputs */
}
input:focus {
border-color: #4a90e2; /* Change border color on focus */
outline: none; /* Remove default outline */
}
button {
padding:0.8rem;
border: none; /* Remove default button border */
background-color: #4a90e2; /* Button background color */
color: white; /* Button text color */
cursor: pointer; /* Pointer cursor on hover */
font-size: 1rem; /* Font size for button */
border-radius: 4px; /* Rounded corners */
margin-bottom: 10px;
}
button:hover {
background-color: #3e79c1; /* Darker shade on hover */
}
h2 {
color: #4a90e2; /* Subtitle color */
text-align: center;
}
footer {
background-color: #4a90e2;
color: white;
padding: 0.5rem; /* Reduced padding */
text-align: center;
position: relative;
bottom: 0;
width: 100%;
}
footer .container {
display: flex;
flex-direction: row; /* Changed from column to row */
justify-content: space-between;
align-items: center;
padding: 0; /* Removed padding */
}
footer .container div {
padding: 0 1rem; /* Added padding */
}
footer ul {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 0;
}
footer li {
margin: 0 1rem;
list-style: none;
}
footer svg {
width: 20px; /* Reduced icon size */
height: 20px;
fill: #ffffff;
}
@media screen and (max-width: 768px) {
footer .container {
flex-direction: column;
align-items: center;
}
}
</style>
<!-- Forgot Password Form -->
<main id="forgot-password-main">
<form action="/forgotpassword" method="post" id="forgot-password-form">
<h2>Forgot Password</h2>
<label for="Email">Email</label>
<input type="email" id="email" name="email" required>
<button type="submit">Submit</button>
</form>
</main>
<!-- Rset Password Form -->
<main id="reset-password-main" style="display: none;">
<form action="/resetpassword" method="post" id="reset-password-form" >
<h2>Reset Password</h2>
<label for="password">New Password:</label>
<input type="password" name="newPassword" id="new-password" required>
<label for="password">Confirm Password:</label>
<input type="password" name="confirmPassword" id="confirm-password" required>
<button type="submit">Reset Password</button>
</form>
</main>
<!-- <footer></footer> -->
<footer>
<div class="container">
<div class="flex flex-wrap justify-center">
<div class="w-full lg:w-1/2">
<h3 class="text -lg font-bold">About Us</h3>
<p class="text -sm">We are dedicated to advancing communications in space exploration.</p>
</div>
</div>
<div class="w-full lg:w-1/2">
<h3 class="text -lg font-bold">Follow Us</h3>
<ul class="flex justify-center">
<li><a href="https://twitter.com/mathew" target="_blank" rel="noopener noreferrer" class="icon-link">
<svg class="w-6 h-6" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M22.46 6c-.77.35-1.6.58-2.46.68a4.29 4.29 0 001.88-2.36 8.58 8.58 0 01-2.73 1.04 4.29 4.29 0 00-7.3 3.91 12.16 12.16 0 01-8.84-4.48c-.33.57-.52 1.23-.52 1.93 0 1.34.68 2.52 1.71 3.21a4.28 4.28 0 01-1.94-.54v.05c0 1.85 1.32 3.4 3.07 3.76-.32.09-.66.14-1.01.14-.24 0-.47-.02-.7-.06.48 1.48 1.88 2.56 3.54 2.59a8.59 8.59 0 01-5.31 1.83c-.35 0-.69-.02-1.03-.06a12.12 12.12 0 006.57 1.93c7.88 0 12.2-6.54 12.2-12.2 0-.18 0-.37-.01-.55A8.76 8.76 0 0024 6.3a8.63 8.63 0 01-2.54.7 4.32 4.32 0 001.8-2.4z"></path>
</svg>
</a></li>
<li><a href="https://facebook.com/mathewoloyedepage" target="_blank" rel="noopener noreferrer" class="icon-link">
<svg class="w-6 h-6" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M22.68 0H1.32C.593 0 0 .593 0 1.32v21.36C0 23.407.593 24 1.32 24h11.5v-9.293H9.297V11.25h3.513V8.825c0-3.375 1.964-5.25 4.898-5.25 1.5 0 2.784.111 3.153.162v3.637l-2.156.001c-1.688 0-2.007.802-2.007 1.976v2.586h4.016l-.524 3.457h-3.492V24h6.854c.727 0 1.32-.593 1.32-1.32V1.32C24 .593 23.407 0 22.68 0z"></path>
</svg>
</a></li>
<li>
<a href="https://linkedin.com/in/mathewoloyede" target="_blank" rel="noopener noreferrer" class="icon-link">
<svg class="w-6 h-6" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M24 0v24H0V0h24zm-6 20h-3.5v-5.5c0-1.3-.025-3-1.825-3-1.835 0-2.125 1.43-2.125 2.903V20h-3.5V9h3.5v1.5h.05c.49-.934 1.695-1.917 3.5-1.917 3.13 0 4.125 2.272 4.125 5.27V20zM5 8H3.5V20H5V8zm-1.25-6.5C2.41 1.5 1 2.91 1 4.5S2.4 7 4.25 7c1.84 0 3.25-1.5 3.25-2.5S6.09 1.5 4.25 1.5z"></path>
</svg>
</a>
</li>
<li>
<a href="https://youtube.com/c/Mathewoloyede" target="_blank" rel="noopener noreferrer" class="icon-link">
<svg class="w-6 h-6" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M23.498 6.186a3.004 3.004 0 0 0-2.11-2.11C19.338 3.998 12 3.998 12 3.998s-7.338 0-9.388.078a3.004 3.004 0 0 0-2.11 2.11C0 8.237 0 12 0 12s0 3.763.502 5.814a3.004 3.004 0 0 0 2.11 2.11C4.662 20.002 12 20.002 12 20.002s7.338 0 9.388-.078a3.004 3.004 0 0 0 2.11-2.11C24 15.763 24 12 24 12s0-3.763-.502-5.814zm-13.998 8.578V9.236l6.716 3.264-6.716 3.264z"></path>
</svg>
</a>
</li>
</ul>
</div>
<p>© 2024 Earth-Space Communication App</p>
</div>
</footer>
<script>
// Forgot Password Form Submission
document.getElementById('forgot-password-form').addEventListener('submit', async (e) => {
e.preventDefault();
const email =document.getElementById("email").value;
const response = await fetch('/forgot-password', {
method: 'POST',
headers: { 'Content-Type': 'application/json'},
body: JSON.stringify({ email })
});
const message = await response.text();
alert(message);
});
// Reset Password Form Submission
document.getElementById('reset-passord-form').addEventListener('submit', async (e) => {
e.preventDefault();
const token = new URLSearchParams(window.location.search).get('token');
const newPassword = document.getElementById('new-password').value;
const confirmPassword = document.getElementById('confirm-password').value;
if (newPassword !== confirmPassword) {
alert('Passwords do not match');
return;
}
const response = await fetch('/reset-password', {
method: 'POST',
headers: { 'Content-Type': 'application/json'},
body: JSON.stringify({ token, newPassword })
});
const message = await response.text();
alert(message);
});
// Show Reset Password Form if token is present in URL
const token = new URLSearchParams(window.location.search).get('token');
if (token) {
document.getElementById('reset-password-main').style.display ='flex';
document.getElementById('forgot-passowrd-main').style.display ='none';
}
</script>
</body>
</html>