bleh. done enough
This commit is contained in:
parent
fc95938ad8
commit
a0775e7aa8
1 changed files with 6 additions and 10 deletions
|
@ -2,16 +2,18 @@ import { ComponentChildren, JSX } from "preact";
|
|||
import { Main, render_and_copy } from "./common.tsx";
|
||||
|
||||
// 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 }) => (
|
||||
const Pixel = () => (
|
||||
<details
|
||||
class="toggle"
|
||||
style="position: relative; margin: 0; cursor: pointer;"
|
||||
>
|
||||
<summary
|
||||
style={`list-style: none; margin: 0; display: block; width: 100%; height: 100%; background-color: ${color_a};`}
|
||||
style="list-style: none; margin: 0; display: block; width: 100%; height: 100%;"
|
||||
class="off"
|
||||
></summary>
|
||||
<div
|
||||
style={`margin: 0; display: block; width: 100%; height: 100%; position: absolute; top: 0; pointer-events: none; background-color: ${color_b};`}
|
||||
style="margin: 0; display: block; width: 100%; height: 100%; position: absolute; top: 0; pointer-events: none;"
|
||||
class="on"
|
||||
></div>
|
||||
</details>
|
||||
);
|
||||
|
@ -24,13 +26,7 @@ const Pixels = ({
|
|||
n: number;
|
||||
color_a: string;
|
||||
color_b: string;
|
||||
}) => (
|
||||
<>
|
||||
{...new Array(n)
|
||||
.fill(null)
|
||||
.map(() => <Pixel color_a={color_a} color_b={color_b} />)}
|
||||
</>
|
||||
);
|
||||
}) => <>{...new Array(n).fill(null).map(Pixel)}</>;
|
||||
|
||||
render_and_copy(
|
||||
<Main>
|
||||
|
|
Loading…
Reference in a new issue