2025-01-16 15:12:22 +02:00
|
|
|
const themes = ['default', 'xmin', 'winter', '1337', 'red', 'red2']
|
2025-01-16 11:26:30 +02:00
|
|
|
|
|
|
|
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'))
|