diff --git a/palette-switcher-v2/index.html b/palette-switcher-v2/index.html index aaad1b2..0763d1a 100644 --- a/palette-switcher-v2/index.html +++ b/palette-switcher-v2/index.html @@ -11,7 +11,7 @@
- + diff --git a/palette-switcher-v2/src/lib/ditherer.ts b/palette-switcher-v2/src/lib/ditherer.ts index 62ca4f1..fdcc2cf 100644 --- a/palette-switcher-v2/src/lib/ditherer.ts +++ b/palette-switcher-v2/src/lib/ditherer.ts @@ -9,7 +9,9 @@ const [start, stop] = createSignaledWorker({ input: job, output: setImage, func: function process(job: Job) { - return "OK ?"; + console.log("Job triggered"); + + return job.kind; }, }); diff --git a/palette-switcher-v2/src/pages/Switcher.tsx b/palette-switcher-v2/src/pages/Switcher.tsx index ce7ae58..4206d41 100644 --- a/palette-switcher-v2/src/pages/Switcher.tsx +++ b/palette-switcher-v2/src/pages/Switcher.tsx @@ -1,19 +1,30 @@ -import { Component } from "solid-js"; -import { setJob, image } from "../lib/ditherer"; -import { Job } from "../lib/job"; +import { Component, JSX, splitProps } from "solid-js"; +import { image, setJob } from "../lib/ditherer"; + +type DefaultButtonProps = { children?: JSX.Element } & JSX.HTMLAttributes; + +const DefaultButton: Component = (props) => { + const [, rest] = splitProps(props, ["children"]); + + return +} const Switcher: Component = () => { const handler = () => { - const job: Job = { + setJob({ kind: "FLOYD_STEINBERG", image: new ArrayBuffer(1), palette: ["FFFFFF"], - }; - - setJob(job); + }); }; return ( -
+
@@ -22,14 +33,9 @@ const Switcher: Component = () => {
- -
+ Trigger + {image()} +
); }; diff --git a/palette-switcher-v2/tsconfig.json b/palette-switcher-v2/tsconfig.json index 249b273..21c2feb 100644 --- a/palette-switcher-v2/tsconfig.json +++ b/palette-switcher-v2/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "allowJs": true, "strict": true, "target": "ESNext", "module": "ESNext",