Loads the light logo after the page load

Lazy loading saved its bytes during page load, but left the logo empty for a
moment when navigating to the homepage on a wide screen. Also adds the second
unit's code summary and the shared docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-01 01:56:13 +01:00
co-authored by Claude Opus 5.5
parent b965b8a227
commit b5fd83256d
14 changed files with 176 additions and 37 deletions
@@ -23,6 +23,7 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
### seo.ts / sitePages.ts / sitemap.ts
- `pageHead(path: RoutePath)` → `{ meta, links }` (title, description, robots noindex if not indexed, OG tags, canonical)
- `siteHead(content: SiteContent)` → `{ meta, scripts }` (OG basics, JSON-LD ProfessionalService)
- `preloadImage(image, { media? })` → `HeadLink` (high-priority image preload link; prerendering display fallbacks)
- `canonicalUrl(path, base?)`, `jsonLdScript(data)`, `structuredDataScript(data)`, `professionalService(content)` (with `@id` `businessId` and `founder` → `personId`), `person(content, site, image)`, `aboutPage(path, content, site)`
- `sitePages: Record<RoutePath, PageMeta>`, `pageList(pages)`
- `sitemapXml(...)` — used by `config/sitemapPlugin.ts`
@@ -40,11 +41,11 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
- `RichParagraph({ paragraph: RichText })` — paragraph with inline links (moved from `about/`)
- `Eyebrow(TextProps & { as?: 'p' | 'span' | 'h2' | 'h3' | 'h4' })` — accent label, optionally a heading
- `SectionHeading({ id, title, eyebrow?, lead?, align?: 'center' | 'start', spacing?: 'default' | 'compact', focusable? })` — renders an h2
- `FramedImage({ image: ContentImage, aspectRatio })`, `DeferredImage(ImageProps & { image, near? })`, `Reveal(BoxProps & { delay? })`
- `FramedImage({ image: ContentImage, aspectRatio })`, `DeferredImage(ImageProps & { image, near? })` (also renders a `<noscript>` twin; prerendering display fallbacks), `Reveal(BoxProps & { delay? })` (visible in the HTML; hidden after hydration only when wholly below the viewport)
- `IntroGallery({ content })`, `AboutBlock({ content })`, `Pricing({ content, packages })`, `PriceCard(...)`, `Testimonials({ content, testimonials })`, `ContactSection({ content, packages, enabled, email, pakket? })`, `InstagramGrid({ content: InstagramContent, profileUrl })` (shared, `components/InstagramGrid/`)
- `ContactForm(...)`, `ContactFormGate({ enabled, email, ... })`
- `PhotoDuo({ photos: [ContentImage, ContentImage], label, 'data-testid'? })`
- `PortfolioGrid({ items: GalleryItem[], eagerCount = 3, onOpen(index), onIntent?(), 'data-testid'? })`, `Lightbox({ items, index: number | null, onIndexChange, onClose, label?, finalFocusEl? })` (default export, lazy-loadable), `FilterBar({ options: FilterOption[], value, onChange, label })`
- `PortfolioGrid({ items: GalleryItem[], eagerFirstRow = true, onOpen(index), onIntent?(), 'data-testid'? })`, `Lightbox({ items, index: number | null, onIndexChange, onClose, label?, finalFocusEl? })` (default export, lazy-loadable), `FilterBar({ options: FilterOption[], value, onChange, label })`
- `about/AboutIntro({ content })`, `about/StorySection({ content, titleId, tone?, spacing?, children? })`, `shoots/ShootList({ shoots, packages, portfolioShoots })` (types that link to the portfolio), `shoots/ShootBlock({ shoot, packages, reverse, priority, portfolioLink })`, `portfolio/PortfolioGallery({ photos, shootTypes, shoot, onShootChange })`
- `StatusPage({ title, children, actions? })`, `ErrorPage({ error, reset })`
- `LinkButton(RouterLink props & { variant?: 'outline' | 'accent' | 'light' })`
@@ -56,7 +57,7 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
- `useScrolledPast(getThreshold)` → boolean (stable `getThreshold` required)
- `useRouteFocus()` — focuses `<main>` after navigation
- `useDismiss(ref, active, onDismiss(reason: 'escape' | 'outside'))` — document-level Escape and outside pointer down, listeners only while `active` (unit 3)
- `useInView({ rootMargin, skip })` → `{ ref, inView }`; `usePageLoaded()` → boolean; `useReveal()` → `{ ref, visible }`
- `useInView({ rootMargin, skip })` → `{ ref, inView }`; `usePageLoaded()` → boolean; `useReveal()` → `{ ref, visible, animated }` (layout effect, visible by default); `lib/revealPhase.ts` (`startsHidden`, `nextRevealPhase`); `lib/firstRow.ts` (`GRID_COLUMNS`, `firstRow`, `firstRowPreloads`)
### Pure helpers (`lib/`)
- `emailAddress({ user, domain }): string | null`
@@ -61,7 +61,7 @@ Text alternative: client.tsx starts Sentry and hydrates the prerendered page (pr
### components/NavigationBar/
- **Purpose**: Site header and navigation
- **Responsibilities**: Fixed header, transparent over the hero on desktop until scrolled; shrinks after scroll; logo links home; desktop links and full-screen mobile menu from `mainNav`
- **Responsibilities**: Fixed header, transparent over the hero on desktop until scrolled; shrinks after scroll; logo links home (the light logo is lazy off `/` until the page has loaded); desktop links and full-screen mobile menu from `mainNav`; without JavaScript a `<noscript>` link opens the menu through `:target` CSS (`components/NoScript/`, display fallbacks)
- **Menu state**: one `useReducer(navMenuReducer)` (`lib/navMenuState.ts`) holds the mobile menu, its group, the desktop submenu and the focus request, so the hamburger, the panels and the route listener cannot disagree; `routeChanged` closes everything (also on browser back)
- **Type**: Application
@@ -108,7 +108,7 @@ Text alternative: client.tsx starts Sentry and hydrates the prerendered page (pr
### hooks/
- **Purpose**: Shared behaviour
- **Responsibilities**: `useRouteFocus`, `useScrolledPast`, `useInView` (IntersectionObserver), `usePageLoaded` (after the load event), `useReveal` (reveal once, immediately with reduced motion), `useHydrated`, `useEmailAddress` (prerendering: the first render equals the prerendered HTML)
- **Responsibilities**: `useRouteFocus`, `useScrolledPast`, `useInView` (IntersectionObserver), `usePageLoaded` (after the load event), `useReveal` (visible in the first render; a layout effect hides an element wholly below the viewport, which fades in once; never with reduced motion), `useHydrated`, `useEmailAddress` (prerendering: the first render equals the prerendered HTML)
- **Type**: Application
### seo.ts, sitePages.ts, sitemap.ts
@@ -3,7 +3,7 @@
## Test Coverage
- **Overall**: Good. Vitest with v8 coverage; 100% threshold enforced for `src/lib/**`, `src/seo.ts`, `src/sitemap.ts`; other files reported
- **Unit Tests**: Pure helpers, SEO, sitemap, monitoring config, security headers, server config (incl. drift check against `deploy/`)
- **Component Tests**: AppShell, NavigationBar, Footer, Hero (+ slider hook), BackToTop, PageIntro, StatusPage, Umami, all home sections, PageSection, MediaText, Eyebrow, SectionHeading, FramedImage, DeferredImage, Reveal, ContactForm(+Gate) — with axe accessibility checks; `app.test.tsx` renders whole routes
- **Component Tests**: AppShell, NavigationBar, Footer, Hero (+ slider hook), BackToTop, PageIntro, StatusPage, Umami, all home sections, PageSection, MediaText, Eyebrow, SectionHeading, FramedImage, DeferredImage, Reveal, NoScript CSS and menu links, first-row grid (display fallbacks; also `displayHydration`, `displayPrerender` and the e2e files `displayHtml`, `noJs`, `noJsMenu`, `reveal`, `images`), ContactForm(+Gate) — with axe accessibility checks; `app.test.tsx` renders whole routes
- **Property-based Tests**: fast-check, shared arbitraries in `src/test/arbitraries.ts`, seed logged in CI
- **Integration / E2E**: No browser E2E; Lighthouse CI covers built pages (accessibility, best practices, SEO, performance)
@@ -81,7 +81,7 @@ Candidates for modification are marked with ★ for the over-mij-page feature.
- `web/src/routes/portfolio.tsx` — the portfolio (indexed; `?shoot=` filter; `ImageGallery` JSON-LD); `web/src/components/portfolio/PortfolioGallery/`, `web/src/content/portfolioContent.ts`, `web/src/lib/portfolioFilters.ts`, `web/src/assets/portfolio/*` (10 photos × 2 sizes), `web/public/og-portfolio.jpg`
- `web/src/routes/{contact,privacyverklaring}.tsx` — placeholders with `PageIntro`
- `web/src/components/AppShell.tsx` — shell
- `web/src/components/NavigationBar/*` — header, NavLink (`sectionCurrent` underline for the parent of an open section), MobileNav (scrolls; Escape returns focus to the hamburger), NavSubmenu (desktop disclosure panel), MobileNavGroup (expandable shoot list on mobile), ChevronIcon
- `web/src/components/NavigationBar/*` — header, NavLink (`sectionCurrent` underline for the parent of an open section), MobileNav (scrolls; Escape returns focus to the hamburger), NavSubmenu (desktop disclosure panel), MobileNavGroup (expandable shoot list on mobile), ChevronIcon, NoScriptNav (two `<noscript>` menu links, display fallbacks)
- `web/src/components/Footer/*` — footer, FooterColumn, FooterLink
- `web/src/components/Hero/*` — hero slider, arrows, pause button, socials, slider hook
- `web/src/components/home/*` — five homepage sections (AboutBlock is the closest relative of the Over mij page's first block)
@@ -89,7 +89,7 @@ Candidates for modification are marked with ★ for the over-mij-page feature.
- ★ `web/src/components/PageSection/PageSection.tsx` — section frame for any page (was `HomeSection`)
- ★ `web/src/components/MediaText/MediaText.tsx`, `Eyebrow/Eyebrow.tsx` — framed photo next to text; accent label (unit 2 adds `mediaSize` `'medium'`)
- ★ `web/src/components/SectionHeading/SectionHeading.tsx` — eyebrow + h2 + lead
- ★ `web/src/components/FramedImage/FramedImage.tsx`, `DeferredImage/DeferredImage.tsx`, `Reveal/Reveal.tsx` — photo blocks and fade-in
- ★ `web/src/components/FramedImage/FramedImage.tsx`, `DeferredImage/DeferredImage.tsx`, `Reveal/Reveal.tsx` — photo blocks and fade-in (display fallbacks: `<noscript>` twin, visible-by-default `Reveal`); new `web/src/components/NoScript/` (`noScriptCss.ts`, `NoScriptStyles.tsx`: all no-JavaScript CSS in one head `<noscript><style>`); `data-requires-js` markers on controls that need JavaScript
- `web/src/components/ContactForm/*` — contact form and gate
- `web/src/components/BackToTop/BackToTop.tsx` — back-to-top button
- `web/src/components/Analytics/UmamiAnalytics.tsx` — Umami script injection
@@ -105,7 +105,7 @@ Candidates for modification are marked with ★ for the over-mij-page feature.
- `web/src/lib/*.ts` — pure helpers with tests
- `web/src/monitoring/*` — Sentry/Umami config and loader
- `web/src/navigation.ts` — `RoutePath`, `NavItem` (with `children`, one level), `hasChildren`, `mainNav` (the shoot submenu comes from `shootTypes` via `shootNavItems`), `footerNav`
- ★ `web/src/seo.ts`, `sitePages.ts`, `sitemap.ts` — SEO (`/over-mij` is `indexed: false` today)
- ★ `web/src/seo.ts` (+ `preloadImage`), `web/src/lib/{revealPhase,firstRow}.ts`, `sitePages.ts`, `sitemap.ts` — SEO (`/over-mij` is `indexed: false` today)
- ★ `web/lighthouserc.cjs` / `.desktop.cjs` — own list of indexed/noindex paths, guarded by a test
- `web/src/theme.ts`, `web/src/recipes/*.ts` — design system
- `web/src/test/*` — `renderWithProviders`, axe matcher, fast-check arbitraries, `fakeIntersectionObserver`, setup