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
/** @jsxImportSource https://esm.sh/hono@latest/jsx */
export default function SignupModal() {
return (
<div id="signup-modal" className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 animate-fadeIn">
<div className="bg-white rounded-lg shadow-xl p-8 w-full max-w-md mx-4 mt-4 mb-0">
<div className="flex flex-col gap-1 mb-4">
<h2 className="text-xl font-bold">Create Your Profile</h2>
<p className="text-sm text-neutral-800">
Already have an account?{' '}
<a
hx-get="/loginModal"
hx-target="#signup-modal"
hx-swap="outerHTML"
className="text-blue-500 hover:underline cursor-pointer"
>
Login
</a>
</p>
</div>
<form action="/signup" method="POST" className="flex flex-col gap-4">
<div>
<label htmlFor="username" className="text-md font-medium text-neutral-800">Username</label>
<input id="username" type="text" name="username" placeholder="Username" required className="mt-1 w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" />
</div>
<div>
<label htmlFor="email" className="text-md font-medium text-neutral-800">Email</label>
<input id="email" type="email" name="email" placeholder="Email" required className="mt-1 w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" />
</div>
<div>
<label htmlFor="password" className="text-md font-medium text-neutral-800">Password</label>
<input id="password" type="password" name="password" placeholder="Password" required className="mt-1 w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" />
</div>
<button type="submit" className="w-full bg-blue-100 border-2 py-2 mt-2 border-blue-700 rounded-md font-bold text-blue-900 uppercase tracking-wider hover:bg-blue-200">
Sign Up
</button>
</form>
<button
onclick="document.getElementById('signup-modal').style.display='none';" className="w-full bg-red-100 border-2 py-2 border-red-700 rounded-md font-bold text-red-900 uppercase tracking-wider hover:bg-red-200 cursor-pointer"
>
Close
</button>
</div>
</div>
);
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
May 22, 2024