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
<script lang="ts">
// Icons import
import { Github, Mail } from "lucide-svelte";
// Types
type LoginData = {
email: string;
password: string;
};
// Form state
let email = $state("");
let password = $state("");
let rememberMe = $state(false);
// Handlers
const preventDefault = (fn: any) => (e: any) => {
e.preventDefault();
fn(e);
};
const handleLogin = () => {
const data: LoginData = { email, password };
console.log("Login data:", data);
};
const handleGithubLogin = () => {
console.log("GitHub login clicked");
};
const handleGoogleLogin = () => {
console.log("Google login clicked");
};
</script>
<div class="min-h-screen w-full bg-gray-50 flex items-center justify-center p-4">
<div class="w-full max-w-md space-y-6 bg-white p-8 rounded-xl shadow-lg">
<!-- Logo and Title -->
<div class="text-center">
<img src="$assets/ui-dark-logo.png" alt="Logo" class="mx-auto h-12 w-auto" />
<h2 class="mt-6 text-3xl font-bold text-gray-900">Welcome back</h2>
<p class="mt-2 text-sm text-gray-600">Please sign in to your account</p>
</div>
<!-- Social Login Buttons -->
<div class="space-y-3">
<button onclick={handleGoogleLogin} class="w-full flex items-center justify-center gap-3 bg-white border border-gray-300 text-gray-700 rounded-lg p-3 hover:bg-gray-50 transition-colors">
<Mail size={20} />
Continue with Google
</button>
<button onclick={handleGithubLogin} class="w-full flex items-center justify-center gap-3 bg-gray-900 text-white rounded-lg p-3 hover:bg-gray-800 transition-colors">
<Github size={20} />
Continue with GitHub
</button>
</div>
<div class="relative">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-gray-200"></div>
</div>
<div class="relative flex justify-center text-sm">
<span class="px-2 bg-white text-gray-500">Or continue with</span>
</div>
</div>
<!-- Login Form -->
<form class="mt-8 space-y-6" onsubmit={preventDefault(handleLogin)}>
<div class="space-y-4">
<div>
<label for="email" class="block text-sm font-medium text-gray-700">Email address</label>
<input id="email" type="email" required bind:value={email} class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500" />
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-700">Password</label>
<input id="password" type="password" required bind:value={password} class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500" />
</div>
<div class="flex items-center justify-between">
<div class="flex items-center">
<input id="remember-me" type="checkbox" bind:checked={rememberMe} class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded" />
<label for="remember-me" class="ml-2 block text-sm text-gray-900">Remember me</label>
</div>
<a href="/forgot-password" class="text-sm font-medium text-indigo-600 hover:text-indigo-500">Forgot your password?</a>
</div>
</div>
<button type="submit" class="w-full flex justify-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Sign in</button>
</form>
<!-- Footer -->
<p class="text-center text-sm text-gray-600">
Don't have an account?
<a href="/signup" class="font-medium text-indigo-600 hover:text-indigo-500">Sign up</a>
</p>
</div>
</div>