add stuff & i dont really want to do this but i have no choice. testing in prod....

This commit is contained in:
hhh 2024-12-01 13:11:16 +02:00
parent df2491f0c0
commit 73a51d5fbd
27 changed files with 311 additions and 19 deletions

View file

@ -0,0 +1,19 @@
const themes = ['default', 'xmin', 'winter', '1337', 'red']
themes.forEach(theme => {
document.getElementById("themes").insertAdjacentHTML('afterbegin', "<option id='" + theme + "'>" + theme + "</option>" )
});
function changeClientTheme(theme) {
let link = document.createElement("link");
link.rel = "stylesheet";
link.href = "/css/themes/" + theme + ".css";
document.head.appendChild(link);
}
function changetheme() {
localStorage.setItem("theme", document.getElementById('themes').value);
changeClientTheme(document.getElementById('themes').value)
}
changeClientTheme(localStorage.getItem('theme'))