mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-09 11:46:18 +00:00
Update themeSwitch.html
This commit is contained in:
parent
8b02617fe9
commit
f1369a4d4d
1 changed files with 2 additions and 3 deletions
|
@ -11,10 +11,10 @@
|
|||
function createThemeSwitcher() {
|
||||
const isDarkTheme = localStorage.getItem('dark-mode') === 'true';
|
||||
const isUltra = localStorage.getItem('isUltraDarkThemeEnabled') === 'true';
|
||||
const theme = isDarkTheme ? 'dark' : 'light';
|
||||
if (isUltra) {
|
||||
document.documentElement.setAttribute('data-theme', 'ultra-dark');
|
||||
}
|
||||
const theme = isDarkTheme ? 'dark' : 'light';
|
||||
document.querySelector('body').setAttribute('class', theme);
|
||||
return {
|
||||
isDarkTheme,
|
||||
|
@ -32,11 +32,10 @@
|
|||
this.isUltra = !this.isUltra;
|
||||
if (this.isUltra) {
|
||||
document.documentElement.setAttribute('data-theme', 'ultra-dark');
|
||||
localStorage.setItem('isUltraDarkThemeEnabled', 'true');
|
||||
} else {
|
||||
document.documentElement.removeAttribute('data-theme');
|
||||
localStorage.setItem('isUltraDarkThemeEnabled', 'false');
|
||||
}
|
||||
localStorage.setItem('isUltraDarkThemeEnabled', this.isUltra.toString());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue