diff --git a/html/common.tsx b/html/common.tsx index e161b47..2d1717f 100644 --- a/html/common.tsx +++ b/html/common.tsx @@ -303,3 +303,69 @@ export function make_sync_no_matter_the_cost(promise: Promise): T { return out as T; } + +// INFINITE CREDIT TO @BLACKLE https://cohost.org/blackle/post/72096-h3-style-text-alig +export const Cycle = ({ + width_px, + height_px, + children, + style, +}: { + width_px: number; + height_px: number; + children: [ComponentChild, ...ComponentChild[]]; + style?: Record; +}) => ( + + + {...children.map((c, i) => ( + + + {c} + + + + ))} + + +); diff --git a/html/cycle-test.tsx b/html/cycle-test.tsx new file mode 100644 index 0000000..0b4852d --- /dev/null +++ b/html/cycle-test.tsx @@ -0,0 +1,16 @@ +import { Cycle, render_and_copy } from "./common.tsx"; + +render_and_copy( + + this + won't + work + ! + !! + !!! + +);