forked from vimistify/AmbuFlow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathup.html
81 lines (73 loc) · 3.33 KB
/
up.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign Up</title>
<link rel="stylesheet" href="src/css/up.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" />
<style>
.toggle-password {
cursor: pointer;
position: absolute;
right: 10px;
top: 35px;
}
.form-group {
position: relative;
}
</style>
</head>
<body>
<div class="signup-container">
<h1>Create Your Account</h1>
<form id="signupForm">
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" name="username" required>
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" name="password" required>
<i class="fas fa-eye toggle-password" id="togglePassword" onclick="togglePassword('password', this)"></i>
</div>
<div class="form-group">
<label for="confirm-password">Confirm Password</label>
<input type="password" id="confirm-password" name="confirm-password" required>
<i class="fas fa-eye toggle-password" id="toggleConfirmPassword" onclick="togglePassword('confirm-password', this)"></i>
</div>
<button type="submit">Sign Up</button>
</form>
<p>Already have an account? <a href="login.html">Log In</a></p>
</div>
<script>
document.getElementById('signupForm').addEventListener('submit', function(event) {
event.preventDefault();
// Dummy signup logic for demo purposes
const username = document.getElementById('username').value;
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
// Store the signup data
localStorage.setItem('username', username);
localStorage.setItem('email', email);
localStorage.setItem('password', password);
localStorage.setItem('isLoggedIn', 'true');
alert('Signup successful!');
window.location.href = 'ambtracker.html'; // Redirect to tracker page
});
function togglePassword(fieldId, icon) {
const field = document.getElementById(fieldId);
const isPassword = field.type === 'password';
// Toggle between 'password' and 'text'
field.type = isPassword ? 'text' : 'password';
// Change the icon class between eye and eye-slash
icon.classList.toggle('fa-eye-slash', isPassword);
icon.classList.toggle('fa-eye', !isPassword);
}
</script>
</body>
</html>