forked from Mike/freno-dev
references and spinner fixes
This commit is contained in:
@@ -1,29 +1,11 @@
|
||||
import { onMount, onCleanup, createSignal } from "solid-js";
|
||||
import { isServer } from "solid-js/web";
|
||||
|
||||
const spinnerChars = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
||||
import { Spinner } from "~/components/Spinner";
|
||||
|
||||
export function TerminalSplash() {
|
||||
const [showing, setShowing] = createSignal(0);
|
||||
|
||||
onMount(() => {
|
||||
// Only run animation on client
|
||||
if (isServer) return;
|
||||
|
||||
const interval = setInterval(() => {
|
||||
setShowing((prev) => (prev + 1) % spinnerChars.length);
|
||||
}, 50);
|
||||
|
||||
onCleanup(() => {
|
||||
clearInterval(interval);
|
||||
});
|
||||
});
|
||||
|
||||
return (
|
||||
<div class="bg-base flex min-h-screen w-full flex-col items-center justify-center overflow-hidden">
|
||||
<div class="text-text max-w-3xl p-8 font-mono text-4xl whitespace-pre-wrap">
|
||||
<div class="text-text max-w-3xl p-8">
|
||||
<div class="flex items-center justify-center">
|
||||
{spinnerChars[showing()]}
|
||||
<Spinner size="xl" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user