error page lole

This commit is contained in:
cirroskais 2024-04-20 22:52:52 -04:00
parent 267c2089c1
commit 91837a207a
No known key found for this signature in database
GPG key ID: 5FC73EBF2678E33D
6 changed files with 54 additions and 4 deletions

1
src/app.d.ts vendored
View file

@ -42,6 +42,7 @@ declare global {
posts?: Array<PostsObject>; posts?: Array<PostsObject>;
discord: Discord; discord: Discord;
lastfm: LastFM; lastfm: LastFM;
counter: number;
} }
// interface PageState {} // interface PageState {}
// interface Platform {} // interface Platform {}

View file

@ -1,21 +1,31 @@
<script> <script>
import { page } from '$app/stores';
import Eye from './Icons/Eye.svelte'; import Eye from './Icons/Eye.svelte';
import Svelte from './Icons/Svelte.svelte'; import Svelte from './Icons/Svelte.svelte';
import TailwindCSS from './Icons/TailwindCSS.svelte'; import TailwindCSS from './Icons/TailwindCSS.svelte';
import Heart from './Icons/Heart.svelte';
</script> </script>
<div class="flex py-2 w-full h-full shadow-lg bg-gray-500/10"> <div class="flex py-2 w-full h-full shadow-lg bg-gray-500/10">
<div class="container flex"> <div class="container flex">
<div class="flex flex-col my-auto mr-auto text-sm text-neutral-500"> <div class="flex flex-col flex-1 my-auto text-sm text-neutral-500">
<p>cirroskais.xyz ― cirro's website</p> <p>cirroskais.xyz ― cirro's website</p>
<div class="flex space-x-0.5"> <div class="flex space-x-0.5">
<div class="my-auto w-5 h-5 font-bold"> <div class="my-auto w-5 h-5 font-bold">
<Eye></Eye> <Eye></Eye>
</div> </div>
<p>This page has been viewed <span class="font-bold">x</span> times.</p> <p>
This website has been viewed <span class="font-bold">{$page.data.counter}</span> times.
</p>
</div> </div>
</div> </div>
<div class="flex flex-col my-auto ml-auto text-sm text-neutral-500"> <div class="flex flex-col flex-1 my-auto text-sm text-neutral-500">
<div class="mx-auto w-5 h-5 hover:text-[#c4bef3] transition-colors">
<Heart></Heart>
</div>
</div>
<div class="flex flex-col flex-1 my-auto text-sm text-neutral-500">
<div class="flex ml-auto space-x-1.5"> <div class="flex ml-auto space-x-1.5">
<p>Built with</p> <p>Built with</p>
<a <a

View file

@ -0,0 +1,13 @@
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="lucide lucide-heart"
><path
d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"
/></svg
>

After

Width:  |  Height:  |  Size: 356 B

View file

@ -0,0 +1,9 @@
let counter = 0;
export function get() {
return counter;
}
export function inc() {
counter++;
}

13
src/routes/+error.svelte Normal file
View file

@ -0,0 +1,13 @@
<script>
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { onMount } from 'svelte';
onMount(() => {
goto('/');
});
</script>
<svelte:head>
<title>{$page.data.discord?.username}/error</title>
</svelte:head>

View file

@ -1,10 +1,14 @@
import { get, inc } from '$lib/server/counter';
import discord from '$lib/server/discord'; import discord from '$lib/server/discord';
import lastfm from '$lib/server/lastfm'; import lastfm from '$lib/server/lastfm';
/** @type {import("./$types").LayoutServerLoad} */ /** @type {import("./$types").LayoutServerLoad} */
export async function load() { export async function load() {
inc();
return { return {
discord: await discord(), discord: await discord(),
lastfm: await lastfm() lastfm: await lastfm(),
counter: get()
}; };
} }