diff options
Diffstat (limited to 'src/routes')
-rw-r--r-- | src/routes/+page.svelte | 26 | ||||
-rw-r--r-- | src/routes/anim-gen.ts | 6 | ||||
-rw-r--r-- | src/routes/skip-animation/+page.svelte | 5 | ||||
-rw-r--r-- | src/routes/skip-animation/+page.ts | 1 |
4 files changed, 33 insertions, 5 deletions
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 701132b..dd06561 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -30,7 +30,21 @@ const lanLeastSignificantIPPart = Math.floor(Math.random() * 253 + 2); - let isScripted = false; + let { + skipAnimation = false, + }: { + skipAnimation?: boolean; + } = $props(); + onMount(() => { + const skipParam = new Boolean( + (new URLSearchParams(location.search).get("skip-animation") ?? "false") || + "true", + ); + if (skipParam) skipAnimation = skipParam.valueOf(); + if (skipAnimation) window.history.pushState({}, "", "/skip-animation"); + }); + + let isScripted = $state(false); onMount(() => (isScripted = true)); onDestroy(() => (isScripted = false)); </script> @@ -110,9 +124,9 @@ {/if} {:else} <span - on:click={() => + onclick={() => typeof section.url !== "function" ? void 0 : section.url(line)} - on:keypress={() => + onkeypress={() => typeof section.url !== "function" ? void 0 : section.url(line)} role="link" tabindex="0">{@render ttyTextInnerRenderer(section)}</span @@ -150,7 +164,11 @@ {/each} </div> -<div class="fixed top-0 left-0 w-screen h-screen font-mono" id="app"> +<div + class="fixed top-0 left-0 w-screen h-screen font-mono" + id="app" + class:skip-animation={skipAnimation} +> <div id="bios" class="flex flex-col items-center justify-between relative font-bios text-lg" diff --git a/src/routes/anim-gen.ts b/src/routes/anim-gen.ts index 9138ca9..382237e 100644 --- a/src/routes/anim-gen.ts +++ b/src/routes/anim-gen.ts @@ -500,5 +500,9 @@ ${ } ` ).join('') -}`; +} +${[...anim.exportToObject().values()].map(v=>`#app.skip-animation ${v.selector} { + animation-duration: 0.01ms; +}`).join('\n')} +`; console.log(output); diff --git a/src/routes/skip-animation/+page.svelte b/src/routes/skip-animation/+page.svelte new file mode 100644 index 0000000..d657b03 --- /dev/null +++ b/src/routes/skip-animation/+page.svelte @@ -0,0 +1,5 @@ +<script lang="ts"> + import Page from "../+page.svelte"; +</script> + +<Page skipAnimation /> diff --git a/src/routes/skip-animation/+page.ts b/src/routes/skip-animation/+page.ts new file mode 100644 index 0000000..844f519 --- /dev/null +++ b/src/routes/skip-animation/+page.ts @@ -0,0 +1 @@ +export const trailingSlash = 'never'; |