feat: add daily win recording endpoint, user authentication, and profile management

- Implemented a POST endpoint for recording daily wins in the game.
- Created login and signup functionality with email and password.
- Developed a profile page allowing users to update their profile information, change passwords, and manage active sessions.
- Added a toggle feature for switching between login and signup forms.
- Enhanced the layout by removing the profile button and adjusting the header structure.
This commit is contained in:
2026-03-01 23:01:44 +01:00
parent e45dfb9832
commit 114f6cde7a
28 changed files with 2603 additions and 31 deletions

View File

@@ -0,0 +1,57 @@
<script lang="ts">
import { page } from '$app/stores';
import ProfileButton from '$lib/components/ProfileButton.svelte';
let { children, data } = $props();
const navItems = [
{ href: '/admin', label: 'Dashboard', icon: '📊' },
{ href: '/admin/characters', label: 'Characters', icon: '🗣️' },
{ href: '/admin/devil-fruits', label: 'Devil Fruits', icon: '🍎' },
{ href: '/admin/arcs', label: 'Arcs', icon: '📚' },
{ href: '/admin/users', label: 'Users', icon: '👥' },
{ href: '/admin/config', label: 'Settings', icon: '⚙️' }
];
const isActive = (href: string, currentPath: string) => {
if (href === '/admin') {
return currentPath === '/admin';
}
return currentPath.startsWith(href);
};
</script>
<div class="flex min-h-screen bg-slate-900">
<!-- Sidebar -->
<aside class="w-64 border-r border-white/5 bg-slate-950">
<div class="p-6">
<h2 class="text-lg font-black uppercase tracking-[0.15em] text-amber-50">Admin</h2>
</div>
<nav class="space-y-2 px-3">
{#each navItems as item}
<a
href={item.href}
class={`flex items-center gap-3 rounded-lg px-4 py-3 text-sm font-medium transition-colors ${
isActive(item.href, $page.url.pathname)
? 'bg-amber-600 text-white'
: 'text-gray-300 hover:bg-slate-800 hover:text-white'
}`}
>
<span>{item.icon}</span>
<span>{item.label}</span>
</a>
{/each}
</nav>
</aside>
<!-- Main content -->
<main class="flex-1">
<div class="flex items-center justify-between border-b border-white/5 bg-slate-950 px-8 py-4">
<h1 class="text-2xl font-bold text-white">Admin Dashboard</h1>
<ProfileButton user={data.user} />
</div>
<div class="p-8">
{@render children()}
</div>
</main>
</div>