Dark theme base

This commit is contained in:
Natsumi
2024-08-12 06:37:43 +12:00
parent 7528fb80c3
commit 65e5ef5bc6
5 changed files with 694 additions and 640 deletions

View File

@@ -15692,6 +15692,11 @@ speechSynthesis.getVoices();
};
$app.methods.changeThemeMode = async function () {
if (
document.contains(document.getElementById('app-theme-dark-style'))
) {
document.getElementById('app-theme-dark-style').remove();
}
if (document.contains(document.getElementById('app-theme-style'))) {
document.getElementById('app-theme-style').remove();
}
@@ -15704,7 +15709,11 @@ speechSynthesis.getVoices();
this.isDarkMode = false;
break;
case 'dark':
$appThemeStyle.href = 'theme.dark.css';
$appThemeStyle.href = '';
this.isDarkMode = true;
break;
case 'darkvanillaold':
$appThemeStyle.href = 'theme.darkvanillaold.css';
this.isDarkMode = true;
break;
case 'darkvanilla':
@@ -15720,21 +15729,22 @@ speechSynthesis.getVoices();
this.isDarkMode = true;
break;
case 'system':
if (this.systemIsDarkMode()) {
$appThemeStyle.href = 'theme.dark.css';
this.isDarkMode = true;
} else {
$appThemeStyle.href = '';
this.isDarkMode = false;
}
this.isDarkMode = this.systemIsDarkMode();
break;
}
if (this.isDarkMode) {
AppApi.ChangeTheme(1);
var $appThemeDarkStyle = document.createElement('link');
$appThemeDarkStyle.setAttribute('id', 'app-theme-dark-style');
$appThemeDarkStyle.rel = 'stylesheet';
$appThemeDarkStyle.href = 'theme.dark.css';
document.head.appendChild($appThemeDarkStyle);
} else {
AppApi.ChangeTheme(0);
}
document.head.appendChild($appThemeStyle);
if ($appThemeStyle.href) {
document.head.appendChild($appThemeStyle);
}
this.updateVRConfigVars();
await this.updatetrustColor();
};