From 782ca3e8895ddccb84c97e26af450ada4b5b138a Mon Sep 17 00:00:00 2001 From: memdmp Date: Sun, 12 Jan 2025 05:36:18 +0100 Subject: feat: new things --- src/routes/+page.svelte | 26 ++++++++++++++++++++++---- src/routes/anim-gen.ts | 6 +++++- src/routes/skip-animation/+page.svelte | 5 +++++ src/routes/skip-animation/+page.ts | 1 + 4 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 src/routes/skip-animation/+page.svelte create mode 100644 src/routes/skip-animation/+page.ts (limited to 'src') 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)); @@ -110,9 +124,9 @@ {/if} {:else} + 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)} -
+
`#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 @@ + + + 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'; -- cgit v1.2.3