From 607ef76589bba0c9b3dc6f707b3a2a6763e67883 Mon Sep 17 00:00:00 2001 From: Juicysteak117 <20595808+Juicysteak117@users.noreply.github.com> Date: Thu, 16 Oct 2025 11:21:53 -0700 Subject: [PATCH] fixed the color detector to actually work. important to make functions do what you want them to do. --- export/pghrtjs.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/export/pghrtjs.js b/export/pghrtjs.js index 73bd730..f2a7bbe 100644 --- a/export/pghrtjs.js +++ b/export/pghrtjs.js @@ -43,7 +43,6 @@ function copyURI(evt) { // determines if the user has a set theme or a stored theme on load function detectColorScheme(){ var theme="light"; //default to light - localStorage.setItem('theme', 'light'); // not technically required //local storage is used to override OS theme settings if(localStorage.getItem("theme")){ if(localStorage.getItem("theme") == "dark"){ @@ -63,6 +62,7 @@ function detectColorScheme(){ localStorage.setItem('theme', 'dark'); // now honestly not to criticize this code i am copying too much but like // why not reuse the theme var here? surely it's more error prone this way? + // is there some sort of perf diff in js this way? surely not? nerds, assemble } } @@ -84,6 +84,7 @@ function initThemeToggle() { } // the same function except it's for font toggle +// btw i think i'm a little funny for the var naming function initFontToggle() { document.getElementById('font-toggle').addEventListener('click', () => { document.documentElement.setAttribute(