add halloween theme

This commit is contained in:
Vick Scarlet
2021-10-31 02:09:55 +08:00
parent e38daf3ebb
commit 960f3137c6
3 changed files with 923 additions and 6 deletions

View File

@@ -70,7 +70,14 @@ class App{
`);
// Init theme
this.setTheme(localStorage.getItem('theme'))
let date = new Date();
if( date.getMonth() == 9 && date.getDate() == 31
|| date.getMonth() == 10 && date.getDate() == 1
){
this.setTheme('halloween');
} else {
this.setTheme(localStorage.getItem('theme'))
}
indexPage
.find('#restart')
@@ -804,10 +811,14 @@ class App{
setTheme(theme) {
const themeLink = $(document).find('#themeLink');
if(theme == 'light') {
themeLink.attr('href', 'light.css');
} else {
themeLink.attr('href', 'dark.css');
switch(theme){
case 'dark':
case 'light':
case 'halloween':
themeLink.attr('href', `${theme}.css`);
break;
default:
themeLink.attr('href', 'dark.css');
}
}