feat: optimize auth frontend with premium glassmorphism and AuthLayout

This commit is contained in:
2026-01-23 19:39:21 +07:00
parent 69d187be66
commit 762746859c
3 changed files with 247 additions and 195 deletions

View File

@@ -1,11 +1,12 @@
import InputError from '@/Components/InputError';
import GuestLayout from '@/Layouts/GuestLayout';
import AuthLayout from '@/Layouts/AuthLayout';
import { Head, Link, useForm } from '@inertiajs/react';
import { FormEventHandler } from 'react';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/Components/ui/card';
import { Label } from '@/Components/ui/label';
import { Input } from '@/Components/ui/input';
import { Button } from '@/Components/ui/button';
import { UserPlus, ArrowLeft } from 'lucide-react';
export default function Register() {
const { data, setData, post, processing, errors, reset } = useForm({
@@ -24,101 +25,103 @@ export default function Register() {
};
return (
<GuestLayout>
<Head title="Register" />
<AuthLayout>
<Head title="Registrasi Peserta Didik" />
<div className="flex flex-col items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
<Card className="w-full max-w-md border-gray-100 shadow-2xl rounded-3xl overflow-hidden">
<CardHeader className="space-y-1 text-center pt-8">
<CardTitle className="text-3xl font-extrabold tracking-tight">Buat Akun Baru</CardTitle>
<CardDescription className="text-gray-500">
Mulai petualangan belajarmu hari ini
</CardDescription>
</CardHeader>
<CardContent className="pb-8">
<form onSubmit={submit} className="space-y-6">
<Card className="border-white/10 bg-white/40 dark:bg-black/40 backdrop-blur-2xl shadow-[0_24px_48px_-12px_rgba(0,0,0,0.1)] rounded-[2.5rem] overflow-hidden">
<CardHeader className="space-y-1 text-center pt-10 pb-6 px-8">
<CardTitle className="text-3xl font-black tracking-tight text-foreground flex items-center justify-center gap-3">
Hajimemashou! <span className="animate-pulse"></span>
</CardTitle>
<CardDescription className="text-muted-foreground font-medium text-xs uppercase tracking-widest pt-2">
Pendaftaran Peserta Didik LPK NihonBuzz
</CardDescription>
</CardHeader>
<CardContent className="px-8 pb-10">
<form onSubmit={submit} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="name" className="text-[10px] font-black uppercase tracking-widest text-muted-foreground ml-1">Nama Lengkap Siswa</Label>
<Input
id="name"
name="name"
value={data.name}
className="h-14 rounded-2xl bg-white/50 dark:bg-black/50 border-white/20 focus:ring-nihonbuzz-red/20 focus:border-nihonbuzz-red transition-all"
autoComplete="name"
placeholder="Masukkan nama lengkap Anda"
onChange={(e) => setData('name', e.target.value)}
required
/>
<InputError message={errors.name} />
</div>
<div className="space-y-2">
<Label htmlFor="email" className="text-[10px] font-black uppercase tracking-widest text-muted-foreground ml-1">Alamat Email</Label>
<Input
id="email"
type="email"
name="email"
value={data.email}
className="h-14 rounded-2xl bg-white/50 dark:bg-black/50 border-white/20 focus:ring-nihonbuzz-red/20 focus:border-nihonbuzz-red transition-all"
autoComplete="username"
placeholder="email@contoh.com"
onChange={(e) => setData('email', e.target.value)}
required
/>
<InputError message={errors.email} />
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4 pt-1">
<div className="space-y-2">
<Label htmlFor="name">Nama Lengkap</Label>
<Label htmlFor="password" className="text-[10px] font-black uppercase tracking-widest text-muted-foreground ml-1">Password</Label>
<Input
id="name"
name="name"
value={data.name}
className="block w-full"
autoComplete="name"
placeholder="Nama Lengkap Anda"
onChange={(e) => setData('name', e.target.value)}
id="password"
type="password"
name="password"
value={data.password}
className="h-14 rounded-2xl bg-white/50 dark:bg-black/50 border-white/20 focus:ring-nihonbuzz-red/20 focus:border-nihonbuzz-red transition-all"
autoComplete="new-password"
onChange={(e) => setData('password', e.target.value)}
required
/>
<InputError message={errors.name} />
<InputError message={errors.password} />
</div>
<div className="space-y-2">
<Label htmlFor="email">Email</Label>
<Label htmlFor="password_confirmation" className="text-[10px] font-black uppercase tracking-widest text-muted-foreground ml-1">Konfirmasi</Label>
<Input
id="email"
type="email"
name="email"
value={data.email}
className="block w-full"
autoComplete="username"
placeholder="nama@email.com"
onChange={(e) => setData('email', e.target.value)}
id="password_confirmation"
type="password"
name="password_confirmation"
value={data.password_confirmation}
className="h-14 rounded-2xl bg-white/50 dark:bg-black/50 border-white/20 focus:ring-nihonbuzz-red/20 focus:border-nihonbuzz-red transition-all"
autoComplete="new-password"
onChange={(e) => setData('password_confirmation', e.target.value)}
required
/>
<InputError message={errors.email} />
<InputError message={errors.password_confirmation} />
</div>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div className="space-y-2">
<Label htmlFor="password">Password</Label>
<Input
id="password"
type="password"
name="password"
value={data.password}
className="block w-full"
autoComplete="new-password"
onChange={(e) => setData('password', e.target.value)}
required
/>
<InputError message={errors.password} />
</div>
<div className="pt-6">
<Button className="w-full h-16 rounded-[1.5rem] text-base font-black shadow-2xl shadow-nihonbuzz-red/20 bg-nihonbuzz-red hover:bg-nihonbuzz-red/90 transition-all hover:scale-[1.02] active:scale-[0.98] group" disabled={processing}>
Daftar Sekarang <UserPlus className="ml-2 w-5 h-5 group-hover:rotate-12 transition-transform" />
</Button>
</div>
<div className="space-y-2">
<Label htmlFor="password_confirmation">Konfirmasi</Label>
<Input
id="password_confirmation"
type="password"
name="password_confirmation"
value={data.password_confirmation}
className="block w-full"
autoComplete="new-password"
onChange={(e) => setData('password_confirmation', e.target.value)}
required
/>
<InputError message={errors.password_confirmation} />
</div>
</div>
<div className="pt-2">
<Button className="w-full py-6 rounded-2xl text-base font-bold shadow-lg shadow-nihonbuzz-red/20 bg-nihonbuzz-red hover:bg-nihonbuzz-red/90" disabled={processing}>
Daftar Sekarang
</Button>
</div>
<div className="text-center text-sm text-gray-500">
Sudah punya akun?{' '}
<div className="text-center pt-4">
<p className="text-xs text-muted-foreground font-medium">
Sudah memiliki akun LPK?{' '}
<Link
href={route('login')}
className="text-nihonbuzz-red font-bold hover:underline"
className="text-nihonbuzz-red font-black hover:underline uppercase tracking-widest text-[10px] ml-1"
>
Masuk Saja
<ArrowLeft className="inline-block w-3 h-3 mr-1" /> Kembali Masuk
</Link>
</div>
</form>
</CardContent>
</Card>
</div>
</GuestLayout>
</p>
</div>
</form>
</CardContent>
</Card>
</AuthLayout>
);
}