feat: save theme to the localStorage
This commit is contained in:
parent
a750eeeab6
commit
7e768c926d
2
static/css/bootstrap.darkly.min.css
vendored
2
static/css/bootstrap.darkly.min.css
vendored
File diff suppressed because one or more lines are too long
@ -435,15 +435,21 @@
|
||||
|
||||
}
|
||||
|
||||
var theme = "light";
|
||||
function themeInit(){
|
||||
var theme = localStorage.getItem("theme");
|
||||
if(theme !== null){
|
||||
setPageTheme(theme);
|
||||
}
|
||||
}
|
||||
|
||||
function switchTheme(){
|
||||
if(theme === "light"){
|
||||
var theme = localStorage.getItem("theme");
|
||||
if(theme === "light" || theme === null){
|
||||
setPageTheme("dark");
|
||||
theme = "dark";
|
||||
localStorage.setItem("theme", "dark");
|
||||
}else{
|
||||
setPageTheme("light");
|
||||
theme = "light";
|
||||
localStorage.setItem("theme", "light");
|
||||
}
|
||||
}
|
||||
|
||||
@ -471,6 +477,7 @@
|
||||
});
|
||||
} , 3000);
|
||||
|
||||
themeInit();
|
||||
$(document).ready(updatePlaylist);
|
||||
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user