diff --git a/app/index.html b/app/index.html
index 0431655..c1d2f32 100644
--- a/app/index.html
+++ b/app/index.html
@@ -2,22 +2,32 @@
-
-
+
+
diff --git a/app/src/components/toast.tsx b/app/src/components/toast.tsx
index 8e1b485..442847d 100644
--- a/app/src/components/toast.tsx
+++ b/app/src/components/toast.tsx
@@ -50,7 +50,7 @@ export function ToastProvider({ children }: { children: ReactNode }) {
{children}
{toasts.map((t) => {
const { icon: Icon, cls } = TOAST_STYLES[t.kind];
diff --git a/app/src/store/theme.ts b/app/src/store/theme.ts
index 022059d..b508bfc 100644
--- a/app/src/store/theme.ts
+++ b/app/src/store/theme.ts
@@ -14,19 +14,32 @@ function currentTheme(): Theme {
return 'dark';
}
-/* theme-color = kolor tła WIDOCZNY u góry strony (bg + poświata body::before),
- nie płaski --bg — inaczej pole statusu tworzy ciemniejszy pas nad treścią.
- Wartości zmieszane jak gradient „--ambient”. Ekportowane — index.html ma
+/* theme-color = kolor tła WIDOCZNY u góry strony: w przeglądarce pas pod paskiem
+ statusu to wiersz tła (bg + poświata „--ambient”), w standalone (PWA) całe pole
+ safe-area to tło strony — stąd płaski --bg. 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 const THEME_COLORS: Record = {
+ dark: { browser: '#1d1612', standalone: '#141210' },
+ light: { browser: '#f6efea', standalone: '#f7f4f0' },
};
+function isStandalone(): boolean {
+ return (
+ (typeof window !== 'undefined' &&
+ typeof window.matchMedia === 'function' &&
+ window.matchMedia('(display-mode: standalone)').matches) ||
+ // iOS < 15.4 nie zna display-mode — legacy flaga standalone
+ (window.navigator as unknown as { standalone?: boolean }).standalone === true
+ );
+}
+
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_COLORS[theme]);
+ if (meta) {
+ const colors = THEME_COLORS[theme];
+ meta.setAttribute('content', isStandalone() ? colors.standalone : colors.browser);
+ }
}
interface ThemeState {
diff --git a/app/src/styles.css b/app/src/styles.css
index 53e6203..b8fb96b 100644
--- a/app/src/styles.css
+++ b/app/src/styles.css
@@ -302,6 +302,25 @@
}
}
+/* PWA (standalone) na iOS/Android: pływający tytuł i dolny pasek menu muszą
+ „dopełniać” pola safe-area (notch, home-indicator) — w przeglądarkowej
+ wersji robi to UI paska (theme-color), więc w media nie ma = zero kosztu */
+@media (display-mode: standalone) {
+ .safe-pad-top {
+ padding-top: env(safe-area-inset-top);
+ background-color: var(--bg);
+ }
+}
+
+/* dolny pasek menu istnieje tylko na telefonie ( void }) {
{/* 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) */}
@@ -149,7 +149,7 @@ export function Topbar({ onMenuOpen }: { onMenuOpen?: () => void }) {
(renderowany tylko gdy strona ma w nim jakąś opcję) */}