some changes to themes
This commit is contained in:
parent
26c526e433
commit
8237b6aa19
51 changed files with 852 additions and 12 deletions
19
themes/fzmin2/static/js/themes.js
Normal file
19
themes/fzmin2/static/js/themes.js
Normal 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'))
|
Loading…
Add table
Add a link
Reference in a new issue