HifiPlanet-Website/hifi
Maaxxs 139d6c2c59 Add a toggleable page loading screen that waits for images
New app_settings.page_loader_enabled (default on) plus a checkbox in
Website-Einstellungen -> "Seiten-Ladeanzeige".

PageImageLoader.jsx wraps the routed page content (PublicLayout.jsx's
<Outlet />): the content stays mounted (so its images actually start
loading and any data-fetching effects still run) but is visually hidden
behind a spinner until every <img> currently in it has fired load/error.
Works generically across all public pages with no per-page changes,
since many pages (gallery/brand/model photos) only render their <img>
tags after an async API call resolves - a plain "scan once on mount"
check would find zero images and dismiss the loader immediately, so it
uses a MutationObserver to keep tracking newly-inserted images as data
arrives, and only dismisses once nothing has changed or finished loading
for a short settle window. A hard 8-second cap prevents the loader from
sticking forever if an image never resolves.

Overlay only covers the main content area (navbar/footer stay visible
and usable throughout), and the whole thing only mounts when the setting
is enabled - disabled, PublicLayout renders the page exactly as before.

Verified the backend setting end-to-end (migration, default value,
save/round-trip through SiteSettingsController). The loading behavior
itself is client-side timing logic I can't exercise in a real browser
here, so it's worth clicking through a few pages (especially
image-heavy ones like the gallery) before this goes live.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-11 11:47:53 +02:00
..
api Add a toggleable page loading screen that waits for images 2026-09-11 11:47:53 +02:00
assets Add a toggleable page loading screen that waits for images 2026-09-11 11:47:53 +02:00
.htaccess Fix data export/import: PHP's default upload limits rejected real exports 2026-07-21 00:54:34 +02:00
favicon.png Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
index.html Add a toggleable page loading screen that waits for images 2026-09-11 11:47:53 +02:00
robots.txt Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00