diff --git a/html/crumble.tsx b/html/crumble.tsx index 54c6a31..c9c3153 100644 --- a/html/crumble.tsx +++ b/html/crumble.tsx @@ -5,25 +5,21 @@ import { css, render_and_copy } from "./common.tsx"; // we want outliers (a few letters falling before than others) // exponentials should do -const default_shaky_delay = (x: number) => 5 + 10 * x; +const default_shaky_delay = (x: number) => 8 + 10 * x; export type DelayFn = (_: number) => number; // exporting these in case they turn out to be useful export const Shaky = ({ children, - delay_fn = default_shaky_delay, + delay = 0, }: { children: ComponentChildren; - delay_fn?: DelayFn; + delay?: number; }) => (
@@ -34,10 +30,10 @@ export const Shaky = ({ const default_fall_delay = (x: number) => (3 * x) ** 4; export const Fall = ({ children, - delay_fn = default_fall_delay, + delay = 0, }: { children: ComponentChildren; - delay_fn?: DelayFn; + delay?: number; }) => (
(
- {msg.split("").map(c => - /[^\s]/.test(c) ? ( - - {c} - - ) : c == "\n" ? ( -
- ) : ( - c - ) - )} + {msg.split("").map(c => { + if (/[^\s]/.test(c)) { + const seed = Math.random(); + return ( + + {c} + + ); + } + if (c == "\n") return
; + return c; + })}
);