diff --git a/files/assets/CHRISTMAS/js/default.js b/files/assets/CHRISTMAS/js/default.js index 0580b2217..aa7316b72 100644 --- a/files/assets/CHRISTMAS/js/default.js +++ b/files/assets/CHRISTMAS/js/default.js @@ -145,4 +145,19 @@ function expandDesktopImage(image) { document.getElementById("desktop-expanded-image").src = image.replace("200w_d.webp", "giphy.webp"); document.getElementById("desktop-expanded-image-link").href = image; document.getElementById("desktop-expanded-image-wrap-link").href=image; -}; \ No newline at end of file +}; + + +var previousTheme = []; + +function changeTheme(theme) { + const body = document.body; + // if previous selection has a value, remove them from body tag + if (previousTheme.length) { + previousTheme.map(v => body.classList.toggle(v)); + } + // toggle classes in body tag + theme.map(v => body.classList.toggle(v)); + // Set global previous selection to current selection + previousTheme = theme; +} \ No newline at end of file diff --git a/files/templates/CHRISTMAS/default.html b/files/templates/CHRISTMAS/default.html index eb732c04c..78e6385ca 100644 --- a/files/templates/CHRISTMAS/default.html +++ b/files/templates/CHRISTMAS/default.html @@ -347,7 +347,7 @@ {% if v %} {% endif %} - +