diff --git a/html/common.tsx b/html/common.tsx index c8d888d..5e370aa 100644 --- a/html/common.tsx +++ b/html/common.tsx @@ -310,18 +310,24 @@ export const Cycle = ({ height_px, children, style, + credit = true, }: { width_px: number; height_px: number; children: [ComponentChild, ...ComponentChild[]]; style?: Record; + credit?: boolean; }) => (
diff --git a/html/draw.tsx b/html/draw.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/html/gameboy.tsx b/html/gameboy.tsx new file mode 100644 index 0000000..0ff7ab8 --- /dev/null +++ b/html/gameboy.tsx @@ -0,0 +1,71 @@ +// let's game boy ! ! ! +import { ComponentChild } from "preact"; +import { Cycle, render_and_copy } from "./common.tsx"; + +const Pixel = ({ + colors, + width_px, +}: { + colors: [string, ...string[]]; + width_px: number; +}) => ( + +
+ {...colors.map(c => ( + // p saves four bytes per + // we aren't going to get to 20x18 but less data is courteous +
+ ))} +
+); + +const Draw = ({ + width, + height = width, + pixel_width_px, + colors, + bg_color, +}: { + width: number; + height?: number; + pixel_width_px: number; + colors: [string, ...string[]]; + bg_color: string; +}) => ( +
+ {...new Array(width * height) + .fill(null) + .map(() => )} +
+); +const Shell = ({ children }: { children: ComponentChild }) => ( +
{children}
+); + +// https://www.color-hex.com/color-palette/26401 +// body: "#aaaaaa" +render_and_copy( + +);