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

@@ -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,33 +31,34 @@ 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
<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="pb-8">
<CardContent className="px-8 pb-10">
{status && (
<div className="mb-4 text-sm font-medium text-green-600">
<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">
<form onSubmit={submit} className="space-y-5">
<div className="space-y-2">
<Label htmlFor="email">Email</Label>
<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="block w-full"
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)}
@@ -65,14 +67,14 @@ export default function Login({
</div>
<div className="space-y-2">
<div className="flex items-center justify-between">
<Label htmlFor="password">Password</Label>
<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-xs text-nihonbuzz-red hover:underline font-medium"
className="text-[10px] text-nihonbuzz-red hover:underline font-black uppercase tracking-widest"
>
Lupa password?
Lupa sandi?
</Link>
)}
</div>
@@ -82,36 +84,37 @@ export default function Login({
type="password"
name="password"
value={data.password}
className="block w-full"
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>
<div className="flex items-center space-x-2">
<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-sm text-gray-600 font-normal cursor-pointer">
Ingat saya
<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="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 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="relative">
<div className="absolute inset-0 flex items-center">
<span className="w-full border-t border-gray-100" />
<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-xs uppercase">
<span className="bg-white px-2 text-gray-500 font-medium">Atau masuk dengan</span>
<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>
@@ -119,7 +122,7 @@ export default function Login({
<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"
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">
@@ -140,23 +143,24 @@ export default function Login({
fill="#EA4335"
/>
</svg>
Google
<span className="text-gray-600 dark:text-gray-300">Akses Cepat via Google</span>
</Button>
</div>
<div className="text-center text-sm text-gray-500">
Belum punya akun?{' '}
<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>
</p>
</div>
</form>
</CardContent>
</Card>
</div>
</GuestLayout>
</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,28 +25,29 @@ 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
<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="pb-8">
<form onSubmit={submit} className="space-y-6">
<CardContent className="px-8 pb-10">
<form onSubmit={submit} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="name">Nama Lengkap</Label>
<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="block w-full"
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="Nama Lengkap Anda"
placeholder="Masukkan nama lengkap Anda"
onChange={(e) => setData('name', e.target.value)}
required
/>
@@ -53,30 +55,30 @@ export default function Register() {
</div>
<div className="space-y-2">
<Label htmlFor="email">Email</Label>
<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="block w-full"
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"
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">
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4 pt-1">
<div className="space-y-2">
<Label htmlFor="password">Password</Label>
<Label htmlFor="password" className="text-[10px] font-black uppercase tracking-widest text-muted-foreground ml-1">Password</Label>
<Input
id="password"
type="password"
name="password"
value={data.password}
className="block w-full"
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
@@ -85,13 +87,13 @@ export default function Register() {
</div>
<div className="space-y-2">
<Label htmlFor="password_confirmation">Konfirmasi</Label>
<Label htmlFor="password_confirmation" className="text-[10px] font-black uppercase tracking-widest text-muted-foreground ml-1">Konfirmasi</Label>
<Input
id="password_confirmation"
type="password"
name="password_confirmation"
value={data.password_confirmation}
className="block w-full"
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
@@ -100,25 +102,26 @@ export default function Register() {
</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
<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="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>
</p>
</div>
</form>
</CardContent>
</Card>
</div>
</GuestLayout>
</AuthLayout>
);
}