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";
|
import { Main, render_and_copy } from "./common.tsx";
|
||||||
|
|
||||||
// don't want to do randomly on since it's not unique anyway
|
// 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
|
<details
|
||||||
class="toggle"
|
class="toggle"
|
||||||
style="position: relative; margin: 0; cursor: pointer;"
|
style="position: relative; margin: 0; cursor: pointer;"
|
||||||
>
|
>
|
||||||
<summary
|
<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>
|
></summary>
|
||||||
<div
|
<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>
|
></div>
|
||||||
</details>
|
</details>
|
||||||
);
|
);
|
||||||
|
@ -24,13 +26,7 @@ const Pixels = ({
|
||||||
n: number;
|
n: number;
|
||||||
color_a: string;
|
color_a: string;
|
||||||
color_b: string;
|
color_b: string;
|
||||||
}) => (
|
}) => <>{...new Array(n).fill(null).map(Pixel)}</>;
|
||||||
<>
|
|
||||||
{...new Array(n)
|
|
||||||
.fill(null)
|
|
||||||
.map(() => <Pixel color_a={color_a} color_b={color_b} />)}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
|
|
||||||
render_and_copy(
|
render_and_copy(
|
||||||
<Main>
|
<Main>
|
||||||
|
|
Loading…
Reference in a new issue