From f8186e2781118de63a8a1984f89edc748e5f0ff5 Mon Sep 17 00:00:00 2001 From: tisachi Date: Sat, 17 Oct 2026 01:56:04 +0200 Subject: [PATCH] =?UTF-8?q?App:=20mobilka=20bez=20covera=20=E2=80=94=20sti?= =?UTF-8?q?cky=20przy=20gornej=20krawedzi,=20Wstecz=20w=20dolnym=20pasku,?= =?UTF-8?q?=20theme-color=20z=20inline-skryptem=20(bez=20pasa=20w=20polu?= =?UTF-8?q?=20statusu)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index.html | 24 ++++++++++++++++++----- app/src/store/theme.ts | 18 +++++++++++------ app/src/topbar/Topbar.tsx | 41 ++++++++++++++++++++------------------- 3 files changed, 52 insertions(+), 31 deletions(-) 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 && (