import { phone, touchScreen } from "/src/env"; import { createRWS } from "/src/solid/rws"; const texts = [ "satonomics", "satonomics", "satonomics", "satonomics", "satonomics", "satonomics", "stay humble, stack sats", "21 million", "cold storage", "utxo", "satoshi nakamoto", "hodl", `don't trust, verify`, "zap", "â‚¿itcoin", "lightning", "nostr", "freedom tech", "2008/10/31", "2009/01/03", "2010/05/22", "hodl!", "Hal Finney", "Vote for better money", "gradually then suddenly", "timechain", "self custody", "be your own bank", "resistance money", "foss", "permissionless", "great reset", "orange pill", "borderless", "anonymous", "nyknyc", "low time preference", "absolute scarcity", "time is scarce", "ride or die", "cypherpunk", "we like the coin", "money for enemies", "trustless money", "sustainable money", ]; export function Background({ mode, opacity, focused, }: { mode: SL<"Scroll" | "Static">; opacity: SL<{ text: string; value: number }>; focused: Accessor; }) { return ( <>
); } function Line({ mode, focused, }: { mode: SL<"Scroll" | "Static">; focused: Accessor; }) { const shuffled = shuffle(texts).slice(0, 10); const joined = shuffled.join(". "); return (
); } function TextWrapper({ joined, mode, focused, }: { mode: SL<"Scroll" | "Static">; focused: Accessor; joined: string; }) { const p = createRWS(undefined as HTMLParagraphElement | undefined); const seconds = createRWS(joined.length * 2); const wasOnceOn = createRWS(false); createEffect(() => { if (!wasOnceOn() && mode.selected() === "Scroll") { wasOnceOn.set(true); } }); // Bug in Safari iOS, not sure where else, works perfectly on Mac OS though if (!touchScreen) { onMount(() => { seconds.set(Math.round(p()!.clientWidth / 20)); }); } return (

{joined} {wasOnceOn() ? joined : undefined}

); } function shuffle([...arr]: T[]): T[] { let m = arr.length; while (m) { const i = Math.floor(Math.random() * m--); [arr[m], arr[i]] = [arr[i], arr[m]]; } return arr; } function Noise() { return ( ); }