feat: optimize auth frontend with premium glassmorphism and AuthLayout

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

View File

@@ -0,0 +1,45 @@
import { ThemeProvider } from "@/Components/ThemeProvider";
import { Link } from "@inertiajs/react";
import React from "react";
export default function AuthLayout({ children }: { children: React.ReactNode }) {
return (
<ThemeProvider defaultTheme="dark" storageKey="nihonbuzz-theme">
<div className="min-h-screen bg-background relative overflow-hidden flex items-center justify-center p-4">
{/* Background Decorations - Pure CSS */}
<div className="absolute inset-0 z-0">
<div className="absolute top-[-10%] left-[-10%] w-[40%] h-[40%] bg-nihonbuzz-red/5 rounded-full blur-[100px]" />
<div className="absolute bottom-[-10%] right-[-10%] w-[40%] h-[40%] bg-nihonbuzz-red/10 rounded-full blur-[100px]" />
{/* Minimalist Japanese Pattern Overlay (CSS-based) */}
<div className="absolute inset-0 opacity-[0.03] dark:opacity-[0.05]"
style={{
backgroundImage: `radial-gradient(circle at 2px 2px, currentColor 1px, transparent 0)`,
backgroundSize: '40px 40px'
}}
/>
</div>
<div className="w-full max-w-[440px] z-10 space-y-8 animate-in fade-in zoom-in duration-700">
<div className="flex flex-col items-center text-center space-y-2">
<Link href="/" className="mb-4">
<div className="w-16 h-16 bg-nihonbuzz-red rounded-[2rem] flex items-center justify-center shadow-2xl shadow-nihonbuzz-red/20 rotate-12 hover:rotate-0 transition-transform duration-500">
<span className="text-white font-black text-2xl tracking-tighter">NB</span>
</div>
</Link>
<h2 className="text-sm font-black text-nihonbuzz-red uppercase tracking-[0.3em]">LPK NihonBuzz</h2>
<p className="text-xs text-muted-foreground font-medium uppercase tracking-widest">Kurasu Academy Digital Platform</p>
</div>
{children}
<div className="text-center">
<p className="text-[10px] text-muted-foreground/50 font-bold uppercase tracking-widest">
&copy; {new Date().getFullYear()} LPK NihonBuzz Academy. All Rights Reserved.
</p>
</div>
</div>
</div>
</ThemeProvider>
);
}

View File

@@ -1,4 +1,4 @@
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';
@@ -7,6 +7,7 @@ import { Input } from '@/Components/ui/input';
import { Button } from '@/Components/ui/button';
import { Checkbox } from '@/Components/ui/checkbox';
import InputError from '@/Components/InputError';
import { LogIn, ArrowRight } from 'lucide-react';
export default function Login({
status,
@@ -30,133 +31,136 @@ export default function Login({
};
return (
<GuestLayout>
<Head title="Log in" />
<AuthLayout>
<Head title="Masuk ke Academy" />
<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">Selamat Datang Kembali</CardTitle>
<CardDescription className="text-gray-500">
Masuk ke akun NihonBuzz Academy anda
</CardDescription>
</CardHeader>
<CardContent className="pb-8">
{status && (
<div className="mb-4 text-sm font-medium text-green-600">
{status}
</div>
)}
<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">
Okaeri! <span className="animate-bounce">👋</span>
</CardTitle>
<CardDescription className="text-muted-foreground font-medium text-xs uppercase tracking-widest pt-2">
Masuk ke portal siswa LPK NihonBuzz
</CardDescription>
</CardHeader>
<CardContent className="px-8 pb-10">
{status && (
<div className="mb-6 p-4 rounded-2xl bg-green-500/10 border border-green-500/20 text-xs font-bold text-green-600 text-center">
{status}
</div>
)}
<form onSubmit={submit} className="space-y-6">
<div className="space-y-2">
<Label htmlFor="email">Email</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)}
/>
<InputError message={errors.email} />
<form onSubmit={submit} className="space-y-5">
<div className="space-y-2">
<Label htmlFor="email" className="text-[10px] font-black uppercase tracking-widest text-muted-foreground ml-1">Email Addres</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="nama@email.com"
onChange={(e) => setData('email', e.target.value)}
/>
<InputError message={errors.email} />
</div>
<div className="space-y-2">
<div className="flex items-center justify-between mb-1">
<Label htmlFor="password" className="text-[10px] font-black uppercase tracking-widest text-muted-foreground ml-1">Password</Label>
{canResetPassword && (
<Link
href={route('password.request')}
className="text-[10px] text-nihonbuzz-red hover:underline font-black uppercase tracking-widest"
>
Lupa sandi?
</Link>
)}
</div>
<div className="space-y-2">
<div className="flex items-center justify-between">
<Label htmlFor="password">Password</Label>
{canResetPassword && (
<Link
href={route('password.request')}
className="text-xs text-nihonbuzz-red hover:underline font-medium"
>
Lupa password?
</Link>
)}
</div>
<Input
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="current-password"
onChange={(e) => setData('password', e.target.value)}
/>
<InputError message={errors.password} />
</div>
<Input
id="password"
type="password"
name="password"
value={data.password}
className="block w-full"
autoComplete="current-password"
onChange={(e) => setData('password', e.target.value)}
/>
<InputError message={errors.password} />
</div>
<div className="flex items-center space-x-2 pb-2">
<Checkbox
id="remember"
checked={data.remember}
onCheckedChange={(checked) => setData('remember', checked as boolean)}
className="rounded-md border-white/30"
/>
<Label htmlFor="remember" className="text-xs text-muted-foreground font-bold cursor-pointer hover:text-foreground transition-colors">
Ingat sesi saya di perangkat ini
</Label>
</div>
<div className="flex items-center space-x-2">
<Checkbox
id="remember"
checked={data.remember}
onCheckedChange={(checked) => setData('remember', checked as boolean)}
/>
<Label htmlFor="remember" className="text-sm text-gray-600 font-normal cursor-pointer">
Ingat saya
</Label>
</div>
<div className="pt-2">
<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}>
Masuk ke Platform <LogIn className="ml-2 w-5 h-5 group-hover:translate-x-1 transition-transform" />
</Button>
</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}>
Masuk Sekarang
</Button>
<div className="relative py-4">
<div className="absolute inset-0 flex items-center px-4">
<span className="w-full border-t border-muted-foreground/10" />
</div>
<div className="relative flex justify-center text-[10px] uppercase font-black tracking-[0.2em]">
<span className="bg-transparent px-4 text-muted-foreground/40">Atau gunakan</span>
</div>
</div>
<div className="relative">
<div className="absolute inset-0 flex items-center">
<span className="w-full border-t border-gray-100" />
</div>
<div className="relative flex justify-center text-xs uppercase">
<span className="bg-white px-2 text-gray-500 font-medium">Atau masuk dengan</span>
</div>
</div>
<div className="grid grid-cols-1 gap-3">
<Button
type="button"
variant="outline"
className="w-full py-6 rounded-2xl text-sm font-bold border-gray-100 hover:bg-gray-50 flex items-center justify-center gap-3 transition-all"
onClick={() => window.location.href = route('social.redirect', { provider: 'google' })}
>
<svg className="w-5 h-5" viewBox="0 0 24 24">
<path
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
fill="#4285F4"
/>
<path
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
fill="#34A853"
/>
<path
d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z"
fill="#FBBC05"
/>
<path
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
fill="#EA4335"
/>
</svg>
Google
</Button>
</div>
<div className="text-center text-sm text-gray-500">
Belum punya akun?{' '}
<div className="grid grid-cols-1 gap-3">
<Button
type="button"
variant="outline"
className="w-full h-16 rounded-[1.5rem] text-sm font-bold border-white/20 bg-white/50 dark:bg-white/5 hover:bg-white dark:hover:bg-white/10 flex items-center justify-center gap-3 transition-all group"
onClick={() => window.location.href = route('social.redirect', { provider: 'google' })}
>
<svg className="w-5 h-5" viewBox="0 0 24 24">
<path
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
fill="#4285F4"
/>
<path
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
fill="#34A853"
/>
<path
d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z"
fill="#FBBC05"
/>
<path
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
fill="#EA4335"
/>
</svg>
<span className="text-gray-600 dark:text-gray-300">Akses Cepat via Google</span>
</Button>
</div>
<div className="text-center pt-4">
<p className="text-xs text-muted-foreground font-medium">
Belum menjadi peserta didik?{' '}
<Link
href={route('register')}
className="text-nihonbuzz-red font-bold hover:underline"
className="text-nihonbuzz-red font-black hover:underline uppercase tracking-widest text-[10px] ml-1"
>
Daftar Gratis
Daftar Sekarang <ArrowRight className="inline-block w-3 h-3 ml-1" />
</Link>
</div>
</form>
</CardContent>
</Card>
</div>
</GuestLayout>
</p>
</div>
</form>
</CardContent>
</Card>
</AuthLayout>
);
}

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>
);
}