Skip to content

Commit 0cd598c

Browse files
committed
fix: nav bar visibility for the pwa on ios
1 parent 3c4a7ac commit 0cd598c

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

frontend/src/layouts/Base.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const bottomNavItem = (active: boolean) =>
3333
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
3434
<link rel="shortcut icon" href="/favicon.ico" />
3535
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
36-
<meta name="apple-mobile-web-app-title" content="Scrob" />
3736
<link rel="manifest" href="/site.webmanifest" crossorigin="use-credentials" />
3837
<!-- theme-color: dark default, overridden when light class is applied via JS -->
3938
<meta name="theme-color" content="#09090b" id="theme-color-meta" />
@@ -72,7 +71,7 @@ const bottomNavItem = (active: boolean) =>
7271
{!hideNav && (
7372
<nav class="px-4 md:px-6 py-3 md:py-4 text-sm relative z-30 bg-zinc-950 md:bg-transparent">
7473
<!-- Default bar -->
75-
<div id="nav-default" class="flex items-center justify-between gap-3">
74+
<div id="nav-default" class="flex items-center justify-between gap-3 safe-area-top">
7675
<!-- Left: logo + desktop links -->
7776
<div class="flex items-center gap-6 min-w-0">
7877
<a href="/" class="flex items-center gap-2 text-zinc-100 font-bold text-lg tracking-tight shrink-0 group active:opacity-70 transition-opacity">
@@ -142,7 +141,7 @@ const bottomNavItem = (active: boolean) =>
142141
</div>
143142

144143
<!-- Mobile search bar (hidden by default, shown when search icon tapped) -->
145-
<div id="nav-search" class="hidden items-center gap-2">
144+
<div id="nav-search" class="hidden items-center gap-2 safe-area-top">
146145
<button id="mobile-search-close" class="p-2 text-zinc-400 hover:text-zinc-100 transition-colors shrink-0" aria-label="Close search">
147146
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>
148147
</button>
@@ -163,6 +162,7 @@ const bottomNavItem = (active: boolean) =>
163162
<div id="now-playing-section"></div>
164163

165164
<main class="px-6 md:px-6 py-6 md:py-8 max-w-screen-xl mx-auto pb-24 md:pb-8">
165+
{hideNav && <div class="safe-area-top" />}
166166
<slot />
167167
</main>
168168

frontend/src/pages/history.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const baseUrl = `/history${type ? `?type=${type}` : ""}`;
6969
<div class="space-y-10">
7070
{dates.map((date) => (
7171
<div class="relative">
72-
<h2 class="text-lg font-bold text-zinc-100 mb-4 sticky top-0 py-2 bg-zinc-950/80 backdrop-blur-md z-10 flex items-center gap-3 border-b border-zinc-800/50">
72+
<h2 class="text-lg font-bold text-zinc-100 mb-4 sticky-top-safe py-2 bg-zinc-950/80 backdrop-blur-md z-10 flex items-center gap-3 border-b border-zinc-800/50">
7373
{date}
7474
</h2>
7575
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3">

frontend/src/styles/global.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ img, a {
136136
padding-bottom: env(safe-area-inset-bottom);
137137
}
138138

139+
.safe-area-top {
140+
padding-top: env(safe-area-inset-top);
141+
}
142+
143+
.sticky-top-safe {
144+
position: sticky;
145+
top: env(safe-area-inset-top);
146+
}
147+
139148
/* ── Mobile input improvements ─────────────────────────────────────────────
140149
16px font-size prevents iOS Safari from auto-zooming into inputs.
141150
min-height ensures comfortable touch targets. */

0 commit comments

Comments
 (0)