diff --git a/app-html/.gitignore b/app-html/.gitignore new file mode 100644 index 000000000..2771fe387 --- /dev/null +++ b/app-html/.gitignore @@ -0,0 +1 @@ +/ignore \ No newline at end of file diff --git a/app-html/_oklch.js b/app-html/_oklch.js deleted file mode 100644 index 8bafe9f25..000000000 --- a/app-html/_oklch.js +++ /dev/null @@ -1,48 +0,0 @@ -merge = async (c1, c2) => { - function sleep(ms) { - return new Promise((resolve) => { - setTimeout(resolve, ms); - }); - } - - async function hexToOklch(c) { - hex.value = c; - - hex.dispatchEvent(new Event("change")); - - await sleep(1); - - console.log(oklch.value); - - const s = oklch.value.slice(6, -1).split(" "); - - let [lightness, chroma, hue] = s; - - lightness = Number(lightness.slice(0, -1)); - chroma = Number(chroma); - hue = Number(hue); - - return [lightness, chroma, hue]; - } - - function average(a, b) { - return (a + b) / 2; - } - - const [lightness1, chroma1, hue1] = await hexToOklch(c1); - console.log(lightness1, chroma1, hue1); - const [lightness2, chroma2, hue2] = await hexToOklch(c2); - console.log(lightness2, chroma2, hue2); - - const lightness = average(lightness1, lightness2); - const chroma = average(chroma1, chroma2); - const hue = average(hue1, hue2); - - oklch.value = `oklch(${lightness}% ${chroma} ${hue})`; - console.log(oklch.value); - oklch.dispatchEvent(new Event("change")); - - await sleep(10); - - console.log(hex.value); -}; diff --git a/app-html/index.html b/app-html/index.html index 9519547e6..b5722f1a2 100644 --- a/app-html/index.html +++ b/app-html/index.html @@ -1,4 +1,4 @@ - +
@@ -11,14 +11,608 @@ name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> - + +