feat: Create error page

This commit is contained in:
April Hall 2025-02-06 10:57:48 -05:00
parent 2600f590d5
commit 1d71db560e
No known key found for this signature in database
GPG Key ID: A49AC35CB186266C
2 changed files with 27 additions and 0 deletions

View File

@ -2,6 +2,13 @@
@tailwind components;
@tailwind utilities;
.abs-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@layer base {
:root {
--background: 0 0% 100%;

20
src/routes/+error.svelte Normal file
View File

@ -0,0 +1,20 @@
<script lang="ts">
import { page } from '$app/state';
import { Button } from '$lib/components/ui/button';
import BrokenHeart from 'lucide-svelte/icons/heart-crack';
import * as Card from '$lib/components/ui/card';
</script>
<main class="relative size-full">
<Card.Root class="md:w-1/4 w-1/2 h-1/2 abs-center flex flex-col">
<Card.Header class="h-fit">
<Card.Title class="text-center">{page.status} - {page.error?.message}</Card.Title>
</Card.Header>
<Card.Content class="relative grow">
<BrokenHeart class="size-1/2 abs-center" />
</Card.Content>
<Card.Footer class="h-fit">
<Button href="/" variant="secondary" class="mx-auto">Go Home</Button>
</Card.Footer>
</Card.Root>
</main>