feat: přidání vzhledu My Little Pony
CI / Generate TypeScript types (push) Successful in 11s
CI / Build server (push) Successful in 30s
CI / Build client (push) Successful in 41s
CI / Playwright E2E tests (push) Successful in 1m53s
CI / Server unit tests (push) Successful in 27s
CI / Build and push Docker image (push) Successful in 57s
CI / Notify (push) Successful in 2s
CI / Generate TypeScript types (push) Successful in 11s
CI / Build server (push) Successful in 30s
CI / Build client (push) Successful in 41s
CI / Playwright E2E tests (push) Successful in 1m53s
CI / Server unit tests (push) Successful in 27s
CI / Build and push Docker image (push) Successful in 57s
CI / Notify (push) Successful in 2s
This commit is contained in:
10 files changed
+865
-9
No files matched your search
@@ -11,11 +11,12 @@ const STYLE_THEME_KEY = 'style_theme';
|
||||
export type ThemePreference = 'system' | 'light' | 'dark';
|
||||
|
||||
/** Vizuální styl aplikace (nezávislý na světlém/tmavém režimu). */
|
||||
export type StyleTheme = 'simple' | 'umamusume';
|
||||
export type StyleTheme = 'simple' | 'umamusume' | 'mlp';
|
||||
|
||||
export const STYLE_THEMES: { value: StyleTheme, label: string }[] = [
|
||||
{ value: 'simple', label: 'Jednoduchý' },
|
||||
{ value: 'umamusume', label: 'Umamusume' },
|
||||
{ value: 'mlp', label: 'My Little Pony' },
|
||||
];
|
||||
|
||||
export type SettingsContextProps = {
|
||||
@@ -63,8 +64,10 @@ function getInitialTheme(): ThemePreference {
|
||||
|
||||
function getInitialStyleTheme(): StyleTheme {
|
||||
try {
|
||||
if (localStorage.getItem(STYLE_THEME_KEY) === 'umamusume') {
|
||||
return 'umamusume';
|
||||
const saved = localStorage.getItem(STYLE_THEME_KEY);
|
||||
const known = STYLE_THEMES.find(t => t.value === saved);
|
||||
if (known) {
|
||||
return known.value;
|
||||
}
|
||||
} catch {
|
||||
// localStorage nedostupný
|
||||
@@ -213,7 +216,7 @@ function useProvideSettings(): SettingsContextProps {
|
||||
}, [styleTheme]);
|
||||
|
||||
// Aplikuje accent barvy při změně hue nebo přepnutí světlý/tmavý.
|
||||
// Styl Umamusume má vlastní pevnou paletu, accent barvu proto uplatňuje jen jednoduchý styl.
|
||||
// Tematické styly (Umamusume, My Little Pony) mají vlastní pevnou paletu, accent barvu proto uplatňuje jen jednoduchý styl.
|
||||
useEffect(() => {
|
||||
localStorage.setItem(ACCENT_HUE_KEY, String(accentHue));
|
||||
if (styleTheme === 'simple') {
|
||||
|
||||
Reference in new issue
Block a user