From fc95938ad83d3fce9098f62e7733a0cdc17f073b Mon Sep 17 00:00:00 2001 From: mehbark Date: Thu, 20 Jul 2023 22:43:01 -0400 Subject: [PATCH] gonna move the color to out-of-line styles --- html/pixels.tsx | 74 ++++++++++++++++++------------------------------- 1 file changed, 27 insertions(+), 47 deletions(-) diff --git a/html/pixels.tsx b/html/pixels.tsx index b4de922..f7d4b16 100644 --- a/html/pixels.tsx +++ b/html/pixels.tsx @@ -1,63 +1,43 @@ import { ComponentChildren, JSX } from "preact"; import { Main, render_and_copy } from "./common.tsx"; -// kind of made this not generic :( -const Toggle = ({ a, b }: { a: JSX.Element; b: JSX.Element }) => ( +// don't want to do randomly on since it's not unique anyway +const Pixel = ({ color_a, color_b }: { color_a: string; color_b: string }) => (
- -
- {a} -
-
-
- {b} -
+ +
); -const Pixel = ({ color_a, color_b }: { color_a: string; color_b: string }) => ( - - } - b={ -
- } - /> +const Pixels = ({ + n, + color_a, + color_b, +}: { + n: number; + color_a: string; + color_b: string; +}) => ( + <> + {...new Array(n) + .fill(null) + .map(() => )} + ); render_and_copy(
- - - - - - - - - - - - - - - - +
);