diff --git a/assets/scripts/features/darkmode/index.js b/assets/scripts/features/darkmode/index.js index f268af4..be1ce5a 100644 --- a/assets/scripts/features/darkmode/index.js +++ b/assets/scripts/features/darkmode/index.js @@ -39,6 +39,8 @@ window.addEventListener('load', async () => { // save preference to local storage saveScheme(newScheme) + + setImages(newScheme) } setScheme(loadScheme()) @@ -50,3 +52,19 @@ window.addEventListener('load', async () => { }) }) }) + +function setImages(newScheme) { + const els = Array.from(document.getElementsByClassName('logo-holder')); + for (const el of els) { + const light = el.querySelector('.light-logo'); + const dark = el.querySelector('.dark-logo'); + if (newScheme === "dark" && dark !== null) { + if (light !== null) light.style.display = 'none' + dark.style.display = 'inline' + } + else { + if (light !== null) light.style.display = 'inline' + if (dark !== null) dark.style.display = 'none' + } + } +} \ No newline at end of file diff --git a/layouts/partials/sections/education-alt.html b/layouts/partials/sections/education-alt.html index cbb6120..8716c5b 100644 --- a/layouts/partials/sections/education-alt.html +++ b/layouts/partials/sections/education-alt.html @@ -33,9 +33,13 @@