@ -1,31 +1,53 @@
|
||||
<script>
|
||||
import { page } from '$app/stores';
|
||||
|
||||
export let text;
|
||||
export let url;
|
||||
export let type;
|
||||
export let disabled;
|
||||
|
||||
let classes = "h-full py-2 px-10 flex justify-center items-center uppercase group";
|
||||
let classes;
|
||||
|
||||
initButton($page.url.pathname);
|
||||
|
||||
function initButton(givenUrl) {
|
||||
let current;
|
||||
classes = "h-full py-2 px-10 flex justify-center items-center uppercase group";
|
||||
|
||||
switch (type) {
|
||||
case "title":
|
||||
classes +=
|
||||
" text-xl font-bold text-white bg-amber-500 duration-300";
|
||||
" text-xl font-bold bg-amber-500 duration-300";
|
||||
break;
|
||||
|
||||
default:
|
||||
classes +=
|
||||
" hover:bg-white hover:bg-opacity-20 text-white font-bold text-lg duration-300";
|
||||
" hover:bg-white hover:bg-opacity-20 font-bold text-lg duration-300";
|
||||
break;
|
||||
}
|
||||
|
||||
if (disabled) {
|
||||
url = null;
|
||||
classes += " cursor-not-allowed text-white opacity-50";
|
||||
classes += " cursor-not-allowed opacity-50 select-none";
|
||||
}
|
||||
|
||||
if(url == "/") current = givenUrl == "/";
|
||||
if(url != "/") current = givenUrl.includes(url);
|
||||
|
||||
if(current == true) {
|
||||
classes += " text-white bg-white bg-opacity-10";
|
||||
} else {
|
||||
classes += " text-gray-200";
|
||||
}
|
||||
}
|
||||
|
||||
page.subscribe(value => {
|
||||
initButton(value.url.pathname);
|
||||
});
|
||||
</script>
|
||||
|
||||
<a href={url} class={classes}>
|
||||
<p class="transform group-hover:scale-110 duration-300">
|
||||
<p class="transform duration-300 {!disabled ? "group-hover:scale-110" : ''}">
|
||||
{text}
|
||||
</p>
|
||||
</a>
|
||||
|
@ -0,0 +1,18 @@
|
||||
<script context="module">
|
||||
/** @type {import('@sveltejs/kit').Load} */ export function load({ error, status }) {
|
||||
return {
|
||||
props: {
|
||||
title: `${status}: ${error.message}`
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export let title;
|
||||
</script>
|
||||
|
||||
<div class="py-20 container flex flex-col gap-10">
|
||||
<h2 class="text-4xl font-bold text-center">Error {title}</h2>
|
||||
<img src="/banner5.jpeg" class="w-1/3 mx-auto rounded-2xl" alt="Oops! Hotdogs!" />
|
||||
</div>
|
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 71 KiB |
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 80 KiB |
After Width: | Height: | Size: 119 KiB |