diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index b354d4b..e21b499 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -73,6 +73,25 @@ function App() { getBookmarkedUrls().then(setBookmarkedUrls).catch(() => {}); }, []); + // On iOS, overscroll (rubber-band) reveals the html/body background. + // When the home page has a full-screen background image, force html+body + // to black so the overscroll area matches instead of flashing white. + const isHomeWithBg = !hasSearched && !!(bgInfo?.enabled && bgInfo?.url); + useEffect(() => { + const el = document.documentElement; + if (isHomeWithBg) { + el.style.backgroundColor = "#000"; + document.body.style.backgroundColor = "#000"; + } else { + el.style.backgroundColor = ""; + document.body.style.backgroundColor = ""; + } + return () => { + el.style.backgroundColor = ""; + document.body.style.backgroundColor = ""; + }; + }, [isHomeWithBg]); + const doSearch = useCallback( async (q: string, cat: Category = category, p: number = 1, size: ImageSize = imageSize, updateUrl = true) => { if (!q.trim()) return; @@ -252,11 +271,11 @@ function App() { // Home page (no search yet) if (!hasSearched) { return ( -
- {/* Background image */} +
+ {/* Background image — fixed so it covers the full viewport including iOS overscroll zones */} {bgUrl && (
diff --git a/frontend/src/index.css b/frontend/src/index.css index 6e43a01..b7e0e12 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -5,6 +5,8 @@ html, body { overflow-x: hidden; overscroll-behavior-x: none; + /* Prevent iOS rubber-band scroll from revealing white behind full-screen pages */ + overscroll-behavior-y: none; } :root {