From df57bcdcd98d2a450cca02ba29380e0781777f8e Mon Sep 17 00:00:00 2001 From: mehbark Date: Thu, 7 Sep 2023 21:27:45 -0400 Subject: [PATCH] crumble: did that, change to px to avoid blur --- html/crumble.tsx | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) 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; + })}
);