Adds the introduction block with a framed photo of Andrea and a link to the about page. Brings in FramedImage and an underline link variant for the later blocks, and narrows the load margin of deferred photos so nothing below the hero starts loading before the hero has painted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.7 KiB
Code Summary — Unit 2: Over mij
Plan: over-mij-code-generation-plan.md. Branch: feature/homepage-sections.
Files
Created
| File | Purpose |
|---|---|
web/src/assets/home/andrea.jpg |
Photo of Andrea, 1200×800, 75 KB (from the 1600×1067 original; the live site shows a 1024 px version) |
web/src/components/FramedImage/FramedImage.tsx + test |
Photo with the sand offset block behind it (CSS ::before, hidden below sm); uses DeferredImage |
web/src/components/home/AboutBlock/AboutBlock.tsx + test |
The "Over mij" section |
Modified
| File | Change |
|---|---|
web/src/content/types.ts |
HomeContent.about; the link target is a RoutePath |
web/src/content/homeContent.ts |
About content (live texts, photo, link to /over-mij) |
web/src/recipes/link.ts |
New underline variant (design .link-underline), reused by later units |
web/src/components/SectionHeading/* |
spacing="compact" for a heading above running text |
web/src/components/DeferredImage/*, IntroGallery.tsx |
Load margin 600 px → 200 px, shared constant DEFERRED_LOAD_MARGIN (see below) |
web/src/routes/index.tsx |
Renders AboutBlock after IntroGallery |
web/src/app.test.tsx |
Page-order check includes the "Over mij" section |
Fix during verification: deferred images raced the hero
The first pnpm check failed again on Lighthouse home mobile (0.77, LCP 5.3 s). Comparing all runs showed a race: when the gallery photos started before the observed LCP (164 ms vs 190 ms; 196 ms vs 219 ms) the simulated LCP was 5.3 s; when they started at or after it (221 ms vs 220 ms) it was 3.8 s. With a 600 px margin the gallery, ±240 px below the full-height hero, was "near" right after the load event. With 200 px nothing below the hero is in range when the page opens; the latest runs request none of those photos (mobile 0.84, LCP 3.9 s; desktop 1.0), so the result no longer depends on timing. Photos load as the visitor scrolls towards them; the placeholder and the reveal fade cover the short wait.
Verification (pnpm check)
- Lint ✅, Prettier ✅, build ✅
- Tests: 32 files, 142 passed
audit:deps✅;audit:devreport-only (unchanged)- Lighthouse home: mobile 0.84, desktop 1.0; accessibility, best practices, SEO 1.0 on all URLs
- Visual check (CDP): desktop 1440 — photo with sand block left, text right; phone 390 — stacked, no block
Extension compliance
- Security Baseline: no new dependencies or external resources (SECURITY-10/13); internal link only; other rules N/A.
- PBT: PBT-01 N/A (no logic); PBT-10 example-based tests for FramedImage, AboutBlock and the SectionHeading variant.