From 9e2d536c155e59b45ad1a5c5c2ab82a21830f72f Mon Sep 17 00:00:00 2001 From: Akshu121796 Date: Wed, 8 Jul 2026 01:07:47 +0530 Subject: [PATCH 1/2] fix: restore dark/light theme toggle functionality --- public/script.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/public/script.js b/public/script.js index 7f206c7..0aafb59 100644 --- a/public/script.js +++ b/public/script.js @@ -22,6 +22,8 @@ } function applyTheme(theme) { + console.log("applyTheme:", theme); + const isLight = theme === LIGHT_THEME; document.documentElement.classList.remove('light-theme-pending'); document.body.classList.toggle('light-theme', isLight); @@ -32,8 +34,7 @@ toggle.setAttribute('aria-label', isLight ? 'Switch to dark theme' : 'Switch to light theme'); toggle.title = isLight ? 'Switch to dark theme' : 'Switch to light theme'; } - addRecentTheme(theme); - renderQuickThemeSections(); + } function initThemeToggle() { @@ -43,9 +44,17 @@ applyTheme(savedTheme === LIGHT_THEME ? LIGHT_THEME : 'dark'); if (!toggle) return; - + console.log("Theme toggle initialized"); toggle.addEventListener('click', function () { - const nextTheme = document.body.classList.contains('light-theme') ? 'dark' : LIGHT_THEME; + console.log("Toggle clicked"); + + const nextTheme = + document.body.classList.contains('light-theme') + ? 'dark' + : LIGHT_THEME; + + console.log("Next theme:", nextTheme); + applyTheme(nextTheme); storeTheme(nextTheme); }); From 303e77b33233ddada9339f48ed20e1ee79456d87 Mon Sep 17 00:00:00 2001 From: Akshu121796 Date: Fri, 10 Jul 2026 22:47:51 +0530 Subject: [PATCH 2/2] chore: remove debug console logs --- public/script.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/public/script.js b/public/script.js index 0aafb59..321e1dd 100644 --- a/public/script.js +++ b/public/script.js @@ -22,8 +22,7 @@ } function applyTheme(theme) { - console.log("applyTheme:", theme); - + const isLight = theme === LIGHT_THEME; document.documentElement.classList.remove('light-theme-pending'); document.body.classList.toggle('light-theme', isLight); @@ -44,16 +43,14 @@ applyTheme(savedTheme === LIGHT_THEME ? LIGHT_THEME : 'dark'); if (!toggle) return; - console.log("Theme toggle initialized"); + toggle.addEventListener('click', function () { - console.log("Toggle clicked"); const nextTheme = document.body.classList.contains('light-theme') ? 'dark' : LIGHT_THEME; - console.log("Next theme:", nextTheme); applyTheme(nextTheme); storeTheme(nextTheme);