B-secties: nav, hero, Over, Werkwijze, contactblok en footer volgens ontwerp B

Nieuwe tokens (brand, inv, panel, field, prog, body), Archivo als lettertype
(Sora en Instrument Sans verwijderd), witte toggles op het rode kopblok, en tests
voor structuur, landmarks en contrast in alle vier de thema's.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 00:10:27 +01:00
co-authored by Claude Sonnet 5.5
parent 0854e3a096
commit e1d950cd33
25 changed files with 715 additions and 170 deletions
@@ -0,0 +1,28 @@
# Code Summary — b-modern-sections (U2)
## What was built (design B, light and dark)
- **Tokens**: seven new semantic tokens in all four variant×mode sets (`brand`, `on-brand`, `body`, `inv`, `panel`, `field`, `prog`) plus Tailwind names; the constant brand red `#7A1414` (E: `#AC0000`) is used for hero, contact and featured elements in both modes, as in the canvas. Archivo Variable is now the face for `sans` and `display`; Sora and Instrument Sans (fonts and npm packages) are removed; JetBrains Mono stays for the code strip.
- **Header/nav** (`Nav.tsx`): brand block, not sticky, white text, white CTA block "Start project", both round toggles in the white `onBrand` tone (`toggleTone.ts`), mobile hamburger menu kept; `<nav aria-label="Hoofdnavigatie">` inside a `<header>`; no years in the menu.
- **Hero** (`Hero.tsx`): display headline "Websites, / apps / & meer." (`heroContent.displayHeading`, screen readers read the live heading via `aria-label`), lead from `content.ts`, buttons to `#pakketten` and `#contact`, black code strip with blinking caret and the eyebrow "Web & .NET development".
- **Over** (`AboutSection.tsx`): offset brand block behind a 3:4 photo (existing WebP/JPG variants), heading "Eén ontwikkelaar, korte lijnen", paragraphs from `content.ts`, three facts (`aboutFacts`).
- **Werkwijze** (`ProcessSection.tsx`, `ProcessStep.tsx`): black section, ordered list of three steps with progress bar (33/66/100 %), outlined numbers (decorative), phase, title and text from `content.ts` (`phase` added).
- **Contact frame** (`ContactSection.tsx`): brand block, display heading "Klaar om / te bouwen?", intro, mail link and a panel that holds the mailto call-to-action until the form (U4).
- **Footer**: black strip. **Layout**: `<header><Nav/></header>`, `<main id="main">`, footer; base text 17px/1.55.
- **Content additions** (`content.ts`): `heroContent.displayHeading`, `processSteps[].phase`, `aboutFacts`, `contactInfo.displayHeading`. Existing copy unchanged.
## Verification (Step 13.5, real output)
- Baseline of this unit (after U1): 10 files / 56 tests. After: **13 files / 122 tests passed**, `pnpm lint` 0 errors (same 2 existing warnings), `pnpm build` OK (main bundle 447 kB JS, 57 kB CSS; E chunk 0.9 kB; no Sora/Instrument files in `dist`; the new utilities `font-stretch`, `bg-brand`, `bg-inv`, `text-on-brand`, `bg-panel`, text-stroke are generated).
- New tests: WCAG contrast (text/body/muted/accent/on-brand/panel/field pairs ≥ 4.5:1) for all four token sets, parsed from `index.css`; section tests (headline parts, content text, links, anchors, facts, progress bars, panel button, footer); layout landmark test (banner with named navigation, one `main#main`, contentinfo, order, onBrand toggles, live region); updated nav tests.
## Deviations and notes for review
- **Hero headline**: the design's display headline replaces the visible "SLP software: websites, apps & meer"; the accessible name is still the live headline. To revert: render `heroContent.heading` instead of `displayHeading` in `Hero.tsx`.
- **Texts**: the live copy (`content.ts`, "wij bouwen ...") wins over the canvas wording ("ik bouw ..."). The contact panel intro sentence ("Stuur een bericht met je idee of vraag...") is new filler text for the panel until U4 replaces it with the form.
- **Packages block** (U3) is untouched and keeps the old card styling for now; it inherits the new tokens and the Archivo font.
- **Nav** is not sticky (as in the design); the old `scroll-mt-16` offsets on the packages eyebrow are harmless.
- **No browser screenshots** were possible here; visual fidelity (spacing, photo crop at 3:4 with `object-position 50% 30%`, dark mode look) needs a review in the browser.
- Lockfile contains the same peer-suffix churn as in U1 plus the removal of the two font packages.
## Hand-offs
- U3: replace `PackagesSection` (B styling, filter chips, swipe row); the section anchor `#pakketten` currently sits on its eyebrow `span`.
- U4: replace the panel content in `ContactSection` with the form; keep `data-testid="contact-panel"` and the `#contact` anchor.
- U5: reuse `toggleTone` for E where needed.
@@ -0,0 +1,44 @@
# Code Generation Plan — b-modern-sections (U2)
Single source of truth for U2 Code Generation. Inputs: `unit-of-work.md` (U2), requirements FR-1, NFR-1, NFR-2, execution plan (Functional Design, NFR and Infrastructure skipped for U2: the design exists in the Claude Design canvas, `Modern.dc.html` = B), U1 summary (`construction/theme-foundation/code/summary.md`).
## Unit context
- **Scope**: nav, hero, Over, Werkwijze, footer and the frame of the contact block in design B, light and dark, responsive 360px–1440px+. **Not in U2**: the packages block (U3: the existing `PackagesSection` stays as is, only inheriting tokens and font) and the contact form (U4: the panel inside the contact block shows the existing mailto call-to-action until then).
- **Workspace root**: `K:\Development\SlpSoftware\Projects\SlpSoftware`; modify in place. Branch `feature/redesign-modern-timetravel`; one commit for U2; no push.
- **Dependencies**: U1 (variant × mode tokens, toggles). **Blocks**: U3, U4 (frames).
- **Requirement mapping**: FR-1 (design B), NFR-1 (WCAG AA, landmarks, focus, reduced motion), NFR-2 (responsive), NFR-7.
## Design decisions taken from the canvas (and where content stays leading)
- **Layout/typography** as in `Modern.dc.html`: Archivo Variable with width axis (`font-stretch` 112–125%, weights 800–900), max width 1280px, section paddings 128–152px (smaller on mobile), square corners (no rounded cards), flat colour blocks.
- **Colour blocks**: hero and contact sit on the constant brand red `#7A1414` in light *and* dark mode (as in the canvas), black strips (`inv`) for the code line, Werkwijze and footer. New semantic tokens (all four variant×mode sets): `--color-brand`, `--color-on-brand`, `--color-body`, `--color-inv`, `--color-panel`, `--color-field`, `--color-prog`; Tailwind names `brand`, `on-brand`, `body`, `inv`, `panel`, `field`, `prog`. E gets matching values (`brand #AC0000`).
- **Text stays leading** (decision in requirements): body texts come from `content.ts` (the November text update). Where the design shows a different wording ("Maatwerk van SLP Software ... ik bouw het allemaal" vs the live "wij bouwen"), the live copy wins. Only structural additions are new content fields: `heroContent.displayHeading = ['Websites,', 'apps', '& meer.']` (display headline from the design; the live eyebrow "Web & .NET development" moves to the code strip), `aboutFacts` (3 facts: Direct contact / Eén werkdag / Vaste prijs, from the design), `processSteps[].phase` (Intake / Bouwen / Live), `contactInfo.displayHeading = ['Klaar om', 'te bouwen?']`.
- **Nav**: part of the hero header (not sticky, as in the design), white text on brand; the CTA "Start project" as white block; both toggles as white outlined circles (`tone="onBrand"` prop). The existing mobile menu (hamburger) is kept for small screens (better than wrapping links); years are not in the menu.
- **Over**: rectangular 3:4 photo with the offset brand block (real photo with the existing WebP/JPG variants), h2, two paragraphs, three-fact list.
- **Werkwijze**: black section, three steps with progress bar (33/66/100%), large outlined numbers (`-webkit-text-stroke`), phase, title, text; fixed `<ol>`.
- **Contact frame**: brand block, display heading, intro, mailto link, and a panel (`panel` colour) that contains the mailto button for now; U4 replaces the panel content with the form.
- **Reduced motion**: caret animation off (existing rule), no hover motion that moves layout.
## Steps
- [x] **Step 1 — Tokens**: extend `src/index.css` (four sets) and `tailwind.config.ts` (colors, `fontFamily.sans`/`display` → Archivo Variable, keep `mono`); remove the Sora and Instrument Sans imports from `src/fonts.ts` and the two packages from `package.json` (`pnpm remove`), keep JetBrains Mono and Archivo. Check contrast pairs in a small test (ratios computed from the token values: text/bg, muted/bg, on-brand/brand, accent/bg in both modes ≥ 4.5:1; large text ≥ 3:1).
- [x] **Step 2 — Content**: add the structural fields to `src/features/landing/data/content.ts` (types + values), without changing existing copy.
- [x] **Step 3 — Toggles**: add a `tone?: 'default' | 'onBrand'` prop to `ModeToggle` and `VariantToggle` (white outline/text variant for use on the brand block); defaults unchanged.
- [x] **Step 4 — Shell**: rewrite `Nav.tsx` (header band with nav; mobile menu kept; anchors without years), `Hero.tsx` (display headline, lead, two buttons, black code strip with caret), `Footer.tsx` (black strip); `RootLayout.tsx` places the hero header (nav + hero) inside the B shell as designed (Nav is rendered by `Hero`'s header wrapper or as sibling with the same brand background: decided in code, tested by landmarks).
- [x] **Step 5 — Sections**: rewrite `AboutSection.tsx`, `ProcessSection.tsx`, `ProcessStep.tsx`, `ContactSection.tsx` as described; `PackagesSection.tsx` untouched except removing classes that no longer exist if any (verify visually via tests only).
- [x] **Step 6 — Tests**: Vitest + Testing Library: nav (links without years, CTA, both toggles with onBrand styling, mobile menu), hero (headline parts, lead from content, code line, buttons link to `#pakketten` and `#contact`), about (heading, paragraphs from content, three facts, photo alt), process (ordered list of three steps, progress bars, numbers aria-hidden, phase/title/text), contact frame (heading parts, mailto link, panel with the mailto button), footer; landmarks (`header`, `nav aria-label`, `main`, `footer`, one `h1`, heading order), contrast test from Step 1. Update `Nav.test.tsx`.
- [x] **Step 7 — Build and test (automatic, Step 13.5)**: `pnpm lint`, `pnpm test`, `pnpm build`; fix and retry until green; report real counts. No manual browser check can be done by the AI in this environment; screenshots/visual check by the user at review time.
- [x] **Step 8 — Docs**: `construction/b-modern-sections/code/summary.md` (files, decisions, copy deviations from the canvas, hand-offs for U3/U4/U5).
- [x] **Step 9 — Commit**: one commit (Dutch message, `Co-Authored-By`), no push.
## Files (M modify, C create, D delete)
M `src/index.css`, `tailwind.config.ts`, `src/fonts.ts`, `package.json`, `pnpm-lock.yaml`, `src/features/landing/data/content.ts`, `src/components/ui/{ModeToggle,VariantToggle}.tsx`, `src/components/layout/{Nav,Footer,RootLayout}.tsx`, `src/features/landing/components/{Hero,AboutSection,ProcessSection,ProcessStep,ContactSection}.tsx`, tests; C `src/test/contrast.ts` (helper) and new test files under the touched folders; D none.
## Explicitly NOT touched in U2
`PackagesSection`, `PackageCard`, `PackageCardSkeleton`, `usePackagesQuery` (U3); the contact form and `cms-client` (U4); anything in `src/variants/e` beyond using the toggles (U5); router, Sentry, Umami.
## Risks
- The canvas hero headline ("Websites, apps & meer.") differs from the live H1 ("SLP software: websites, apps & meer"); treated as a display headline decision of the design, flagged in the summary so the user can revert it in one line.
- The package block keeps its old look until U3 and may look out of place between the new sections; accepted because units are not deployed separately.
- Visual fidelity cannot be screenshot-verified by the AI here; tests cover structure, text, links, landmarks and contrast.
## Traceability
FR-1, NFR-1, NFR-2, NFR-7; canvas `Modern.dc.html` (+ `ModernDark`); U1 token model; Security Baseline: no new external requests (fonts self-hosted), no inline scripts.