-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathforgot-password.html
More file actions
332 lines (296 loc) · 12.6 KB
/
forgot-password.html
File metadata and controls
332 lines (296 loc) · 12.6 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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iNCIgZmlsbD0iIzBmMDA4MSIvPgo8Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxMiIgZmlsbD0iI2ZmOGMwMCIgc3Ryb2tlPSIjZmZmZmZmIiBzdHJva2Utd2lkdGg9IjIiLz4KPHBhdGggZD0iTTEwIDEySDIyVjE4SDEwVjEyWiIgZmlsbD0iI2ZmZmZmZiIvPgo8Y2lyY2xlIGN4PSIxNiIgY3k9IjE0IiByPSIxLjUiIGZpbGw9IiMwZjAwODEiLz4KPHBhdGggZD0iTTE0IDI0QzE0IDI2LjIwOTEgMTUuNzkwOSAyOCAxOCAyOEMyMC4yMDkxIDI4IDIyIDI2LjIwOTEgMjIgMjQiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KPC9zdmc+">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="forgot-password.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.css">
<script src="https://unpkg.com/feather-icons"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<title>Forgot Password - Finance Tracker</title>
</head>
<body>
<!-- Skip to main content for accessibility -->
<a href="#main-content" class="skip-link">Skip to main content</a>
<nav role="navigation" aria-label="Main navigation">
<div class="navbar">
<a href="./index.html" class="logo"><i class="fas fa-chart-line"></i> Finance Tracker</a>
<ul class="nav-links">
<li><a href="./index.html" class="active">Home</a></li>
<li><a href="./index.html#tracker">Use Tracker</a></li>
<li><a href="./index.html#how-it-works">How it Works</a></li>
<li><a href="./index.html#invite">Community</a></li>
<li><a href="./support.html">Support</a></li>
</ul>
<!-- Search Bar -->
<div class="search-container">
<div class="search-bar">
<i class="fas fa-search search-icon" aria-hidden="true"></i>
<input type="text" id="search-input" placeholder="Search" class="search-input" aria-label="Search the website" role="searchbox">
<div class="search-shortcut" aria-label="Press Ctrl+K or Cmd+K to search">
<span class="shortcut-key">⌘</span>
<span class="shortcut-key">K</span>
<span class="shortcut-separator">/</span>
<span class="shortcut-key">Ctrl</span>
<span class="shortcut-key">K</span>
</div>
</div>
</div>
<div class="buttons">
<a href="./login.html" class="btn-head"><i class="fas fa-sign-in-alt"></i> Log In</a>
<a href="./sign-up.html" class="btn-head"><i class="fas fa-user-plus"></i> Sign Up</a>
</div>
<div class="menu-toggle" id="menu-toggle" aria-label="Toggle navigation menu" role="button" tabindex="0">
<i class="fas fa-bars" aria-hidden="true"></i>
</div>
</div>
</nav>
<!-- Forgot Password Hero Section -->
<section class="forgot-hero">
<div class="forgot-hero-content">
<div class="forgot-hero-text">
<h1>Reset Your Password</h1>
<p>Don't worry! Enter your email address and we'll send you a link to reset your password.</p>
<div class="forgot-benefits">
<div class="benefit-item">
<i class="fas fa-shield-alt"></i>
<span>Secure Process</span>
</div>
<div class="benefit-item">
<i class="fas fa-clock"></i>
<span>Quick Recovery</span>
</div>
<div class="benefit-item">
<i class="fas fa-envelope"></i>
<span>Email Instructions</span>
</div>
</div>
</div>
<div class="forgot-hero-image">
<div class="floating-card forgot-card-1">
<i class="fas fa-key"></i>
<h3>Secure Reset</h3>
<p>Encrypted process</p>
</div>
<div class="floating-card forgot-card-2">
<i class="fas fa-paper-plane"></i>
<h3>Email Sent</h3>
<p>Check your inbox</p>
</div>
<div class="floating-card forgot-card-3">
<i class="fas fa-lock"></i>
<h3>New Password</h3>
<p>Set secure password</p>
</div>
</div>
</div>
</section>
<!-- Forgot Password Form Section -->
<section class="forgot-container">
<div class="forgot-form-wrapper">
<div class="forgot-form-header">
<h2>Enter your email address</h2>
<p>We'll send you a secure link to reset your password</p>
</div>
<form class="modern-forgot-form" action="/forgot-password" method="post" id="forgot-form">
<div class="form-group">
<label for="email">
<i class="fas fa-envelope"></i>
Email Address <span>*</span>
</label>
<input type="email" id="email" name="email" required placeholder="Enter your registered email address">
</div>
<div class="form-group">
<label for="captcha">
<i class="fas fa-robot"></i>
Security Check
</label>
<div class="captcha-container">
<div class="captcha-display" id="captcha-display">7 + 3 = ?</div>
<input type="text" id="captcha" name="captcha" placeholder="Enter the answer" required>
<button type="button" class="captcha-refresh" id="captcha-refresh" aria-label="Refresh captcha">
<i class="fas fa-sync-alt"></i>
</button>
</div>
</div>
<div class="checkbox-group">
<label class="checkbox-label">
<input type="checkbox" required>
<span class="checkmark"></span>
I understand that I will receive a password reset email
</label>
</div>
<button type="submit" class="forgot-btn">
<i class="fas fa-paper-plane"></i>
Send Reset Link
</button>
</form>
<div class="forgot-footer">
<p>Remember your password? <a href="./login.html">Back to Login</a></p>
<p>Don't have an account? <a href="./sign-up.html">Create Account</a></p>
</div>
</div>
</section>
<!-- Success Modal -->
<div class="success-modal" id="success-modal" role="dialog" aria-labelledby="success-title" aria-hidden="true">
<div class="modal-content">
<div class="modal-header">
<i class="fas fa-check-circle"></i>
<h3 id="success-title">Email Sent Successfully!</h3>
</div>
<div class="modal-body">
<p>We've sent a password reset link to your email address. Please check your inbox and follow the instructions to reset your password.</p>
<div class="modal-actions">
<button class="modal-btn primary" onclick="closeSuccessModal()">Got it</button>
<button class="modal-btn secondary" onclick="resendEmail()">Resend Email</button>
</div>
</div>
</div>
</div>
<footer role="contentinfo">
<div class="footer-container">
<div class="footer-content">
<div class="footer-section">
<div class="footer-logo">
<i class="fas fa-chart-line"></i>
<h3>Finance Tracker</h3>
</div>
<p class="footer-description">
Take control of your finances with our comprehensive personal finance tracking tool.
Manage your income, expenses, and financial goals effortlessly.
</p>
<div class="social-links">
<a href="#" class="social-link"><i class="fab fa-github"></i></a>
<a href="#" class="social-link"><i class="fab fa-linkedin"></i></a>
<a href="#" class="social-link"><i class="fab fa-twitter"></i></a>
<a href="#" class="social-link"><i class="fab fa-facebook"></i></a>
</div>
</div>
<div class="footer-section">
<h4>Quick Links</h4>
<ul class="footer-links">
<li><a href="./index.html#tracker">Use Tracker</a></li>
<li><a href="./index.html#how-it-works">How it Works</a></li>
<li><a href="./index.html#invite">Community</a></li>
<li><a href="./support.html">Support</a></li>
</ul>
</div>
<div class="footer-section">
<h4>Resources</h4>
<ul class="footer-links">
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Terms of Service</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#">Help Center</a></li>
</ul>
</div>
<div class="footer-section">
<h4>Contact Info</h4>
<div class="contact-info">
<p><i class="fas fa-envelope"></i> support@financetracker.com</p>
<p><i class="fas fa-phone"></i> +1 (555) 123-4567</p>
<p><i class="fas fa-map-marker-alt"></i> New York, NY</p>
</div>
</div>
</div>
<div class="footer-bottom">
<div class="footer-bottom-content">
<p>© 2025 Finance Tracker. All rights reserved.</p>
<p class="developer-credit">Created by <strong>Neeraj Meena</strong> - Full Stack MERN Developer</p>
</div>
</div>
</div>
</footer>
<script>feather.replace();</script>
<script src="script.js"></script>
<script>
// Forgot Password specific functionality
document.addEventListener('DOMContentLoaded', function() {
// Initialize captcha
generateCaptcha();
// Form submission
const form = document.getElementById('forgot-form');
form.addEventListener('submit', function(e) {
e.preventDefault();
handleForgotPassword();
});
// Captcha refresh
document.getElementById('captcha-refresh').addEventListener('click', generateCaptcha);
// Real-time email validation
const emailInput = document.getElementById('email');
emailInput.addEventListener('blur', function() {
validateEmail(this);
});
// Close modal when clicking outside
const modal = document.getElementById('success-modal');
modal.addEventListener('click', function(e) {
if (e.target === modal) {
closeSuccessModal();
}
});
});
function generateCaptcha() {
const num1 = Math.floor(Math.random() * 10) + 1;
const num2 = Math.floor(Math.random() * 10) + 1;
const operation = Math.random() > 0.5 ? '+' : '-';
let question, answer;
if (operation === '+') {
question = `${num1} + ${num2} = ?`;
answer = num1 + num2;
} else {
const larger = Math.max(num1, num2);
const smaller = Math.min(num1, num2);
question = `${larger} - ${smaller} = ?`;
answer = larger - smaller;
}
document.getElementById('captcha-display').textContent = question;
document.getElementById('captcha').setAttribute('data-answer', answer);
}
function handleForgotPassword() {
const email = document.getElementById('email').value;
const captchaAnswer = document.getElementById('captcha').value;
const correctAnswer = document.getElementById('captcha').getAttribute('data-answer');
// Validate captcha
if (parseInt(captchaAnswer) !== parseInt(correctAnswer)) {
showErrorMessage('Please solve the security check correctly');
return;
}
// Show loading state
const submitBtn = document.querySelector('.forgot-btn');
showLoadingState(submitBtn, 'button');
// Simulate API call
setTimeout(() => {
hideLoadingState(submitBtn, 'button');
showSuccessModal();
}, 2000);
}
function showSuccessModal() {
const modal = document.getElementById('success-modal');
modal.style.display = 'flex';
modal.setAttribute('aria-hidden', 'false');
}
function closeSuccessModal() {
const modal = document.getElementById('success-modal');
modal.style.display = 'none';
modal.setAttribute('aria-hidden', 'true');
}
function resendEmail() {
closeSuccessModal();
showSuccessMessage('Reset email sent again!');
}
function validateEmail(input) {
const email = input.value.trim();
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (email && !emailRegex.test(email)) {
showFieldError(input, 'Please enter a valid email address');
return false;
} else {
clearFieldError(input);
return true;
}
}
</script>
</body>
</html>