Enhance layout and user experience by updating styles, adding toast notifications on login success, and modifying sidebar content
All checks were successful
main-branch-frovide/pipeline/head This commit looks good

This commit is contained in:
pd0a6847 2025-06-13 15:51:16 +09:00
parent 2fa72ac137
commit 20c0e3345c
7 changed files with 65 additions and 50 deletions

View File

@ -7,70 +7,70 @@
:root { :root {
--radius: 0.625rem; --radius: 0.625rem;
--background: oklch(1 0 0); --background: oklch(1 0 0);
--foreground: oklch(0.129 0.042 264.695); --foreground: oklch(0.145 0 0);
--card: oklch(1 0 0); --card: oklch(1 0 0);
--card-foreground: oklch(0.129 0.042 264.695); --card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0); --popover: oklch(1 0 0);
--popover-foreground: oklch(0.129 0.042 264.695); --popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.208 0.042 265.755); --primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.984 0.003 247.858); --primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.968 0.007 247.896); --secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.208 0.042 265.755); --secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.968 0.007 247.896); --muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.554 0.046 257.417); --muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.968 0.007 247.896); --accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.208 0.042 265.755); --accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325); --destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.929 0.013 255.508); --border: oklch(0.922 0 0);
--input: oklch(0.929 0.013 255.508); --input: oklch(0.922 0 0);
--ring: oklch(0.704 0.04 256.788); --ring: oklch(0.708 0 0);
--chart-1: oklch(0.646 0.222 41.116); --chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704); --chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392); --chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429); --chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08); --chart-5: oklch(0.769 0.188 70.08);
--sidebar: oklch(0.984 0.003 247.858); --sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.129 0.042 264.695); --sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.208 0.042 265.755); --sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.984 0.003 247.858); --sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.968 0.007 247.896); --sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.208 0.042 265.755); --sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.929 0.013 255.508); --sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.704 0.04 256.788); --sidebar-ring: oklch(0.708 0 0);
} }
.dark { .dark {
--background: oklch(0.129 0.042 264.695); --background: oklch(0.145 0 0);
--foreground: oklch(0.984 0.003 247.858); --foreground: oklch(0.985 0 0);
--card: oklch(0.208 0.042 265.755); --card: oklch(0.205 0 0);
--card-foreground: oklch(0.984 0.003 247.858); --card-foreground: oklch(0.985 0 0);
--popover: oklch(0.208 0.042 265.755); --popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.984 0.003 247.858); --popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.929 0.013 255.508); --primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.208 0.042 265.755); --primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.279 0.041 260.031); --secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.984 0.003 247.858); --secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.279 0.041 260.031); --muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.704 0.04 256.788); --muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.279 0.041 260.031); --accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.984 0.003 247.858); --accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216); --destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%); --border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%); --input: oklch(1 0 0 / 15%);
--ring: oklch(0.551 0.027 264.364); --ring: oklch(0.556 0 0);
--chart-1: oklch(0.488 0.243 264.376); --chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48); --chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08); --chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9); --chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439); --chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.208 0.042 265.755); --sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.984 0.003 247.858); --sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376); --sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.984 0.003 247.858); --sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.279 0.041 260.031); --sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.984 0.003 247.858); --sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%); --sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.551 0.027 264.364); --sidebar-ring: oklch(0.556 0 0);
} }
@theme inline { @theme inline {

View File

@ -24,7 +24,7 @@
user: { user: {
name: "shadcn", name: "shadcn",
email: "m@example.com", email: "m@example.com",
avatar: "/avatars/shadcn.jpg", avatar: "https://shadcn-svelte.com/avatars/shadcn.jpg",
}, },
navMain: [ navMain: [
{ {
@ -146,7 +146,7 @@
{#snippet child({ props })} {#snippet child({ props })}
<a href="##" {...props}> <a href="##" {...props}>
<InnerShadowTopIcon class="!size-5" /> <InnerShadowTopIcon class="!size-5" />
<span class="text-base font-semibold">Acme Inc.</span> <span class="text-base font-semibold">Frovide : Home</span>
</a> </a>
{/snippet} {/snippet}
</Sidebar.MenuButton> </Sidebar.MenuButton>

View File

@ -7,7 +7,7 @@
import SiteHeader from "$lib/components/site-header.svelte"; import SiteHeader from "$lib/components/site-header.svelte";
</script> </script>
<Toaster /> <Toaster richColors />
<Sidebar.Provider <Sidebar.Provider
style="--sidebar-width: calc(var(--spacing) * 72); --header-height: calc(var(--spacing) * 12);" style="--sidebar-width: calc(var(--spacing) * 72); --header-height: calc(var(--spacing) * 12);"
> >

View File

@ -12,6 +12,7 @@ import {formSchema} from "./schema";
export const load: PageServerLoad = async (event) => { export const load: PageServerLoad = async (event) => {
if (event.locals.user) { if (event.locals.user) {
return redirect(302, '/demo/lucia'); return redirect(302, '/demo/lucia');
@ -57,7 +58,10 @@ export const actions: Actions = {
const session = await auth.createSession(sessionToken, existingUser.id); const session = await auth.createSession(sessionToken, existingUser.id);
auth.setSessionTokenCookie(event, sessionToken, session.expiresAt); auth.setSessionTokenCookie(event, sessionToken, session.expiresAt);
return redirect(302, '/demo/lucia'); return {
form,
};
// return redirect(302, '/demo/lucia');
}, },
}; };

View File

@ -4,7 +4,7 @@
let {data}: { data: PageData } = $props(); let {data}: { data: PageData } = $props();
</script> </script>
<div class="bg-muted flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10"> <div class="flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
<div class="flex w-full max-w-sm flex-col gap-6"> <div class="flex w-full max-w-sm flex-col gap-6">
<LoginForm {data}/> <LoginForm {data}/>
</div> </div>

View File

@ -14,19 +14,30 @@
import {Switch} from "@/components/ui/switch"; import {Switch} from "@/components/ui/switch";
import {cn} from "@/utils.js"; import {cn} from "@/utils.js";
import SuperDebug from 'sveltekit-superforms'; import SuperDebug from 'sveltekit-superforms';
import { toast } from "svelte-sonner";
let {data}: { data: { form: SuperValidated<Infer<FormSchema>> } } = let {data}: { data: { form: SuperValidated<Infer<FormSchema>> } } =
$props(); $props();
const form = superForm(data.form, { const form = superForm(data.form, {
validators: zodClient(formSchema), validators: zodClient(formSchema),
applyAction: false,
onResult({ result }) {
if (result.type === 'success') {
toast.success(`로그인: ${$formData.email}`, {
description: 'Monday, January 3rd at 6:00pm',
duration: 3000,
});
// goto(result.location);
}
}
}); });
const {form: formData, enhance} = form; const {form: formData, enhance} = form;
</script> </script>
<div class="flex flex-col gap-6"> <div class="flex flex-col gap-6 ">
<Card.Root> <Card.Root>
<Card.Header class="text-center"> <Card.Header class="text-center">
<Card.Title class="text-xl font-semibold">LOGIN</Card.Title> <Card.Title class="text-xl font-semibold">LOGIN</Card.Title>

View File

@ -3,7 +3,7 @@
import RegisterForm from "./register-form.svelte"; import RegisterForm from "./register-form.svelte";
let { data }: { data: PageData } = $props(); let { data }: { data: PageData } = $props();
</script> </script>
<div class="bg-muted flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10"> <div class="flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
<div class="flex w-full max-w-sm flex-col gap-6"> <div class="flex w-full max-w-sm flex-col gap-6">
<RegisterForm {data} /> <RegisterForm {data} />
</div> </div>