From d919b1a26d8c3c44c4d7a2e648a77e66e6318443 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Tue, 23 Jan 2024 20:32:29 +0100 Subject: [PATCH] Removed wasm stuff --- palette-switcher-v2/index.html | 2 +- palette-switcher-v2/src/lib/ditherer.ts | 4 ++- palette-switcher-v2/src/pages/Switcher.tsx | 38 +++++++++++++--------- palette-switcher-v2/tsconfig.json | 1 + 4 files changed, 27 insertions(+), 18 deletions(-) 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",