mirror of
https://github.com/ihhub/fheroes2.git
synced 2026-10-11 21:59:51 +00:00
Fix invalid changes
This commit is contained in:
@@ -24,8 +24,8 @@ class ThemeManager
|
||||
// Static properties
|
||||
static themeToggle = null;
|
||||
static themeKey = "theme";
|
||||
static darkTheme = "Evil";
|
||||
static lightTheme = "Good";
|
||||
static darkTheme = "dark";
|
||||
static lightTheme = "light";
|
||||
static accessibility = null;
|
||||
|
||||
// Static initialization method
|
||||
@@ -57,12 +57,12 @@ class ThemeManager
|
||||
this.themeToggle.textContent = theme === this.darkTheme ? "☀️ Good Interface" : "🌙 Evil Interface";
|
||||
|
||||
// Update ARIA attributes
|
||||
this.themeToggle.setAttribute( "aria-label", `Switch to ${theme === this.darkTheme ? this.lightTheme : this.darkTheme} Interface` );
|
||||
this.themeToggle.setAttribute( "aria-label", `Switch to ${theme === this.darkTheme ? this.lightTheme : this.darkTheme} mode` );
|
||||
this.themeToggle.setAttribute( "aria-pressed", theme === this.darkTheme ? "true" : "false" );
|
||||
|
||||
// Announce theme change if accessibility manager is available
|
||||
if ( this.accessibility ) {
|
||||
this.accessibility.announce( `${theme === this.darkTheme ? 'Evil' : 'Good'} Interface activated` );
|
||||
this.accessibility.announce( `${theme === this.darkTheme ? 'Dark' : 'Light'} mode activated` );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ class ThemeManager
|
||||
if ( this.themeToggle ) {
|
||||
// Set initial ARIA attributes
|
||||
const currentTheme = document.documentElement.getAttribute( "data-theme" );
|
||||
this.themeToggle.setAttribute( "aria-label", `Switch to ${currentTheme === this.darkTheme ? this.lightTheme : this.darkTheme} Interface` );
|
||||
this.themeToggle.setAttribute( "aria-label", `Switch to ${currentTheme === this.darkTheme ? this.lightTheme : this.darkTheme} mode` );
|
||||
this.themeToggle.setAttribute( "aria-pressed", currentTheme === this.darkTheme ? "true" : "false" );
|
||||
|
||||
// Add keyboard event handling
|
||||
|
||||
Reference in New Issue
Block a user