-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.html
More file actions
161 lines (135 loc) · 5.31 KB
/
signup.html
File metadata and controls
161 lines (135 loc) · 5.31 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description"
content="Create your Mink Luxe account to book luxury lash extensions and brow lamination." />
<title>Mink Luxe — Sign Up</title>
<link rel="stylesheet" href="css/style.css" />
<style>
body {
overflow: hidden;
}
.signup-logo {
width: 48px !important;
height: 48px !important;
margin-bottom: 0.5rem !important;
}
.signup-card {
padding: 1rem 1.25rem !important;
}
.signup-card .card-form {
padding: 0.5rem 0.75rem !important;
}
.signup-card h1 {
font-size: 1.2rem;
}
@media (max-height: 780px) {
body {
overflow: auto;
}
}
</style>
</head>
<body>
<div id="nav-root"></div>
<div class="page-center">
<div class="card card-compact anim-fade-up signup-card" id="signupCard">
<!-- Logo -->
<div class="logo-area">
<a href="index.html" aria-label="Mink Luxe home">
<img src="img/Mink Luxe (revamp).jpg" alt="Mink Luxe logo" class="logo-img anim-pulse signup-logo" />
</a>
</div>
<h1 class="text-center" style="margin-bottom: 1px;">Create Account</h1>
<p class="text-center" style="font-size: 0.8rem; margin-bottom: 0.4rem;">Join Mink Luxe and book your beauty
sessions</p>
<!-- Signup Form -->
<div class="card-form">
<form id="signupForm" style="display: grid; gap: 8px;" novalidate>
<div class="field">
<label for="fullname">Full Name</label>
<input id="fullname" type="text" name="fullname" required autocomplete="name" placeholder="Jane Doe" />
</div>
<div class="field">
<label for="email">Email</label>
<input id="email" type="email" name="email" required autocomplete="email" placeholder="you@example.com" />
</div>
<div class="field">
<label for="password">Password</label>
<div style="position: relative;">
<input id="password" type="password" name="password" required autocomplete="new-password"
placeholder="Min 6 characters" />
<button type="button" class="password-toggle" id="togglePass">👁️</button>
</div>
</div>
<button type="submit" class="btn btn-primary btn-full mt-1" id="submitBtn">Sign Up</button>
</form>
</div>
<!-- Social Login -->
<div class="divider" style="margin: 0.4rem 0;">or continue with</div>
<div style="display: grid; gap: 8px;">
<button class="social-btn" id="googleBtn">
<img src="https://www.svgrepo.com/show/355037/google.svg" alt="Google" />
Sign Up with Google
</button>
<button class="social-btn" id="appleBtn">
<img src="https://simpleicons.org/icons/apple.svg" alt="Apple" style="filter: invert(1); height: 20px;" />
Sign Up with Apple
</button>
</div>
<p class="text-center mt-2" style="font-size: 0.9rem; color: var(--text-secondary);">
Already have an account? <a href="login.html">Login</a>
</p>
</div>
</div>
<script src="js/utils.js"></script>
<script src="js/navbar.js"></script>
<script>
setupPasswordToggle(document.getElementById('togglePass'), document.getElementById('password'));
setupCardTilt(document.getElementById('signupCard'));
document.getElementById('signupForm').addEventListener('submit', async (e) => {
e.preventDefault();
const form = e.target;
const fullname = document.getElementById('fullname').value.trim();
const email = document.getElementById('email').value.trim();
const password = document.getElementById('password').value.trim();
if (!fullname || !email || !password) {
shakeElement(form.closest('.card-form'));
showToast('Please fill in all fields');
return;
}
if (password.length < 6) {
shakeElement(form.closest('.card-form'));
showToast('Password must be at least 6 characters');
return;
}
const btn = document.getElementById('submitBtn');
btn.disabled = true;
btn.textContent = 'Creating account...';
try {
const res = await fetch('signup_process.php', { method: 'POST', body: new FormData(form) });
const data = await res.json();
if (data.success) {
setLocalUser({ fullname, email, role: 'user' });
showToast('Account created! Redirecting...');
spawnConfetti(window.innerWidth / 2, window.innerHeight / 3, 30);
setTimeout(() => { window.location.href = 'bookings.html'; }, 1800);
} else {
showToast(data.message || 'Signup failed', 3000);
shakeElement(form.closest('.card-form'));
btn.disabled = false;
btn.textContent = 'Sign Up';
}
} catch (err) {
showToast('Network error: ' + err.message);
btn.disabled = false;
btn.textContent = 'Sign Up';
}
});
document.getElementById('googleBtn').addEventListener('click', () => showToast('Google signup coming soon!'));
document.getElementById('appleBtn').addEventListener('click', () => showToast('Apple signup coming soon!'));
</script>
</body>
</html>