From 4060e6d3242dd321ea6754212b711ec968a52763 Mon Sep 17 00:00:00 2001 From: MeowcaTheoRange Date: Thu, 21 Dec 2023 12:14:12 -0600 Subject: [PATCH] Normalize generator --- views/projects/item/hex/scripts/index.js | 22 +- views/projects/item/normalize/index.html | 7 +- .../item/normalize/scripts/generator.js | 208 ++++++++++++++++++ views/scripts/accessibility.js | 21 +- views/scripts/interface.js | 14 +- views/styles/normal.css | 29 ++- views/styles/normal_print.css | 1 - views/styles/style.css | 4 - views/styles/windows.css | 37 +++- 9 files changed, 286 insertions(+), 57 deletions(-) create mode 100644 views/projects/item/normalize/scripts/generator.js diff --git a/views/projects/item/hex/scripts/index.js b/views/projects/item/hex/scripts/index.js index 209215c..f186b29 100755 --- a/views/projects/item/hex/scripts/index.js +++ b/views/projects/item/hex/scripts/index.js @@ -21,20 +21,14 @@ function getData() { size_height.value, flag_type.value ); - var ac = averageColors(hexValue); - console.log(ac); - root.style.setProperty( - "--background-color", - arrayToColor(darkenColor(ac, 70)) - ); - root.style.setProperty("--color", arrayToColor(lightenColor(ac, 70))); - root.style.setProperty("--accent-color", arrayToColor(ac)); - root.style.setProperty( - "--accent-color-fg", - arrayToColor(lightenColor(ac, 90)) - ); + // var ac = averageColors(hexValue); + // console.log(ac); + // root.style.setProperty( + // "--base-color", + // arrayToColor(darkenColor(ac, 70)) + // ); - propagateStyles(getComputedStyle(root)); + // propagateStyles(getComputedStyle(root)); } generateButton.addEventListener("click", getData); @@ -142,4 +136,4 @@ function arrayToColor(color) { return ( "#" + color.map((x) => Math.floor(x).toString(16).padStart(2, "0")).join("") ); -} +} \ No newline at end of file diff --git a/views/projects/item/normalize/index.html b/views/projects/item/normalize/index.html index 5c6612b..a300bcf 100644 --- a/views/projects/item/normalize/index.html +++ b/views/projects/item/normalize/index.html @@ -5,7 +5,6 @@ Normalize - + + +

Hello, world!

+

This is a test.

+ + +`; + +function preview() { + const css = generateNormalizeCode(); + + generatorOutputs.view.contentDocument.getElementById("csshere").innerHTML = css; + generatorOutputs.code.textContent = ` + + + + Normalize Style + + + + + + +`; +} + +generatorOutputs.view.addEventListener("load", preview); \ No newline at end of file diff --git a/views/scripts/accessibility.js b/views/scripts/accessibility.js index d11e752..3593c56 100755 --- a/views/scripts/accessibility.js +++ b/views/scripts/accessibility.js @@ -54,30 +54,32 @@ function createAccessibilityNodes() {


-`; + +