-
Notifications
You must be signed in to change notification settings - Fork 1
/
sign-up.html
201 lines (177 loc) · 12.3 KB
/
sign-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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Memory Lane - Sign Up</title>
<!--CSS-->
<link rel="stylesheet" href="./dist/output.css">
<!--ICONS-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/fonts/remixicon.min.css">
<!--Fonts-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Jost:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.min.css">
<script type="module" src="./js/sign-up.js" defer></script>
<style>
.hidden { display: none; }
</style>
</head>
<body class="bg-gray-100">
<!--Navbar-->
<header class="sticky top-0 h-[90px] shadow-xl z-30 bg-white">
<div class="container mx-auto flex justify-between h-full items-center">
<a href="#">
<img src="./assets/logo.jpeg" alt="Memory Lane Logo" class="w-[200px]">
</a>
<nav>
<div class="cursor-pointer lg:hidden " id="nav_trigger_btn">
<i class="ri-menu-4-line text-4xl text-primary"></i>
</div>
<ul class="fixed w-full h-0 p-0 bg-white overflow-hidden border-t top-[90px] left-0 right-0 flex flex-col gap-4 lg:relative lg:flex-row lg:p-0 lg:top-0 lg:border-none lg:h-full transition-all duration-300" id="nav_menu">
<li class="p-2"><a href="./index.html">Home</a></li>
<li class="p-2"><a href="./index.html#about">About</a></li>
<li class="p-2"><a href="./index.html#contact">Contact Us</a></li>
<button class="btn-accent w-[120px] h-[50px] lg:p-0 p-2 rounded-lg"><a href="./sign-up.html" class="text-white hover:text-black">Sign In</a></button>
</ul>
</nav>
</div>
</header>
<!-- Sign Up & Login Forms Section -->
<main class="flex justify-center items-center min-h-screen bg-white font-secondary">
<div class="container mx-auto px-4 lg:px-0">
<div class="flex flex-col items-center justify-between gap-16 bg-white p-8 shadow-lg rounded-lg">
<!-- Sign Up Form -->
<div id="sign-up-form" class="w-full">
<h2 class="text-2xl font-semibold mb-6 text-primary text-center font-secondary">Create Your Account</h2>
<form action="#" method="post" class="space-y-4">
<div class="text-green-500 p-2 m-2 font-semibold" id="signUpMessage" style="display: none;"></div>
<div>
<label for="fullname" class="block mb-2 text-md font-medium text-gray-700">Full Name</label>
<input type="text" id="fullname" class="w-full p-3 bg-gray-50 border border-gray-300 rounded-lg shadow-sm focus:ring-primary focus:border-primary text-md" placeholder="Full name" required>
</div>
<div>
<label for="email" class="block mb-2 text-md font-medium text-gray-700">Email</label>
<input type="email" id="email" class="w-full p-3 bg-gray-50 border border-gray-300 rounded-lg shadow-sm focus:ring-primary focus:border-primary text-md" placeholder="Enter your email" required>
</div>
<div class="relative">
<label for="password" class="block mb-2 text-md font-medium text-gray-700">Password</label>
<input type="password" id="password" class="w-full p-3 bg-gray-50 border border-gray-300 rounded-lg shadow-sm focus:ring-primary focus:border-primary text-md" placeholder="Create a password" required>
<!-- Eye icon -->
<i id="togglePassword" class="ri-eye-off-fill absolute right-4 cursor-pointer text-2xl text-gray-500" style="margin-top: 15px;"></i>
</div>
<!-- Age Input -->
<div>
<label for="age" class="block mb-2 text-md font-medium text-gray-700">Age</label>
<input type="number" id="age" class="w-full p-3 bg-gray-50 border border-gray-300 rounded-lg shadow-sm focus:ring-primary focus:border-primary text-md" placeholder="Enter your age" required>
</div>
<!-- Gender Dropdown -->
<div>
<label for="gender" class="block mb-2 text-md font-medium text-gray-700">Gender</label>
<select id="gender" class="w-full p-3 bg-gray-50 border border-gray-300 rounded-lg shadow-sm focus:ring-primary focus:border-primary text-md" required>
<option value="">Select Gender</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>
</div>
<!-- New Dropdown for 'Sign Up As' -->
<div>
<label for="signup-role" class="block mb-2 text-md font-medium text-gray-700">Sign Up As</label>
<select id="signup-role" class="w-full p-3 bg-gray-50 border border-gray-300 rounded-lg shadow-sm focus:ring-primary focus:border-primary text-md">
<option value="caretaker">Caretaker</option>
<option value="patient">Patient</option>
<option value="doctor">Doctor</option>
</select>
</div>
<!-- Doctor Selection Dropdown (hidden by default) -->
<div id="doctor-dropdown-container" class="hidden mt-4">
<label for="doctor-selection" class="block mb-2 text-md font-medium text-gray-700">Select Doctor</label>
<select id="doctor-selection" class="w-full p-3 bg-gray-50 border border-gray-300 rounded-lg shadow-sm focus:ring-primary focus:border-primary text-md">
<!-- Doctors will be populated here dynamically -->
</select>
</div>
<!-- patient Selection Dropdown (hidden by default) -->
<div id="patient-dropdown-container" class="hidden">
<label for="patient-selection">Select Patient:</label>
<select id="patient-selection" class="form-select mt-1 block w-full">
<option value="">Select a patient</option>
</select>
</div>
<!-- License Number Input for Doctors (hidden by default) -->
<div id="license-number-container" class="hidden mt-4">
<label for="license-number" class="block mb-2 text-md font-medium text-gray-700">License Number</label>
<input type="text" id="license-number" class="w-full p-3 bg-gray-50 border border-gray-300 rounded-lg shadow-sm focus:ring-primary focus:border-primary text-md" placeholder="Enter your license number">
</div>
<button type="submit" id="submitSignUp" class="w-full py-3 px-5 bg-accent text-white text-center rounded-lg font-medium focus:ring-4 focus:outline-none focus:ring-primary-300">Sign Up</button>
</form>
<p class="mt-4 text-center text-md text-gray-600">Already have an account? <a href="#" id="show-login" class="text-primary font-semibold text-md">Login</a></p>
</div>
<!-- Login Form -->
<div id="login-form" class="w-full hidden">
<h2 class="text-2xl font-semibold mb-6 text-primary text-center font-secondary">Welcome Back!</h2>
<div id="signInMessage" class="hidden text-green-500 p-2 m-2 font-semibold" style="display: none;"></div>
<form action="#" method="post" class="space-y-4">
<div>
<label for="login-email" class="block mb-2 text-md font-medium text-gray-700">Email</label>
<input type="email" id="login-email" class="w-full p-3 bg-gray-50 border border-gray-300 rounded-lg shadow-sm focus:ring-primary focus:border-primary text-md" placeholder="Enter your email" required>
</div>
<div class="relative">
<label for="login-password" class="block mb-2 text-md font-medium text-gray-700">Password</label>
<input type="password" id="login-password" class="w-full p-3 bg-gray-50 border border-gray-300 rounded-lg shadow-sm focus:ring-primary focus:border-primary text-md" placeholder="Create a password" required>
<i id="togglePassword" class="ri-eye-off-fill absolute right-4 cursor-pointer text-2xl text-gray-500" style="margin-top: 15px;"></i>
</div>
<div>
<label for="login-role" class="block mb-2 text-md font-medium text-gray-700">Login As</label>
<select id="login-role" class="w-full p-3 bg-gray-50 border border-gray-300 rounded-lg shadow-sm focus:ring-primary focus:border-primary text-md">
<option value="patient">Patient</option>
<option value="caretaker">Caretaker</option>
<option value="doctor">Doctor</option>
</select>
</div>
<button type="submit" class="w-full py-3 px-5 bg-accent text-white text-center rounded-lg font-medium focus:ring-4 focus:outline-none focus:ring-primary-300" id="loginsubmit">Login</button>
</form>
<p class="mt-4 text-center text-md text-gray-600">Don't have an account? <a href="#" id="show-sign-up" class="text-primary font-semibold text-md">Sign Up</a></p>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="bg-white py-8">
<div class="w-full max-w-screen-xl mx-auto text-center">
<p class="text-gray-500 text-sm">© 2022 Memory Lane™. All Rights Reserved.</p>
</div>
</footer>
<!--JavaScript-->
<script src="./js/main.js"></script>
<script>
const showLoginLink = document.getElementById('show-login');
const showSignUpLink = document.getElementById('show-sign-up');
const signUpForm = document.getElementById('sign-up-form');
const loginForm = document.getElementById('login-form');
// Switch to login form
showLoginLink.addEventListener('click', function (e) {
e.preventDefault();
signUpForm.classList.add('hidden');
loginForm.classList.remove('hidden');
});
// Switch to sign up form
showSignUpLink.addEventListener('click', function (e) {
e.preventDefault();
loginForm.classList.add('hidden');
signUpForm.classList.remove('hidden');
});
const togglePassword = document.getElementById('togglePassword');
const password = document.getElementById('password');
togglePassword.addEventListener('click', function () {
// Toggle the type attribute between 'password' and 'text'
const type = password.getAttribute('type') === 'password' ? 'text' : 'password';
password.setAttribute('type', type);
// Toggle the eye icon between eye-fill and eye-off-fill
this.classList.toggle('ri-eye-fill');
this.classList.toggle('ri-eye-off-fill');
});
</script>
</body>
</html>