diff --git a/static/js/main.js b/static/js/main.js index 9057b2d..b92a3e2 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -22,10 +22,14 @@ function switchTheme() { console.log("called") let current_theme = ([...document.documentElement.classList].includes('dark')) ? 'dark' : 'light'; if (current_theme === 'dark') { - localStorage.theme = 'light' - document.documentElement.classList.remove('dark') + localStorage.theme = 'light'; + document.documentElement.classList.remove('dark'); + document.getElementById('dark').add('hidden'); + document.getElementById('light').remove('hidden'); } else { - localStorage.theme = 'dark' - document.documentElement.classList.add('dark') + localStorage.theme = 'dark'; + document.documentElement.classList.add('dark'); + document.getElementById('light').remove('hidden'); + document.getElementById('dark').add('hidden'); } } diff --git a/templates/layout.html b/templates/layout.html index 7a0e141..e8b3ca6 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -62,11 +62,11 @@