<script setup>
import { ref } from 'vue';
import { Head, router, useForm } from '@inertiajs/vue3';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Checkbox } from '@/components/ui/checkbox';
const form = useForm({
email: '',
password: '',
remember: false,
});
const submit = () => {
form.post('/login', {
onFinish: () => form.reset('password'),
});
};
</script>
<template>
<Head title="??????" />
<div class="min-h-screen flex items-center justify-center bg-gray-100 dark:bg-gray-900 p-4">
<div class="w-full max-w-md">
<!-- Logo/Header -->
<div class="text-center mb-8">
<div class="inline-flex items-center justify-center w-16 h-16 rounded-xl bg-primary text-primary-foreground mb-4">
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4" />
</svg>
</div>
<h1 class="text-2xl font-bold text-gray-900 dark:text-white">Ticker</h1>
<p class="text-gray-500 dark:text-gray-400 mt-1">??????</p>
</div>
<!-- Form Card -->
<div class="bg-white dark:bg-gray-800 rounded-xl shadow-lg border border-gray-200 dark:border-gray-700 p-8">
<form @submit.prevent="submit" class="space-y-6">
<!-- Email -->
<div>
<label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2">
??-?????
</label>
<Input
id="email"
type="email"
v-model="form.email"
class="w-full"
:class="{ 'border-red-500': form.errors.email }"
placeholder="your@email.com"
autofocus
autocomplete="username"
/>
<p v-if="form.errors.email" class="mt-1 text-sm text-red-500">
{{ form.errors.email }}
</p>
</div>
<!-- Password -->
<div>
<label for="password" class="block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2">
??????
</label>
<Input
id="password"
type="password"
v-model="form.password"
class="w-full"
:class="{ 'border-red-500': form.errors.password }"
autocomplete="current-password"
/>
<p v-if="form.errors.password" class="mt-1 text-sm text-red-500">
{{ form.errors.password }}
</p>
</div>
<!-- Remember Me -->
<div class="flex items-center gap-2">
<Checkbox
id="remember"
v-model:checked="form.remember"
/>
<label for="remember" class="text-sm text-gray-600 dark:text-gray-300 cursor-pointer">
????????????
</label>
</div>
<!-- Submit Button -->
<Button
type="submit"
class="w-full"
:disabled="form.processing"
>
<svg v-if="form.processing" class="animate-spin -ml-1 mr-2 h-4 w-4" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
??????
</Button>
</form>
<!-- Register Link -->
<div class="mt-6 text-center">
<p class="text-sm text-gray-500 dark:text-gray-400">
?? ????? ?????????
<a href="/register" class="text-primary hover:underline font-medium">
???????????
</a>
</p>
</div>
</div>
</div>
</div>
</template>
|