diff --git a/app/index.html b/app/index.html index 07bf437..0431655 100644 --- a/app/index.html +++ b/app/index.html @@ -2,11 +2,25 @@ - - - + + + + FitOS diff --git a/app/src/store/theme.ts b/app/src/store/theme.ts index 4eea088..022059d 100644 --- a/app/src/store/theme.ts +++ b/app/src/store/theme.ts @@ -15,12 +15,18 @@ function currentTheme(): Theme { } /* theme-color = kolor tła WIDOCZNY u góry strony (bg + poświata body::before), - nie płaski --bg — inaczej pole statusu (safe-area) tworzy ciemniejszy pas - nad treścią. Wartości zmieszane jak gradient „--ambient”. */ -function apply(theme: Theme) { + nie płaski --bg — inaczej pole statusu tworzy ciemniejszy pas nad treścią. + Wartości zmieszane jak gradient „--ambient”. Ekportowane — index.html ma + inline-skrypt z tymi samymi wartościami (kolor pola od pierwszego paintu). */ +export const THEME_COLORS: Record = { + dark: '#1d1612', + light: '#f6efea', +}; + +export function applyTheme(theme: Theme) { document.documentElement.classList.toggle('light', theme === 'light'); const meta = document.querySelector('meta[name="theme-color"]'); - if (meta) meta.setAttribute('content', theme === 'light' ? '#f6efea' : '#1d1612'); + if (meta) meta.setAttribute('content', THEME_COLORS[theme]); } interface ThemeState { @@ -29,7 +35,7 @@ interface ThemeState { } const initial = currentTheme(); -apply(initial); +applyTheme(initial); export const useTheme = create((set, get) => ({ theme: initial, @@ -40,7 +46,7 @@ export const useTheme = create((set, get) => ({ } catch { // ignore } - apply(next); + applyTheme(next); set({ theme: next }); }, })); diff --git a/app/src/topbar/Topbar.tsx b/app/src/topbar/Topbar.tsx index af8008f..c0d9fe0 100644 --- a/app/src/topbar/Topbar.tsx +++ b/app/src/topbar/Topbar.tsx @@ -114,9 +114,10 @@ export function Topbar({ onMenuOpen }: { onMenuOpen?: () => void }) { if (config?.search) presentGroups.add('search'); const menuOpen = openGroup != null && presentGroups.has(openGroup); - // Telefon: dolny pasek tylko gdy strona ma w nim coś do pokazania (bez - // „Wstecz”/hamburgera — one żyją w pływającym pasku tytułu u góry). + // Telefon: dolny pasek tylko gdy strona ma w nim coś do pokazania + // (nawigacja „Wstecz” też liczy się jako zawartość). const mobileBarEmpty = + !config?.back && !hasFilters && (config?.groups?.length ?? 0) === 0 && actions.length === 0 && @@ -125,26 +126,15 @@ export function Topbar({ onMenuOpen }: { onMenuOpen?: () => void }) { return (
- {/* telefon: header rozbity (contents) — tytuł jako pływający pasek z shadow, - bez belki na całą szerokość; akcje i tak żyją w dolnym pasku */} -
+ {/* telefon: header rozbity (contents) — tytuł jako pływająca pigułka z shadow; + akcje kontekstowe i tak żyją w dolnym pasku */} +
{/* telefon: otoczka tytułu na szerokość napisu, przylega do prawej (przy hamburgerze) */}

{config?.title}

- {/* telefon: „<” wracający do strony-rodzica (po prawej, przy hamburgerze) */} - {config?.back && ( - - )} - {/* telefon: hamburger po prawej pływającego paska; md+: sidebar ma własny */} + {/* telefon: hamburger pływający po prawej; md+: sidebar ma własny */} {onMenuOpen && ( + )} + {/* nawigacja (np. Kalendarz) zawsze widoczna, nie jest grupą */} + {config?.navWidget} {hasFilters && (