diff --git a/src/routes/downloads.tsx b/src/routes/downloads.tsx index 46a3fa5..3458650 100644 --- a/src/routes/downloads.tsx +++ b/src/routes/downloads.tsx @@ -1,8 +1,11 @@ import { Title, Meta } from "@solidjs/meta"; import { A } from "@solidjs/router"; +import { createSignal, onMount, onCleanup } from "solid-js"; import DownloadOnAppStore from "~/components/icons/DownloadOnAppStore"; export default function DownloadsPage() { + const [glitchText, setGlitchText] = createSignal("$ downloads"); + const download = (assetName: string) => { fetch(`/api/downloads/public/${assetName}`) .then((response) => response.json()) @@ -13,6 +16,34 @@ export default function DownloadsPage() { .catch((error) => console.error(error)); }; + onMount(() => { + const originalText = "$ downloads"; + const glitchChars = "!@#$%^&*()_+-=[]{}|;':\",./<>?~`"; + + const glitchInterval = setInterval(() => { + if (Math.random() > 0.9) { + let glitched = ""; + for (let i = 0; i < originalText.length; i++) { + if (Math.random() > 0.8) { + glitched += + glitchChars[Math.floor(Math.random() * glitchChars.length)]; + } else { + glitched += originalText[i]; + } + } + setGlitchText(glitched); + + setTimeout(() => { + setGlitchText(originalText); + }, 80); + } + }, 300); + + onCleanup(() => { + clearInterval(glitchInterval); + }); + }); + return ( <>