Adds the homepage sections below the hero #6

Merged
Sluijsens merged 15 commits from feature/homepage-sections into master 2026-10-22 02:40:58 +02:00
158 changed files with 9621 additions and 293 deletions
+2 -1
View File
@@ -13,7 +13,7 @@ Used by every page except Shell (see exception below):
- If a page needs more blocks than the template currently has letters for, add a new letter/color rather than cycling back to `A` — never reuse a color, since that would visually suggest two different blocks are "the same element." A new color's stroke is always its fill at 25% darker (multiply each RGB channel by 0.75, round, convert back to hex), kept in the same style: medium-high saturation, similar lightness to the existing set.
- For two sections that sit side-by-side in one row (e.g. Contact's Photo + Contact form), switch that page's diagram to `columns 2`, give full-width blocks a `:2` span, and place the side-by-side pair as plain unspanned nodes next to each other in the code (no composite container needed) — small manual width tweaks to line them up are fine, it only needs to look "good enough."
Current letter → color template (extend with a new letter using the same formula if a 7th block is ever needed):
Current letter → color template (extend with a new letter using the same formula if an 8th block is ever needed):
```
style A fill:#e76f51,stroke:#ad533d,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
@@ -22,6 +22,7 @@ style C fill:#2a9d8f,stroke:#20766b,color:#fff,font-size:16px,width:400px,height
style D fill:#264653,stroke:#1d353e,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
style E fill:#e9c46a,stroke:#af9350,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
style F fill:#b56576,stroke:#884c59,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
style G fill:#6d7fcc,stroke:#525f99,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
```
## Exception — Shell
+4 -2
View File
@@ -24,8 +24,9 @@ columns 1
B["Highlights"]
C["About me"]
D["Prices"]
E["Contact"]
F["Instagram"]
E["Testimonials"]
F["Contact"]
G["Instagram"]
style A fill:#e76f51,stroke:#ad533d,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
style B fill:#f4a261,stroke:#b77a49,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
@@ -33,6 +34,7 @@ columns 1
style D fill:#264653,stroke:#1d353e,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
style E fill:#e9c46a,stroke:#af9350,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
style F fill:#b56576,stroke:#884c59,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
style G fill:#6d7fcc,stroke:#525f99,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
```
## About me
@@ -1,42 +1,67 @@
# API Documentation
## REST APIs
None. The project has no back-end yet. The static design README anticipates these future endpoints on a .NET API:
- `POST /api/contact` — contact form, payload `{ naam, email, onderwerp, bericht }`
None. There is no back-end yet (`api/` is empty). The static design README anticipates these endpoints on a .NET API:
- `POST /api/contact` — contact form, payload `{ naam, email, onderwerp, bericht }` (maps to a C# `ContactRequest` record)
- `/api/pages`, `/api/portfolio`, `/api/packages` — CMS content
## Internal APIs
### Routes (TanStack Router, file-based)
| Path | File | Head | Component |
|------|------|------|-----------|
| (root) | `routes/__root.tsx` | `siteHead` | `AppShell` via `RootLayout` |
| `/` | `routes/index.tsx` | `pageHead(...)` | `Hero` |
| `/over-mij` | `routes/over-mij.tsx` | `pageHead(...)` | placeholder |
| Path | File | Head | Component | Indexed |
|------|------|------|-----------|---------|
| (root) | `routes/__root.tsx` | `siteHead(siteContent)` | `AppShell` | — |
| `/` | `routes/index.tsx` | `pageHead('/')` | `Hero` | yes |
| `/over-mij` | `routes/over-mij.tsx` | `pageHead(...)` | `PageIntro` placeholder | no |
| `/portfolio` | `routes/portfolio.tsx` | `pageHead(...)` | `PageIntro` placeholder | no |
| `/soorten-fotoshoots` | `routes/soorten-fotoshoots.tsx` | `pageHead(...)` | `PageIntro` placeholder | no |
| `/contact` | `routes/contact.tsx` | `pageHead(...)` | `PageIntro` placeholder | no |
| `/privacyverklaring` | `routes/privacyverklaring.tsx` | `pageHead(...)` | `PageIntro` placeholder | no |
| (not found) | — | — | `NotFound` | — |
### seo.ts
- **Methods**: `pageHead({ title: string, description: string })` → `{ meta: [...] }`; `siteHead` constant
- **Return Types**: TanStack Router `head` option object (title, description, og:title, og:description)
### 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)
- `canonicalUrl(path, base?)`, `jsonLdScript(data)`, `professionalService(content)`
- `sitePages: Record<RoutePath, PageMeta>`, `pageList(pages)`
- `sitemapXml(...)` — used by `config/sitemapPlugin.ts`
### Components (props)
- `AppShell()` — no props
- `NavigationBar()` — no props; reads route via `useRouterState`, scroll via `useScrolledPast`
- `NavLink(props: ComponentProps<ChakraLink>)`
- `MobileNav({ id: string, open: boolean, onClose: () => void })`
- `Footer()` — no props
- `LinkButton(props: ChakraLink props & { variant?: 'outline' | 'accent' | 'light' })`
- `Hero({ content: HeroContent })`, `HeroArrows({ onPrev, onNext })`, `HeroSocials({ socials: HeroSocial[] })`
- `AppShell()`, `NavigationBar()`, `BackToTop()`, `NotFound()` — no props
- `MobileNav({ id, open, onClose })`, `NavLink(RouterLink props)`
- `Footer({ content: SiteContent })`, `FooterColumn({ title, children })`, `FooterLink(LinkProps)`
- `Hero({ content: HeroContent, socials: SocialLink[] })`, `HeroArrows({ onPrev, onNext })`, `HeroPauseButton({ stopped, onToggle })`, `HeroSocials({ socials })`
- `PageIntro({ title, eyebrow?, children? })` — renders the page's only h1
- `StatusPage({ title, children, actions? })`, `ErrorPage({ error, reset })`
- `LinkButton(RouterLink props & { variant?: 'outline' | 'accent' | 'light' })`
- `UmamiAnalytics({ hostname? })`
### Hooks
- `useScrolledPast(getThreshold: () => number): boolean` — `getThreshold` must be referentially stable (it is an effect dependency)
- `useHeroSlider(count: number)` → `{ active, reducedMotion, autoplay, paused, next, prev, handlers }`
- `useHeroSlider(count)` → slider state, controls, handlers, `HeroAnnouncement`
- `useScrolledPast(getThreshold)` → boolean (stable `getThreshold` required)
- `useRouteFocus()` — focuses `<main>` after navigation
### Pure helpers (`lib/`)
- `emailAddress({ user, domain }): string | null`
- `visibleSocials(socials): SocialLink[]` — only valid https links
- `copyrightLine(year): string`
- `slidesToLoad(active, count): number[]`
- `backToTopThreshold(viewportHeight): number`
### Monitoring
- `monitoringFor(hostname): Monitoring | null`, `startSentry(hostname?)`, `reportError(error)`
## Data Models
### NavItem (`navItems.ts`)
- **Fields**: `to` (route path), `label` (Dutch menu label)
- **Validation**: `as const` — `to` must be a registered route for type-safe `Link`
### HeroContent (`Hero/types.ts`)
- **Fields**: `title`, `tagline`, `cta: { label, to }`, `slides: { id, src, alt }[]`, `socials: { platform, href }[]`
- **Relationships**: `HeroSocial.platform` is a `SocialPlatform` key from `socialPlatforms.ts`
- **Validation**: empty `href` → social not shown
### SiteContent (`content/types.ts`)
- **Fields**: `footerIntro: string`, `socials: SocialLink[]`, `email: EmailAddress`
### SocialLink
- **Fields**: `platform: SocialPlatform` (`facebook` | `instagram`), `href: string`
- **Validation**: shown only if `href` is a valid https URL
### EmailAddress
- **Fields**: `user`, `domain` — assembled only in the browser; invalid parts → hidden
### HeroContent
- **Fields**: `title`, `tagline`, `cta: { label, to }`, `slides: { id, src, alt }[]`
### NavItem (`navigation.ts`)
- **Fields**: `to: RoutePath`, `label: string`
### PageMeta (`sitePages.ts`)
- **Fields**: `title`, `description`, `indexed`, `ogImage?`
@@ -1,79 +1,107 @@
# System Architecture
## System Overview
A single client-side React SPA (`web/`) built with Vite. Routing is file-based via TanStack Router; styling uses Chakra UI v3 with a custom theme system (tokens taken from the static design). There is no back-end, API, database or deployment pipeline yet; the README states a .NET API is planned. Content is currently hard-coded in TypeScript modules shaped so they can later come from that API.
A single client-side React SPA (`web/`) built with Vite. Routing is file-based via TanStack Router; styling uses Chakra UI v3 with a custom system (tokens from the static design). There is no back-end, API or database; `api/` is an empty placeholder for the planned .NET API. Content lives in typed TypeScript modules under `web/src/content/`, shaped so the API can later deliver it 1-to-1. One build serves both environments; the hostname decides whether monitoring is active.
## Architecture Diagram
```mermaid
graph TD
Main["main.tsx: ChakraProvider + ThemeProvider + RouterProvider"] --> Root["routes/__root.tsx: HeadContent + AppShell + Devtools"]
Main["main.tsx: Sentry start, router, ChakraProvider"] --> Root["routes/__root.tsx: HeadContent, AppShell, 404 and error components"]
Root --> Shell["components/AppShell.tsx"]
Shell --> Nav["NavigationBar (+ NavLink, MobileNav, navItems)"]
Shell --> Skip["SkipNavLink and main landmark"]
Shell --> Nav["NavigationBar (NavLink, MobileNav)"]
Shell --> Outlet["Outlet (active page route)"]
Shell --> Footer["Footer (placeholder)"]
Shell --> Footer["Footer (FooterColumn, FooterLink)"]
Shell --> ToTop["BackToTop"]
Shell --> Umami["UmamiAnalytics"]
Outlet --> Home["routes/index.tsx: Hero"]
Outlet --> About["routes/over-mij.tsx: placeholder"]
Home --> Hero["Hero (+ HeroArrows, HeroSocials, useHeroSlider)"]
Hero --> Content["heroContent.ts (static content)"]
Nav --> Scroll["hooks/useScrolledPast"]
Theme["theme.ts + recipes/linkButton.ts"] -.-> Main
Seo["seo.ts: pageHead / siteHead"] -.-> Root
Outlet --> Placeholders["over-mij, portfolio, soorten-fotoshoots, contact, privacyverklaring: PageIntro"]
Home --> Hero["Hero (HeroArrows, HeroPauseButton, HeroSocials, useHeroSlider)"]
Content["content/: siteContent, heroContent, types"] -.-> Shell
Content -.-> Home
Nav --> NavData["navigation.ts: mainNav, footerNav"]
Footer --> NavData
Seo["seo.ts + sitePages.ts"] -.-> Root
Seo -.-> Home
Theme["theme.ts + recipes/"] -.-> Main
classDef entry fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef shell fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef page fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef support fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
class Main,Root entry;
class Shell,Nav,Footer,Outlet shell;
class Home,About,Hero page;
class Content,Scroll,Theme,Seo support;
class Shell,Skip,Nav,Footer,ToTop,Umami,Outlet shell;
class Home,Placeholders,Hero page;
class Content,NavData,Seo,Theme support;
```
Text alternative: main.tsx mounts providers and the router; the root route renders AppShell (NavigationBar, the active page via Outlet, Footer); the home route renders the Hero; theme and SEO helpers support all of it.
Text alternative: main.tsx starts Sentry and mounts the router; the root route renders AppShell (skip link, NavigationBar, the page via Outlet, Footer, BackToTop, Umami); the home route renders the Hero, the other routes render placeholder PageIntros; content, navigation, SEO and theme modules support all of it.
## Component Descriptions
### main.tsx
- **Purpose**: Application bootstrap
- **Responsibilities**: Creates the router, registers types, mounts ChakraProvider (custom system), next-themes ThemeProvider (light only), loads self-hosted fonts, removes static fallback head tags
- **Dependencies**: routeTree.gen.ts, theme.ts
- **Responsibilities**: Starts Sentry (deferred), creates the router (scroll restoration, default error component), mounts ChakraProvider (light only), loads self-hosted fonts, removes static fallback head tags
- **Type**: Application
### routes/__root.tsx
- **Purpose**: Root route / layout
- **Responsibilities**: Site-wide head tags (`siteHead`), renders `HeadContent`, `AppShell` and router devtools
- **Dependencies**: AppShell, seo.ts
- **Responsibilities**: Site-wide head (`siteHead`: OG basics + JSON-LD), `HeadContent`, `AppShell`, dev-only router devtools, `NotFound` and `ErrorPage`
- **Type**: Application
### components/AppShell.tsx
- **Purpose**: Application shell
- **Responsibilities**: Renders NavigationBar, `<Outlet />`, Footer. No `<main>` landmark, skip link or to-top button yet
- **Purpose**: Application shell (LAYOUT.md "Shell")
- **Responsibilities**: Skip link + `<main id="main">`, NavigationBar, Outlet, Footer, BackToTop, UmamiAnalytics; moves focus to main on route change (`useRouteFocus`)
- **Type**: Application
### components/NavigationBar/
- **Purpose**: Site header and navigation
- **Responsibilities**: Fixed header; transparent over the hero on desktop on `/` until scrolled 150px; shrinks after scroll (desktop); swaps dark/light logo; desktop link list with animated underline (`NavLink`); hamburger button and full-screen `MobileNav` below `lg` (Escape to close, body scroll lock, clip-path reveal). `navItems.ts` is the single menu source (currently Home, Over mij)
- **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`
- **Type**: Application
### components/Footer.tsx
### components/Footer/
- **Purpose**: Site footer
- **Responsibilities**: Placeholder copyright line only; uses Tailwind-style `className`s that have no effect (Tailwind is not installed)
- **Responsibilities**: Logo + intro text, Socials column, Contact column (e-mail assembled in the browser), copyright line, footer menu from `footerNav`; empty columns are omitted
- **Type**: Application
### components/Hero/
- **Purpose**: Homepage hero slider
- **Responsibilities**: Crossfade slides with zoom, progress bar driven autoplay, arrows, swipe, pause on hover/focus/hidden tab, reduced-motion support, social icons. Content typed in `types.ts` for future API use; `socialPlatforms.ts` maps platform keys to offline Iconify icons
- **Purpose**: Homepage hero slider (the only homepage section so far)
- **Responsibilities**: Crossfade slides, progress-driven autoplay, arrows, swipe, pause button, pause on hover/focus/hidden tab, reduced motion, live-region announcements, lazy loading of nearby slides, social icons
- **Type**: Application
### theme.ts / recipes/linkButton.ts
- **Purpose**: Design system
- **Responsibilities**: Colour, font, spacing, easing, duration tokens; semantic `bg`/`fg`, `header` size tokens; `eyebrow`/`display` text styles; `linkButton` recipe (outline / accent / light)
- **Type**: Application (shared UI foundation)
### components/PageIntro/, StatusPage/
- **Purpose**: Shared page building blocks
- **Responsibilities**: `PageIntro` — eyebrow, the page's h1 and an intro (used by placeholders); `StatusPage` — layout for 404 and error pages
- **Type**: Application
### seo.ts
- **Purpose**: Head tag helpers
- **Responsibilities**: `pageHead({title, description})` for route `head` options; `siteHead` for site-wide Open Graph tags
- **Type**: Application (utility)
### content/
- **Purpose**: Static content until the CMS API exists
- **Responsibilities**: `types.ts` (API-shaped interfaces), `siteContent.ts` (footer intro, socials, e-mail parts), `heroContent.ts` (title, tagline, CTA, slides), `socialPlatforms.ts` (platform → name + offline icon)
- **Type**: Application (data)
### lib/
- **Purpose**: Pure, fully tested helpers
- **Responsibilities**: `emailAddress`, `visibleSocials`, `copyrightLine`, `slidesToLoad`, `backToTopThreshold`
- **Type**: Application (utility, 100% coverage threshold)
### seo.ts, sitePages.ts, sitemap.ts
- **Purpose**: SEO
- **Responsibilities**: Page registry (title, description, `indexed`), `pageHead(path)`, canonical URLs, JSON-LD, sitemap generation at build time (via `config/sitemapPlugin.ts`)
- **Type**: Application (utility, 100% coverage threshold)
### monitoring/
- **Purpose**: Error reporting and analytics configuration
- **Responsibilities**: Hostname → environment map, Sentry DSN and origins; Sentry loaded after the load event with a queue
- **Type**: Application
### config/ (build-time, Node)
- **Purpose**: Server configuration as code
- **Responsibilities**: `securityHeaders.ts` (CSP + headers for dev/preview/prod), `serverConfig.ts` (generates `deploy/iis/web.config` and nginx confs; a test checks they are in sync), sitemap plugin, test seed
- **Type**: Infrastructure-as-code (small)
### theme.ts / recipes/
- **Purpose**: Design system
- **Responsibilities**: Colour, font, spacing, easing, duration, z-index tokens; semantic `bg`/`fg`/`focusRing`, `header`/`content`/`pageTop` sizes; `eyebrow`/`display`/`pageTitle` text styles; recipes `container`, `link` (subtle), `linkButton` (outline/accent/light), `iconControl`, `skipNavLink`
- **Type**: Application (shared UI foundation)
## Data Flow
@@ -90,18 +118,19 @@ sequenceDiagram
V->>R: Open URL or click nav link
R->>S: Render root layout
S->>P: Render matched route via Outlet
P-->>R: head() title and meta
R-->>V: Updated page and head tags
P-->>R: head() title and meta from sitePages
R-->>V: Updated page, head tags, focus on main
```
Text alternative: a visitor navigates, the router renders the root layout (AppShell), which renders the matched page through the Outlet; the page's head() supplies title/meta tags.
Text alternative: a visitor navigates, the router renders the root layout (AppShell), which renders the matched page through the Outlet; the page's head() supplies title/meta from the page registry and focus moves to main.
## Integration Points
- **External APIs**: None yet (planned .NET API for content and contact form)
- **External APIs**: None yet (planned .NET API for content and the contact form — design README: `POST /api/contact` with `{ naam, email, onderwerp, bericht }`)
- **Databases**: None
- **Third-party Services**: Outbound links only — Facebook, Instagram profiles
- **Third-party Services**: Sentry (errors, EU ingest), Umami at analytics.slpsoftware.nl (cookieless stats), UptimeRobot (availability, external), outbound links to Facebook/Instagram
## Infrastructure Components
- **CDK Stacks**: None
- **Deployment Model**: Not defined yet; output is a static Vite build (`dist/`)
- **IaC**: None beyond generated web server configs in `web/deploy/`
- **Deployment Model**: Static `dist/` build. Test: scp to nginx on a Raspberry Pi (auto on push to master). Production: FTPS to an IIS webhost (manual, `release/*` only, after Lighthouse)
- **Security headers**: Strict CSP — `script-src 'self'` + Umami, `connect-src 'self'` + Umami + Sentry, **`form-action 'self'`**, `frame-ancestors 'none'`. Any third-party form or script endpoint must be added here (and regenerated into the server configs)
- **Networking**: N/A
@@ -7,7 +7,9 @@ graph LR
Visitor["Website visitor (prospective client)"] --> Site["Andrea Slop Fotografie website (React SPA)"]
Crawler["Search engines and link previews"] --> Site
Site --> Social["Facebook and Instagram profiles"]
Site --> Mail["E-mail (info@andreaslop.nl)"]
Site --> Mail["E-mail (mailto, address assembled in the browser)"]
Site --> Umami["Umami (cookieless visitor stats)"]
Site --> Sentry["Sentry (JS error reports)"]
Owner["Andrea (photographer, content owner)"] -.-> CMS["Planned .NET API / CMS"]
CMS -.-> Site
classDef person fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
@@ -16,32 +18,46 @@ graph LR
classDef planned fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,stroke-dasharray:5 5,color:#000;
class Visitor,Owner,Crawler person;
class Site system;
class Social,Mail external;
class Social,Mail,Umami,Sentry external;
class CMS planned;
```
Text alternative: visitors and crawlers use the website, which links out to social profiles and e-mail; a planned .NET API/CMS (dashed) will later supply content managed by Andrea.
Text alternative: visitors and crawlers use the website, which links out to social profiles and e-mail and reports to Umami and Sentry; a planned .NET API/CMS (dashed) will later supply content managed by Andrea.
## Business Description
- **Business Description**: Portfolio and marketing website for Andrea Slop Fotografie, a lifestyle photographer in Huizen (NL). It presents her work (loveshoots, family, pregnancy and newborn shoots), tells who she is, lists shoot types and prices, and gets prospective clients to make contact. It replaces an existing WordPress (Solene theme) site at andreaslop.nl.
- **Business Transactions** (current state — front-end only, no back-end yet):
- **Browse the homepage** — hero slider with featured photos, call-to-action to "Over mij"
- **Navigate between pages** — header navigation (desktop) and hamburger menu (mobile)
- **Visit social profiles** — Facebook / Instagram links in the hero
- **Share / discover pages** — per-page title, meta description and Open Graph tags for search engines and link previews
- *Planned (static design only)*: portfolio browsing with lightbox, shoot types and pricing, contact form, Instagram feed
- **Business Description**: Portfolio and marketing website for Andrea Slop Fotografie, a lifestyle photographer in Huizen (NL). It presents her work (loveshoots, family, pregnancy and newborn shoots), tells who she is, lists shoot types and prices, and gets prospective clients to make contact. It will replace the existing WordPress (Solene theme) site at andreaslop.nl; a test build runs at test.andreaslop.nl.
- **Business Transactions** (current state — front-end only, no back-end):
- **Browse the homepage** — hero slider with featured photos (autoplay, arrows, swipe, pause button, screen reader announcements), call-to-action to "Over mij"
- **Navigate between pages** — header navigation (desktop), full-screen menu (mobile), footer menu, skip link, back-to-top button
- **Visit social profiles** — Facebook / Instagram links in the hero and footer
- **E-mail the photographer** — mailto link in the footer
- **Share / discover pages** — per-page title, description, canonical URL, Open Graph tags, JSON-LD (ProfessionalService), sitemap.xml, robots.txt
- **Recover from errors** — 404 page inside the shell, error page with retry
- *Placeholder pages (noindex)*: Over mij, Portfolio, Soorten fotoshoots, Contact, Privacyverklaring
- *Planned (static design only)*: homepage sections below the hero (lifestyle gallery, about, prices, contact form, Instagram), portfolio with lightbox, shoot types and pricing page, contact page
- **Business Dictionary**:
- **Shell** — the Header / page content / Footer frame shared by every page (see LAYOUT.md)
- **Hero** — full-screen photo slider at the top of the homepage
- **Info menu / side area** — slide-in panel from the design with socials and e-mail (out of scope for this site, by owner decision)
- **Highlights / Lifestyle fotografie** — homepage intro section with a four-photo gallery
- **Package (pakket)** — a priced shoot offer (Newborn, Zwangerschap, Loveshoot) with what is included
- **Shoot** — a photo session type (newborn, pregnancy, loveshoot, portraits)
- **CMS** — the planned .NET API that will provide page content; content is hard-coded until then
- **Info menu / side area** — slide-in panel from the design (out of scope, by owner decision)
- **CMS** — the planned .NET API that will provide page content and receive the contact form; content is hard-coded in `web/src/content/` until then
- **Placeholder page** — a route that exists for navigation but shows "in de maak" and is `noindex`
## Component Level Business Descriptions
### web (React front-end)
- **Purpose**: The public website visitors see
- **Responsibilities**: Page routing, layout shell, homepage hero, SEO head tags, design system (colours, fonts, buttons)
- **Responsibilities**: Page routing, layout shell, homepage hero, SEO, monitoring, design system, server configuration for test (nginx) and production (IIS)
### .gitea/workflows (CI/CD)
- **Purpose**: Quality gate and delivery
- **Responsibilities**: Lint, format, tests, build, audit, Lighthouse; deploy to test on merge to master; deploy to production manually from `release/*`
### design/andreaslop-static (reference only)
- **Purpose**: Static HTML/CSS/JS rebuild of the live site, used as the visual and structural source of truth
- **Responsibilities**: Defines page sections, header/footer markup, design tokens and interactions to port to React
- **Purpose**: Static HTML/CSS/JS rebuild of the live site, the visual and structural source of truth
- **Responsibilities**: Defines page sections, markup, design tokens and interactions to port to React
### api (planned)
- **Purpose**: .NET back-end for content and the contact form
- **Responsibilities**: None yet — the folder is empty
@@ -1,26 +1,23 @@
# Code Quality Assessment
## Test Coverage
- **Overall**: None
- **Unit Tests**: None (no test runner installed)
- **Integration Tests**: None
- Verification so far is `tsc` type-checking during `pnpm build` and manual browser checks
- **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 — with axe accessibility checks
- **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)
## Code Quality Indicators
- **Linting**: Not configured (TypeScript `noUnused*` flags only)
- **Code Style**: Mostly consistent (Prettier: 4 spaces, single quotes). Exception: `routes/over-mij.tsx` uses double quotes and 2-space indent
- **Documentation**: Good inline comments in Dutch explaining intent; README is a stub
- **Linting**: ESLint (typescript-eslint, react-hooks, jsx-a11y), enforced in CI
- **Code Style**: Consistent, Prettier-enforced in CI
- **Documentation**: Short Dutch comments explaining *why*, often referencing requirement IDs (FR-xx, BR-xx, NFR-xx, Mx) from earlier AI-DLC features
## Technical Debt
- `theme.ts` `globalCss.body.height: '250vh'` — temporary scroll-testing hack; forces every page to be 2.5 screens tall
- `components/Footer.tsx` and `routes/over-mij.tsx` use Tailwind-style `className`s (`p-2`, `text-sm`, …) that do nothing — Tailwind is not installed
- `AppShell` has no `<main>` landmark; static design has a skip link targeting `#main`
- Header logo is not a link to the homepage (design: link with aria-label)
- Social links are defined inside `Hero/heroContent.ts`; the footer in the design needs the same links → candidate for shared site-level content
- `NavigationBar.tsx` uses `let [open, setOpen]` (should be `const`)
- Unused Vite starter assets: `assets/hero.png`, `assets/typescript.svg`, `assets/vite.svg`
- Design asset `footer-mark.png` (footer logo) not yet present in `web/src/assets`
- Homepage mobile Lighthouse performance target is lowered to 0.8 (images not responsive, title after JavaScript); back to 0.9 is planned with responsive images from the API and prerendering
- Five routes are placeholders (`noindex`); `lighthouserc.cjs` keeps its own list of indexed/noindex paths, guarded by a test against `sitePages.ts`
- Static design images for the homepage sections (intro gallery, about photo, pricing decorations) are not yet in `web/src/assets`
- No responsive image pipeline (srcset/sizes); hero photos are single large JPEGs
## Patterns and Anti-patterns
- **Good Patterns**: design tokens as single source of truth; API-shaped static content; accessible interactions (aria labels, Escape to close, reduced motion, focus-visible handling); shared `navItems` for desktop and mobile
- **Anti-patterns**: no-op `className` usage (see above); global body height hack
- **Good Patterns**: API-shaped content; pure, property-tested helpers; tokens and recipes as single source of truth; configuration as code for headers; strong accessibility baseline (axe in tests, Lighthouse accessibility 1.0)
- **Anti-patterns**: None significant found
@@ -1,12 +1,15 @@
# Code Structure
## Build System
- **Type**: npm-compatible via **pnpm** (lockfile `web/pnpm-lock.yaml`)
- **Type**: pnpm (`packageManager: pnpm@12.11.2`, lockfile `web/pnpm-lock.yaml`)
- **Configuration**:
- `web/package.json` — scripts `dev` (vite), `build` (`tsc && vite build`), `preview`, `typegen` (Chakra typegen for theme)
- `web/vite.config.js` — TanStack Router plugin (`autoCodeSplitting`) before `@vitejs/plugin-react`; `resolve.tsconfigPaths`
- `web/tsconfig.json` — strict-ish bundler mode, `@/*` → `src/*` alias, `noUnusedLocals/Parameters`, `erasableSyntaxOnly`
- `web/package.json` — scripts `dev`, `build` (`tsc && vite build`), `preview`, `test` (vitest + coverage), `lint`, `format:check`, `audit:deps`, `audit:dev`, `lighthouse`, `server-config`, and `check` (all of them in sequence)
- `web/vite.config.ts` — TanStack Router plugin (`autoCodeSplitting`) before React plugin, sitemap plugin, security headers on dev/preview, Vitest config (jsdom, 20 s timeout, 100% coverage threshold for `src/lib/**`, `seo.ts`, `sitemap.ts`)
- `web/tsconfig.json` — bundler mode, `@/*` → `src/*`
- `web/eslint.config.js` — JS + typescript-eslint + react-hooks + jsx-a11y recommended
- `web/.prettierrc` — 4 spaces, single quotes, semicolons
- `web/lighthouserc.cjs` / `.desktop.cjs` — Lighthouse CI against `pnpm preview` (accessibility and best practices 1.0, performance 0.9; home mobile 0.8)
- `.gitea/workflows/continuous_integration.yaml` — jobs `check`, `deploy-test`, `lighthouse`, `deploy-production`
## Key Classes/Modules
@@ -14,80 +17,97 @@
graph TD
Root["routes/__root.tsx"] --> AppShell["components/AppShell.tsx"]
AppShell --> NavigationBar["NavigationBar/NavigationBar.tsx"]
AppShell --> Footer["components/Footer.tsx"]
AppShell --> Footer["Footer/Footer.tsx"]
AppShell --> BackToTop["BackToTop/BackToTop.tsx"]
AppShell --> Umami["Analytics/UmamiAnalytics.tsx"]
NavigationBar --> NavLink["NavigationBar/NavLink.tsx"]
NavigationBar --> MobileNav["NavigationBar/MobileNav.tsx"]
NavigationBar --> navItems["NavigationBar/navItems.ts"]
MobileNav --> navItems
NavigationBar --> useScrolledPast["hooks/useScrolledPast.tsx"]
NavigationBar --> navigation["navigation.ts"]
Footer --> navigation
Index["routes/index.tsx"] --> Hero["Hero/Hero.tsx"]
Hero --> HeroArrows["Hero/HeroArrows.tsx"]
Hero --> HeroPause["Hero/HeroPauseButton.tsx"]
Hero --> HeroSocials["Hero/HeroSocials.tsx"]
Hero --> useHeroSlider["Hero/useHeroSlider.ts"]
Hero --> LinkButton["components/LinkButton.tsx"]
HeroSocials --> socialPlatforms["Hero/socialPlatforms.ts"]
LinkButton --> RouterLink["components/RouterLink.tsx"]
Placeholder["routes/contact.tsx and other placeholders"] --> PageIntro["PageIntro/PageIntro.tsx"]
classDef shell fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef page fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef util fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
class Root,AppShell,NavigationBar,Footer,NavLink,MobileNav shell;
class Index,Hero,HeroArrows,HeroSocials page;
class navItems,useScrolledPast,useHeroSlider,LinkButton,socialPlatforms util;
class Root,AppShell,NavigationBar,Footer,BackToTop,Umami,NavLink,MobileNav shell;
class Index,Hero,HeroArrows,HeroPause,HeroSocials,Placeholder,PageIntro page;
class navigation,useHeroSlider,LinkButton,RouterLink util;
```
Text alternative: the root route renders AppShell (NavigationBar with NavLink/MobileNav/navItems, plus Footer); the index route renders Hero with its arrows, socials, slider hook and the shared LinkButton.
Text alternative: the root route renders AppShell (NavigationBar, Footer, BackToTop, Umami); NavigationBar and Footer read navigation.ts; the index route renders the Hero with its sub-components and LinkButton; placeholder routes render PageIntro.
### Existing Files Inventory
- `web/index.html` — HTML entry; static fallback title/meta for non-JS crawlers (`data-fallback`)
- `web/src/main.tsx` — bootstrap: providers, router, fonts, removes fallback head tags
- `web/src/routeTree.gen.ts` — generated by TanStack Router plugin (do not edit)
- `web/src/routes/__root.tsx` — root layout route, site-wide head
- `web/src/routes/index.tsx` — home page (`/`), renders Hero
- `web/src/routes/over-mij.tsx` — about page (`/over-mij`), placeholder content
- `web/src/components/AppShell.tsx` — shell: NavigationBar + Outlet + Footer
- `web/src/components/Footer.tsx` — placeholder footer
- `web/src/components/LinkButton.tsx` — router `Link` styled with `linkButton` recipe
- `web/src/components/NavigationBar/NavigationBar.tsx` — header, logo, desktop nav, hamburger
- `web/src/components/NavigationBar/NavLink.tsx` — desktop nav link with underline animation
- `web/src/components/NavigationBar/MobileNav.tsx` — full-screen mobile menu
- `web/src/components/NavigationBar/navItems.ts` — menu items (Home, Over mij)
- `web/src/components/Hero/*` — hero slider (component, arrows, socials, hook, content, types, platforms)
- `web/src/hooks/useScrolledPast.tsx` — boolean "scrolled past threshold" hook
- `web/src/recipes/linkButton.ts` — Chakra recipe for the square design button
- `web/src/theme.ts` — Chakra system config (tokens, semantic tokens, text styles, recipes)
- `web/src/seo.ts` — `pageHead` / `siteHead` helpers
- `web/src/assets/*` — hero photos, light/dark logos, unused Vite starter assets (`hero.png`, `typescript.svg`, `vite.svg`)
- `web/public/favicon.png`, `web/public/icons.svg` — static public assets
Candidates for modification are marked with ★ for the homepage-sections feature.
- `web/index.html` — HTML entry; static fallback head for non-JS crawlers
- `web/src/main.tsx` — bootstrap
- `web/src/routeTree.gen.ts` — generated (do not edit)
- `web/src/routes/__root.tsx` — root layout, site head, 404/error
- ★ `web/src/routes/index.tsx` — home (`/`), currently only the Hero
- `web/src/routes/{over-mij,portfolio,soorten-fotoshoots,contact,privacyverklaring}.tsx` — placeholders with `PageIntro`
- `web/src/components/AppShell.tsx` — shell
- `web/src/components/NavigationBar/*` — header, NavLink, MobileNav
- `web/src/components/Footer/*` — footer, FooterColumn, FooterLink
- `web/src/components/Hero/*` — hero slider, arrows, pause button, socials, slider hook
- `web/src/components/BackToTop/BackToTop.tsx` — back-to-top button
- `web/src/components/Analytics/UmamiAnalytics.tsx` — Umami script injection
- `web/src/components/PageIntro/PageIntro.tsx` — page head block (eyebrow, h1, intro)
- `web/src/components/StatusPage/*` — StatusPage layout, NotFound, ErrorPage
- `web/src/components/LinkButton.tsx`, `RouterLink.tsx` — router links (button style / Chakra-wrapped)
- ★ `web/src/content/types.ts` — content interfaces (API shape)
- ★ `web/src/content/siteContent.ts`, `heroContent.ts`, `socialPlatforms.ts` — static content
- `web/src/hooks/useRouteFocus.ts`, `useScrolledPast.tsx`
- `web/src/lib/*.ts` — pure helpers with tests
- `web/src/monitoring/*` — Sentry/Umami config and loader
- `web/src/navigation.ts` — `RoutePath`, `mainNav`, `footerNav`
- ★ `web/src/seo.ts`, `sitePages.ts`, `sitemap.ts` — SEO (home description may change)
- `web/src/theme.ts`, `web/src/recipes/*.ts` — design system
- `web/src/test/*` — `renderWithProviders`, axe matcher, fast-check arbitraries, setup
- `web/src/assets/*` — hero photos (8), light/dark logos
- ★ `web/config/securityHeaders.ts` — CSP (only if the contact form posts to a third party)
- `web/config/serverConfig.ts`, `writeServerConfig.ts`, `sitemapPlugin.ts`, `testSeed.ts`
- `web/deploy/iis/web.config`, `web/deploy/nginx/*.conf` — generated server configs
- `web/public/*` — favicon, logo, og-image, robots.txt, icons.svg
## Design Patterns
### Chakra `chakra()` factory around router `Link`
- **Location**: NavLink, MobileNav, LinkButton
- **Purpose**: Router-aware links with Chakra style props and `_currentPage` / `aria-current` styling
- **Implementation**: `const ChakraLink = chakra(Link)`
### API-shaped static content
- **Location**: `content/types.ts` + `content/*.ts`
- **Purpose**: Hard-coded today, swappable for API responses later
- **Implementation**: Plain data objects typed with interfaces, passed to components as props from the route (or AppShell)
### Pure helpers with property-based tests
- **Location**: `lib/`, `seo.ts`, `sitemap.ts`
- **Purpose**: Logic that decides what is shown (e.g. invalid social → hidden, invalid e-mail → column omitted) lives outside components and is tested with fast-check
- **Implementation**: Small exported functions, 100% coverage threshold, shared arbitraries in `test/arbitraries.ts`
### Design tokens + recipes
- **Location**: theme.ts, recipes/
- **Location**: `theme.ts`, `recipes/`
- **Purpose**: Single source for colours, fonts, spacing, motion; reusable component variants
- **Implementation**: `defineConfig` tokens/semanticTokens/textStyles, `defineRecipe` + `useRecipe`
### API-shaped static content
- **Location**: Hero/heroContent.ts + types.ts, navItems.ts
- **Purpose**: Hard-coded content today, swappable for CMS API responses later
- **Implementation**: Plain data objects typed with interfaces; components receive them as props
### Page registry
- **Location**: `sitePages.ts`, typed by `RoutePath`
- **Purpose**: One source for head tags and the sitemap; `indexed: false` for placeholders
### Route-level head management
- **Location**: seo.ts, each route's `head` option, `HeadContent` in root
- **Purpose**: Per-page SEO without SSR
### Configuration as code for hosting
- **Location**: `config/securityHeaders.ts` → `config/serverConfig.ts` → `deploy/`
- **Purpose**: Same headers in dev, preview, nginx (test) and IIS (production); a test guards drift
### Accessibility by default
- **Location**: across components; `test/axe.ts` in component tests; Lighthouse in CI
- **Implementation**: landmarks, skip link, focus management, live regions, visible focus ring, 44px targets, reduced motion
## Critical Dependencies
### @chakra-ui/react
- **Version**: ^3.37.0
- **Usage**: All layout and styling
- **Purpose**: Component library and styling system
### @tanstack/react-router (+ router-plugin)
- **Version**: ^1.170.39 / ^1.168.40
- **Usage**: File-based routes, `Link`, `Outlet`, `HeadContent`, `useRouterState`
- **Purpose**: Routing and head management
### @iconify/react + @iconify-icons/ant-design
- **Version**: ^6.0.2 / 2.0.1
- **Usage**: Offline icons in Hero
- **Purpose**: Icons bundled at build time (no API calls)
### @chakra-ui/react ^3.37.0
- **Usage**: All layout and styling; typegen from `theme.ts` on install
### @tanstack/react-router ^1.170.39 (+ router-plugin ^1.168.40)
- **Usage**: File-based routes, `Link`, `Outlet`, `HeadContent`, typed `RoutePath`
### @sentry/react ^11.8.0
- **Usage**: Error reporting, lazy-loaded after the load event
### @iconify/react ^6.0.2 + @iconify-icons/ant-design 2.0.1
- **Usage**: Offline icons (bundled at build time)
@@ -4,21 +4,23 @@
- `web` — React 19 SPA (Vite, Chakra UI v3, TanStack Router): the public website
## Infrastructure Packages
- None (no IaC, Docker, or CI/CD configuration present)
- `.gitea/workflows/continuous_integration.yaml` — Gitea Actions CI/CD (check, lighthouse, deploy-test, deploy-production)
- `web/config/` + `web/deploy/` — security headers and generated nginx (test) / IIS (production) configuration
## Shared Packages
- None as separate packages. Inside `web`, shared modules are `theme.ts`, `recipes/`, `seo.ts`, `hooks/`, `components/LinkButton.tsx`
- None as separate packages. Inside `web`: `theme.ts`, `recipes/`, `content/`, `lib/`, `seo.ts`, `navigation.ts`, `hooks/`, `components/LinkButton.tsx`, `components/RouterLink.tsx`, `components/PageIntro/`
## Test Packages
- None
- None as separate packages. Tests are co-located (`*.test.ts(x)`) and run with Vitest (unit, component, property-based with fast-check, accessibility with axe-core); Lighthouse CI for quality budgets
## Reference (non-code)
- `design/andreaslop-static` — static HTML/CSS/JS design reference (not built or deployed)
- `design/AndreaSlopFotografie_React.zip` — archive of design files
- `api/` — empty placeholder for the planned .NET API
## Total Count
- **Total Packages**: 1
- **Total Packages**: 1 (plus CI workflow and server config)
- **Application**: 1
- **Infrastructure**: 0
- **Infrastructure**: 1 (CI/CD + server config, inside the repo)
- **Shared**: 0
- **Test**: 0
- **Test**: 0 (co-located)
@@ -4,51 +4,51 @@
```mermaid
graph LR
routes["routes/*"] --> components["components/*"]
routes --> seo["seo.ts"]
main["main.tsx"] --> theme["theme.ts + recipes"]
main --> routes["routes/*"]
main --> monitoring["monitoring/*"]
routes --> components["components/*"]
routes --> content["content/*"]
routes --> seo["seo.ts + sitePages.ts"]
components --> lib["lib/*"]
components --> hooks["hooks/*"]
components --> theme["theme.ts tokens (via Chakra props)"]
components --> navigation["navigation.ts"]
components --> assets["assets/*"]
main["main.tsx"] --> theme
main --> routes
config["config/* (Node, build time)"] --> monitoring
config --> seo
classDef app fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef support fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
classDef build fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
class main,routes,components app;
class seo,hooks,theme,assets support;
class theme,monitoring,content,seo,lib,hooks,navigation,assets support;
class config build;
```
Text alternative: main depends on theme and routes; routes depend on components and seo; components depend on hooks, theme tokens and assets.
Text alternative: main depends on theme, routes and monitoring; routes depend on components, content and SEO; components depend on lib, hooks, navigation and assets; build-time config reads monitoring (CSP origins) and SEO (sitemap).
### routes depend on components
### routes depend on content and components
- **Type**: Compile
- **Reason**: Routes render AppShell (root) and page components
- **Reason**: Routes pass static content objects into components as props
### config depends on monitoring/config.ts
- **Type**: Build time (Node)
- **Reason**: CSP `script-src`/`connect-src` include the Umami and Sentry origins; that file therefore has no Vite imports
### components depend on theme tokens
- **Type**: Runtime (string token references such as `bg="paper"`, `h="header"`)
- **Reason**: All visual values come from the Chakra system
- **Type**: Runtime (string token references such as `bg="paper.alt"`, `textStyle="eyebrow"`)
## External Dependencies
### @chakra-ui/react
- **Version**: ^3.37.0
- **Purpose**: Styling system and UI primitives
- **License**: MIT
### @tanstack/react-router
- **Version**: ^1.170.39
- **Purpose**: Routing
- **License**: MIT
### react / react-dom
- **Version**: ^19.3.0
- **Purpose**: UI runtime
- **License**: MIT
### next-themes
- **Version**: ^0.4.6
- **Purpose**: Colour mode
- **License**: MIT
### @iconify/react, @iconify-icons/ant-design
- **Version**: ^6.0.2, 2.0.1
- **Purpose**: Icons
- **License**: MIT (icons: Ant Design, MIT)
### @fontsource/jost, @fontsource/marcellus
- **Version**: ^5.3.0
- **Purpose**: Self-hosted web fonts
- **License**: OFL-1.1
### @chakra-ui/react ^3.37.0, @emotion/react ^11.14.0
- **Purpose**: Styling system and UI primitives — **License**: MIT
### @tanstack/react-router ^1.170.39
- **Purpose**: Routing — **License**: MIT
### react / react-dom ^19.3.0
- **Purpose**: UI runtime — **License**: MIT
### @sentry/react ^11.8.0
- **Purpose**: Error reporting — **License**: MIT
### @fontsource/jost, @fontsource/marcellus ^5.3.0
- **Purpose**: Self-hosted fonts — **License**: OFL-1.1
### @iconify/react ^6.0.2, @iconify-icons/ant-design 2.0.1 (dev)
- **Purpose**: Icons, bundled at build time — **License**: MIT
### Dev tooling
- Vite, Vitest, Testing Library, fast-check, axe-core, ESLint, Prettier, Lighthouse CI, Chakra CLI — all MIT/Apache-2.0/MPL-2.0 (axe-core)
@@ -1,10 +1,11 @@
# Reverse Engineering Metadata
**Analysis Date**: 2026-10-14T09:58:04Z
**Analysis Date**: 2026-10-19T19:19:38Z (refresh; previous analysis 2026-10-14T09:58:04Z at 8f5841c)
**Analyzer**: AI-DLC
**Workspace**: C:\Users\bdslo\Documents\Development\AndreaSlopFotografie
**Codebase Commit**: 8f5841c (branch feature/hero-slider-and-navigation)
**Total Files Analyzed**: 30 (web/src, web config files, design/andreaslop-static shell markup and README)
**Workspace**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie
**Codebase Commit**: 38c5c3e (branch master)
**Total Files Analyzed**: ~95 (web/src, web/config, web/deploy, web config files, CI workflow, design/andreaslop-static pages and README)
**Refreshed for**: feature homepage-sections
## Artifacts Generated
- [x] business-overview.md
@@ -1,28 +1,37 @@
# Technology Stack
## Programming Languages
- TypeScript — ~6.0.2 — all application code (TSX)
- TypeScript — ~6.0.2 — all application, config and test code (TSX)
- HTML/CSS/JS — design reference only (`design/andreaslop-static`)
- C# / .NET — planned back-end (not present)
## Frameworks
- React — ^19.3.0 — UI
- Chakra UI — ^3.37.0 (+ @emotion/react ^11.14.0) — styling system and components
- TanStack Router — ^1.170.39 — file-based routing, head management (devtools ^1.167.2)
- next-themes — ^0.4.6 — colour mode provider (fixed to light)
- TanStack Router — ^1.170.39 — file-based routing, head management (devtools ^1.167.2, dev only)
- @fontsource/jost, @fontsource/marcellus — ^5.3.0 — self-hosted fonts
- @iconify/react ^6.0.2 + @iconify-icons/ant-design 2.0.1 — offline icons
- @sentry/react — ^11.8.0 — error reporting
## Infrastructure
- None yet; static build output suitable for any static host
- Gitea Actions — CI/CD (runners: Raspberry Pi arm64 and a pc)
- nginx on Raspberry Pi — test environment (test.andreaslop.nl)
- IIS at a webhost via FTPS — production (andreaslop.nl)
- Sentry (SaaS, EU), Umami (self-hosted, analytics.slpsoftware.nl), UptimeRobot — monitoring
## Build Tools
- Vite — ^8.3.0 — dev server and bundler
- @vitejs/plugin-react — ^6.1.1
- @vitejs/plugin-react — ^6.1.2
- @tanstack/router-plugin — ^1.168.40 — route tree generation, code splitting
- @chakra-ui/cli — ^3.37.0 — theme typegen
- pnpm — package manager
- Prettier — ^3.9.9 — formatting
- pnpm — 12.11.2 — package manager
- Node — 24 (CI)
## Testing Tools
- None configured (no test runner, no linter such as ESLint)
## Quality and Testing Tools
- Vitest ^5.0.5 + @vitest/coverage-v8 — unit and component tests, coverage thresholds
- @testing-library/react ^16.3.3, user-event, jest-dom, jsdom ^30.1.3
- fast-check ^4.10.2 — property-based tests
- axe-core ^4.14.0 — accessibility checks in component tests
- ESLint ^9.39.5 + typescript-eslint, react-hooks, jsx-a11y
- Prettier ^3.9.9
- @lhci/cli ^0.15.1 — Lighthouse CI (mobile and desktop)
+1
View File
@@ -4,3 +4,4 @@
|------|------|--------|--------|---------------------|---------------|
| Bug | [hero-carousel-announce-and-pause](bugs/hero-carousel-announce-and-pause/bug-fix.md) | ✅ Complete | fix/hero-carousel-announce-and-pause | web/src/components/Hero (Hero, HeroArrows, useHeroSlider) | 2026-10-19 |
| Feature | frontend-shell | ✅ Complete | feature/frontend-shell | web/src (AppShell, NavigationBar, Footer, Hero socials, new BackToTop/SkipLink/404/error pages, routes, theme.ts, main.tsx), web/vite.config.js, web/package.json | 2026-10-14 |
| Feature | homepage-sections | ✅ Complete | feature/homepage-sections | web/src/routes/index.tsx, new homepage section components, web/src/content (types + static content), possibly web/config/securityHeaders.ts (contact form) | 2026-10-19 |
@@ -0,0 +1,82 @@
# AI-DLC State Tracking
## Project Information
- **Feature Name**: Homepage sections below the hero (Lifestyle photography, About me, Prices, Lieve woorden, Contact, Instagram)
- **Feature Slug**: homepage-sections
- **Project Type**: Brownfield
- **Start Date**: 2026-10-19T19:19:38Z
- **Current Stage**: Complete
- **Branch**: feature/homepage-sections
## Workspace State
- **Existing Code**: Yes
- **Programming Languages**: TypeScript (React/TSX)
- **Build System**: pnpm + Vite (`tsc && vite build`), Gitea Actions CI
- **Project Structure**: Single front-end SPA in `web/`; static HTML design reference in `design/andreaslop-static/`; `api/` folder present but empty (.NET back-end planned)
- **Reverse Engineering Needed**: Yes (refresh — artifacts stale since commit 8f5841c)
- **Workspace Root**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie
## Code Location Rules
- **Application Code**: Workspace root (NEVER in aidlc-docs/) — front-end lives in `web/`
- **Feature Documentation**: aidlc-docs/features/homepage-sections/ only
- **Shared Artifacts**: aidlc-docs/_shared/
- **Structure patterns**: See code-generation.md Critical Rules
## Language Configuration
- **Documentation Language**: English
- **Conversation Language**: User Language (Dutch)
- **Source**: inherited from aidlc-docs/language-preference.md (answer A); user may override
## Extension Configuration
| Extension | Enabled | Decided At |
|---|---|---|
| Security Baseline | Yes | Requirements Analysis |
| Property-Based Testing | Yes (full enforcement) | Requirements Analysis |
## Operations Configuration
- **Include Operations Phase**: No
- **Decided At**: Build and Test
## Scope Notes (from user)
- One feature, one unit per homepage block: Lifestyle photography, About me, Prices, Lieve woorden (testimonials, new — from the live site), Contact, Instagram
- Contact form: built with anti-spam and a robot check, but covered by an overlay ("coming soon, e-mail info@andreaslop.nl for now") until the API exists
- Lieve woorden: user asked for a design proposal, possibly added to design/andreaslop-static
- Hero already exists and is out of scope
## Execution Plan Summary
- **Stages to Execute**: Application Design (incl. static design update, FR-HP-01), Units Generation, Functional Design (Prijzen, Lieve woorden, Contact), Code Generation (6 units), Build and Test
- **Stages to Skip**: User Stories (single persona), Functional Design for Lifestyle fotografie / Over mij / Instagram (presentational), NFR Requirements (NFRs set at requirements level), NFR Design (no new patterns), Infrastructure Design (no infrastructure changes)
- **Operations**: No (decided at Build and Test)
- **Delivery**: one branch feature/homepage-sections, commits per unit, one PR at the end; full `pnpm check` (incl. Lighthouse) after each unit
- **Unit order**: 1 Lifestyle fotografie (+ shared blocks) → 2 Over mij → 3 Prijzen → 4 Lieve woorden → 5 Contact → 6 Instagram
## Stage Progress
### 🔵 INCEPTION PHASE
- [x] Workspace Detection
- [x] Reverse Engineering (refresh, approved)
- [x] Requirements Analysis (approved)
- [x] User Stories - SKIP (single visitor persona, concrete FRs)
- [x] Workflow Planning (approved)
- [x] Application Design - EXECUTE (approved)
- [x] Units Generation - EXECUTE (approved)
### 🟢 CONSTRUCTION PHASE
- [x] Functional Design - EXECUTE (Prijzen ✅, Lieve woorden ✅, Contact ✅) / SKIP (Lifestyle fotografie, Over mij, Instagram)
- [x] NFR Requirements - SKIP
- [x] NFR Design - SKIP
- [x] Infrastructure Design - SKIP
- [x] Code Generation - EXECUTE (per unit) — Unit 1 Lifestyle fotografie ✅, Unit 2 Over mij ✅ (desktop review deferred by user), Unit 3 Prijzen ✅, Unit 4 Lieve woorden ✅, Unit 5 Contact ✅, Unit 6 Instagram ✅
- [x] Build and Test - EXECUTE
### 🟡 OPERATIONS PHASE
- [x] Deployment Setup, Monitoring Setup, Production Readiness Validation - SKIP (declined at Build and Test)
## Current Status
- **Lifecycle Phase**: Complete
- **Current Stage**: Complete (Operations declined at Build and Test)
- **Next Stage**: none — merge PR #6
## Reverse Engineering Status
- [x] Reverse Engineering - Artifacts refreshed on 2026-10-19T19:19:38Z at commit 38c5c3e (approved 2026-10-19T19:31:00Z)
- **Artifacts Location**: aidlc-docs/_shared/reverse-engineering/
@@ -0,0 +1,919 @@
# AI-DLC Audit Log — homepage-sections
## Initial User Request
**Timestamp**: 2026-10-19T19:19:38Z
**User Input**: "Ik wil met aidlc de homepage toe gaan voegen. De Hero staat er al, maar de 4 blokken eronder nog niet. Die wil ik in 1 feature opppakken met elk blok als een losse unit. Voor de duidleijkheid. De 4 blokken zijn:
1. Lifestyle fotografie
2. Over mij
3. Prijzen
4. Contact
Nou is het nog een statische site zonder back-end dus het contactformulier kan nog niet functioneel gemaakt worden dus ik hoor graag een suggestie hoe ik dit tijdelijk kan oplossen totdat we een API hebben."
**AI Response**: "Started AI-DLC workflow (existing multi-feature workspace, no welcome message). Began Workspace Detection."
**Context**: INCEPTION - Workspace Detection (start)
---
## Workspace Detection
**Timestamp**: 2026-10-19T19:19:38Z
**User Input**: (none — automatic stage)
**AI Response**: "Feature resolution: all existing items (frontend-shell, hero-carousel-announce-and-pause) are ✅ Complete and the request is clearly new work, so a new feature was started without a feature-selection prompt. Classification: Feature (new user-facing sections, no defect). Slug: homepage-sections. Brownfield (React SPA in web/). Language configuration inherited from aidlc-docs/language-preference.md (answer A: English docs, Dutch conversation) and stated to the user for correction instead of re-asking. Reverse engineering artifacts in _shared/ are stale: generated at commit 8f5841c (2026-10-14), before the front-end shell, CI/CD, monitoring and the hero fix landed (HEAD 38c5c3e). Next: refresh Reverse Engineering."
**Context**: INCEPTION - Workspace Detection (complete). Parallel features: none active. Conflicts: none.
---
## Reverse Engineering (refresh)
**Timestamp**: 2026-10-19T19:19:38Z
**User Input**: (none — automatic stage)
**AI Response**: "Refreshed all eight artifacts in aidlc-docs/_shared/reverse-engineering/ against commit 38c5c3e: CI/CD (Gitea Actions, test on Pi nginx, production FTPS to IIS), monitoring (Sentry, Umami), complete shell (footer, skip link, back-to-top, 404/error), content/ modules, pure lib/ helpers with property-based tests, page registry and sitemap, security headers as code. Key finding for this feature: CSP has form-action 'self' and connect-src limited to self/Umami/Sentry, so a third-party contact form endpoint requires a CSP change in web/config/securityHeaders.ts plus regenerated server configs. LAYOUT.md Home lists six blocks (Hero, Highlights, About me, Prices, Contact, Instagram); the user named four — Instagram is to be confirmed in requirements questions. Design images for the four blocks exist in design/andreaslop-static/assets/img. Presented completion message and awaited approval."
**Context**: INCEPTION - Reverse Engineering (complete, awaiting approval)
---
## Reverse Engineering — User Response
**Timestamp**: 2026-10-19T19:31:00Z
**User Input**: "Oh je hebt gelijk. Die Instagram-module moet er ook komen, die ben ik gewoon vergeten. Sterker nog. In het design staat het niet, want het is later op de live werbsite gekomen. Op de huidige website op https://andreaslop.nl/ is het blok \"Lieve woorden\" erbij gekomen. Zou je daar ook een voorstel voor design kunnen doen? Eventueel verwerken in het design in deze workspace?. Voor het formulier moet er inderdaad ook nog anti-spam inkomen en een robot check. Misschien kunnen we voor het formulier wel bouwen, maar dan een overlay er overheen met een tekst dat die binnenkort komt en dta je voor nu een email moet sturen naar info@andreaslop.nl?"
**AI Response**: "Treated as implicit approval of the Reverse Engineering refresh (no changes requested to the analysis). Scope extended: Instagram block added; new 'Lieve woorden' (testimonials) block from the live site added, needing a design proposal and possibly an update to design/andreaslop-static. Contact form: build it with anti-spam and a robot check, covered by an overlay saying the form is coming soon and to e-mail info@andreaslop.nl for now. Proceeding to Requirements Analysis; inspecting the live site's 'Lieve woorden' block first."
**Context**: INCEPTION - Reverse Engineering approved; scope change recorded
---
## Requirements Analysis — Clarifying Questions
**Timestamp**: 2026-10-19T20:07:00Z
**User Input**: (none — AI-initiated)
**AI Response**: "Inspected live andreaslop.nl: 'Lieve Woorden' is an owl-slider testimonial widget (photo, shoot-type title, text, author) with two reviews; live prices differ from the static design (Zwangerschap 175, Newborn 185, Gezin 175, richer inclusions); live form has a shoot-type select (Zwangerschap/Newborn/Familie/Overig) instead of a free-text subject plus a honeypot; live Instagram widget is broken. Created inception/requirements/requirement-verification-questions.md with 16 content questions plus the Security, PBT and Operations opt-in questions (Dutch, matching the previous feature's question files). Depth: Standard."
**Context**: INCEPTION - Requirements Analysis (awaiting answers)
---
## Requirements Analysis — Answers Received
**Timestamp**: 2026-10-19T20:40:00Z
**User Input**: "ik heb de vragen beantwoord"
**AI Response**: "Read answers: Q1–Q13 A, Q11 A with note 'Als we het er dan toch inbouwen dan kan ik het later ook makkelijk uitzetten mocht dat nodig zijn.', Q14 B (Friendly Captcha), Q15 A, Q16 A, Security Baseline A, PBT A, Operations C. No contradictions or ambiguities found. Loaded security-baseline.md and property-based-testing.md (opted in). Generated inception/requirements/requirements.md (12 functional, 6 non-functional requirements, extension compliance tables). Recorded extension and operations configuration in aidlc-state.md. User Stories proposed to be skipped (single visitor persona, concrete requirements). Presented completion message and awaited approval."
**Context**: INCEPTION - Requirements Analysis (complete, awaiting approval)
---
## Requirements Analysis — Change Request
**Timestamp**: 2026-10-19T20:48:00Z
**User Input**: "NFR-HP-02: Code comments wil ik liever in het Engels."
**AI Response**: "Updated NFR-HP-02: code comments in English for all new code, including new comments in existing files; existing Dutch comments are not translated in this feature; visitor-facing texts stay Dutch. Re-presented the completion message."
**Context**: INCEPTION - Requirements Analysis (change applied, awaiting approval)
---
## Requirements Analysis — Approval
**Timestamp**: 2026-10-19T20:52:00Z
**User Input**: "Ga verder naar de volgende stage"
**AI Response**: "Requirements approved; User Stories skipped (user did not choose 'Add User Stories'). The question whether English code comments should become a standing preference for future features was not answered; treated as applying to this feature only. Proceeding to Workflow Planning."
**Context**: INCEPTION - Requirements Analysis approved; User Stories SKIP
---
## Workflow Planning
**Timestamp**: 2026-10-19T20:55:00Z
**User Input**: (none — AI-initiated)
**AI Response**: "Created inception/plans/execution-plan.md. Execute: Application Design (incl. FR-HP-01 static design + LAYOUT.md update as a review gate before React work), Units Generation (six units), Functional Design for Prijzen, Lieve woorden and Contact, Code Generation per unit, Build and Test. Skip: User Stories, Functional Design for presentational units, NFR Requirements, NFR Design, Infrastructure Design. Operations undecided. Risk: Low. Prompt: 'Ready to proceed with this plan?'"
**Context**: INCEPTION - Workflow Planning (awaiting approval)
---
## Workflow Planning — Approval
**Timestamp**: 2026-10-19T21:00:00Z
**User Input**: "akkoord, ga verder"
**AI Response**: "Execution plan approved. Proceeding to Application Design."
**Context**: INCEPTION - Workflow Planning approved
---
## Application Design — Plan and Questions
**Timestamp**: 2026-10-19T21:05:00Z
**User Input**: (none — AI-initiated)
**AI Response**: "Created inception/plans/application-design-plan.md with the plan (incl. FR-HP-01 static design steps) and 6 design questions: folder structure, content modules, testimonial carousel (Chakra Carousel available in the installed @chakra-ui/react), Prijzen → Contact handover, location of contactFormEnabled, testimonial photo style. Recorded already-decided items (SectionHeading, HomeSection, Reveal/useReveal, Chakra Field/Input/Textarea/NativeSelect, no form library, submitContactForm adapter)."
**Context**: INCEPTION - Application Design (awaiting answers)
---
## Application Design — Answers and Artifacts
**Timestamp**: 2026-10-19T21:40:00Z
**User Input**: "ik heb de vragen beantwoord"
**AI Response**: "Answers: Q1 B, Q2 A, Q3 A, Q4 A, Q5 A, Q6 A — no ambiguities. Executed FR-HP-01: design/andreaslop-static index.html (live packages with ?pakket preselect links, new Lieve woorden section, live contact fields with honeypot and coming-soon gate, contact section moved to plain background), style.css (13b testimonials, select, honeypot, form gate, responsive), main.js (contact form handles shoot/onderwerp, honeypot + time check, preselect, initFormGate, initTestimonials), manifest intro-3 updated to the live photo; LAYOUT.md Home now seven blocks with new colour G (also added to .ai/layout-conventions.md). Verified with headless Chrome screenshots (desktop 1440, mobile 520). contact.html left unchanged (out of scope). Generated components.md, component-methods.md, services.md, component-dependency.md, application-design.md. Security/PBT compliance included; no blocking findings."
**Context**: INCEPTION - Application Design (complete, awaiting approval)
---
## Application Design — Approval
**Timestamp**: 2026-10-19T21:50:00Z
**User Input**: "ga verder naar de volgende stage"
**AI Response**: "Application design (incl. static design update) approved. Proceeding to Units Generation."
**Context**: INCEPTION - Application Design approved
---
## Units Generation — Plan and Questions
**Timestamp**: 2026-10-19T21:52:00Z
**User Input**: (none — AI-initiated)
**AI Response**: "Created inception/plans/unit-of-work-plan.md: six units per block in the approved order, shared pieces assigned to the first unit that needs them; two questions on delivery (one PR vs PR per unit) and per-unit verification depth (full pnpm check incl. Lighthouse vs without)."
**Context**: INCEPTION - Units Generation, Part 1 Planning (awaiting answers)
---
## Units Generation — Answers
**Timestamp**: 2026-10-19T21:58:00Z
**User Input**: "ik heb de vragen beantwoord"
**AI Response**: "Answers: Q1 A (one PR for the whole feature, commits per unit on feature/homepage-sections, optional manual 'Deploy to Test' on the branch), Q2 A (full pnpm check incl. Lighthouse per unit). No ambiguities. Prompt: 'Unit of work plan complete. Review the plan in aidlc-docs/features/homepage-sections/inception/plans/unit-of-work-plan.md. Ready to proceed to generation?'"
**Context**: INCEPTION - Units Generation, Part 1 Planning (awaiting plan approval)
---
## Units Generation — Plan Approval and Generation
**Timestamp**: 2026-10-19T22:02:00Z
**User Input**: "ja genereer de unit-documenten"
**AI Response**: "Plan approved. Generated inception/application-design/unit-of-work.md (six units with scope, shared pieces, images, Functional Design execute/skip, done criteria), unit-of-work-dependency.md (matrix, order diagram), unit-of-work-story-map.md (requirement-to-unit map; all FR-HP/NFR-HP assigned). Presented completion message."
**Context**: INCEPTION - Units Generation (complete, awaiting approval)
---
## Units Generation — Approval
**Timestamp**: 2026-10-19T22:08:00Z
**User Input**: "Ga verder naar de volgende stage"
**AI Response**: "Units approved. Inception complete. Proceeding to CONSTRUCTION — Unit 1 Lifestyle fotografie (Functional Design skipped per plan) → Code Generation Part 1 Planning."
**Context**: INCEPTION complete; CONSTRUCTION start
---
## Unit 1 Lifestyle fotografie — Code Generation Plan
**Timestamp**: 2026-10-19T22:15:00Z
**User Input**: (none — AI-initiated)
**AI Response**: "Created construction/plans/lifestyle-fotografie-code-generation-plan.md (20 steps): branch + baseline commit, image resize to 800x1200 via one-off System.Drawing script (ImageMagick not available; no project dependency), theme tokens, content types and homeContent, useReveal/Reveal, SectionHeading, HomeSection, IntroGallery, route, tests, pnpm check, code summary, commit (not pushed). Functional Design skipped; PBT-01 recorded as N/A (no logic). Test names in English proposed. Prompt: approve plan or request changes."
**Context**: CONSTRUCTION - Unit 1 Code Generation Part 1 (awaiting plan approval)
---
## Unit 1 Lifestyle fotografie — Plan Approval
**Timestamp**: 2026-10-19T22:20:00Z
**User Input**: "approve plan"
**AI Response**: "Plan approved (incl. local commits on feature/homepage-sections, not pushed). Starting Code Generation Part 2."
**Context**: CONSTRUCTION - Unit 1 Code Generation Part 2 (start)
---
## Unit 1 Lifestyle fotografie — Code Generation Complete
**Timestamp**: 2026-10-20T00:10:00Z
**User Input**: (none — generation)
**AI Response**: "Executed all 20 plan steps. Step 13.5 self-check: Prettier failed on CRLF from an edit script (reformatted); tsc rejected constructor parameter properties in a test (rewritten); a leftover vite preview from an earlier session occupied port 4173 (stopped); Lighthouse home mobile failed 0.78 < 0.8 — root cause: Chrome eagerly fetches lazy images within ~1250px of the viewport, so gallery photos competed with the hero (LCP 3.8s → 5.3s). Fixed with useInView, usePageLoaded and DeferredImage (recorded as Step 18a). Final pnpm check green: 138 tests, build ok, audits ok (dev audit report-only), Lighthouse home mobile 0.85 / desktop 1.0, a11y/BP/SEO 1.0. Code summary written. Committed locally on feature/homepage-sections (not pushed)."
**Context**: CONSTRUCTION - Unit 1 Code Generation (complete, awaiting approval)
---
## Unit 1 Lifestyle fotografie — Change Request
**Timestamp**: 2026-10-20T00:30:00Z
**User Input**: "o pmobiel staan nu 4 afbeeldingen onder elkaar. dat is een beetje veel. kan je zorgen dat op mobiele schermen 1 afbeelding tegelijk wordt getoond die je kan swipen naar de volgende foto en dat je zo alle 4 de foto's alsnog kan bekijken?"
**AI Response**: "Implemented a CSS scroll-snap row below sm (85% wide photos, next one peeking in, keyboard-focusable list), gallery-level deferred loading (DeferredImage near prop) because clipped items never intersect, single fade-in for the gallery. Updated the static design and FR-HP-02. Verified at an emulated 390px phone via CDP. pnpm check green (139 tests; Lighthouse home mobile 0.84, desktop 1.0, a11y 1.0). Committed locally. Re-presented the completion message."
**Context**: CONSTRUCTION - Unit 1 Code Generation (change applied, awaiting approval)
---
## Unit 1 Lifestyle fotografie — Approval
**Timestamp**: 2026-10-20T00:35:00Z
**User Input**: "ziet er goed uit, ga verder"
**AI Response**: "Unit 1 approved. active-features.md updated to 🟢 Construction. Proceeding to Unit 2 Over mij (Functional Design skipped per plan) → Code Generation Part 1 Planning."
**Context**: CONSTRUCTION - Unit 1 complete; Unit 2 start
---
## Unit 2 Over mij — Code Generation Plan
**Timestamp**: 2026-10-20T00:45:00Z
**User Input**: (none — AI-initiated)
**AI Response**: "Created construction/plans/over-mij-code-generation-plan.md (14 steps): original 1600px photo resized to 1200x800, HomeContent.about with RoutePath-typed link, link recipe 'underline' variant, SectionHeading compact spacing, FramedImage, AboutBlock, route + app test, pnpm check with visual check, summary, commit. PBT-01 N/A. Prompt: approve plan or request changes."
**Context**: CONSTRUCTION - Unit 2 Code Generation Part 1 (awaiting plan approval)
---
## Unit 2 Over mij — Plan Approval
**Timestamp**: 2026-10-20T00:50:00Z
**User Input**: "approve plan"
**AI Response**: "Plan approved. Starting Code Generation Part 2."
**Context**: CONSTRUCTION - Unit 2 Code Generation Part 2 (start)
---
## Unit 2 Over mij — Code Generation Complete
**Timestamp**: 2026-10-20T01:20:00Z
**User Input**: (none — generation)
**AI Response**: "Executed all 14 steps. Step 13.5: Lighthouse home mobile failed (0.77). Root cause found by comparing observed LCP with deferred image request start across all runs: a race, photos starting before the observed LCP inflate Lighthouse's simulated LCP (5.3s vs 3.8s); the 600px load margin reached the gallery right after the load event. Lowered to a shared 200px DEFERRED_LOAD_MARGIN; latest runs request no below-hero photos on open. Final pnpm check green: 142 tests, mobile 0.84, desktop 1.0, a11y/BP/SEO 1.0. Visual check desktop + 390px phone. Committed locally (not pushed)."
**Context**: CONSTRUCTION - Unit 2 Code Generation (complete, awaiting approval)
---
## Unit 2 Over mij — Approval
**Timestamp**: 2026-10-20T01:25:00Z
**User Input**: "Op mobiel ziet het er goed uit. Op desktop kan ik nu niet goed zien. Dus als ik daar issues mee heb zal ik het later via bugfixes oppakken.. ga verder"
**AI Response**: "Unit 2 approved (desktop review deferred by the user; issues will come in as bug fixes). Proceeding to Unit 3 Prijzen — Functional Design."
**Context**: CONSTRUCTION - Unit 2 complete; Unit 3 start
---
## Unit 3 Prijzen — Functional Design Plan and Questions
**Timestamp**: 2026-10-20T01:30:00Z
**User Input**: (none — AI-initiated)
**AI Response**: "Created construction/plans/prijzen-functional-design-plan.md (7 steps) and prijzen-fd-questions.md with 5 questions: VAT note, accessible names for the three 'Boek je shoot' links, second click behaviour, keeping ?pakket in the URL, package without a price."
**Context**: CONSTRUCTION - Unit 3 Functional Design (awaiting answers)
---
## Unit 3 Prijzen — Functional Design Answers
**Timestamp**: 2026-10-20T01:40:00Z
**User Input**: "1C
2b, mits dat past anders 2a. De knop moet 1 regel blijven. In ieder geval op desktop
3a
4b
5a"
**AI Response**: "Recorded answers in prijzen-fd-questions.md. Interpretation: Q1 C — Andrea uses the KOR, no VAT note. Q2 — deterministic rule: visible 'Boek {name}' when the name is short enough to stay on one line down to a 320px phone (≤ 14 characters), otherwise 'Boek je shoot' with the package name as visually hidden text; button never wraps. Q3 A — last click wins. Q4 B — ?pakket is removed from the URL (history replace, keeping #contact) as soon as the form has taken over the value; a reload no longer keeps the choice. Q5 A — price required. Generating functional design artifacts."
**Context**: CONSTRUCTION - Unit 3 Functional Design (answers received)
---
## Unit 3 Prijzen — Functional Design Complete
**Timestamp**: 2026-10-20T01:55:00Z
**User Input**: (none — generation)
**AI Response**: "Generated construction/prijzen/functional-design/: domain-entities.md (PricingPackage invariants, initial live data, KOR note), business-rules.md (BR-PRICE-01..03, BR-BOOK-01..03 with the 14-character label rule, BR-PARAM-01..04, two decision flowcharts, misuse notes), business-logic-model.md (booking sequence, four pure functions incl. new visiblePackages and bookLabel, 11 PBT properties, generators), frontend-components.md (Pricing, PriceCard, route validateSearch, accessibility). Prompt: Request Changes or Continue to Code Generation."
**Context**: CONSTRUCTION - Unit 3 Functional Design (awaiting approval)
---
## Unit 3 Prijzen — Functional Design Approval
**Timestamp**: 2026-10-20T02:00:00Z
**User Input**: "Ga verder"
**AI Response**: "Functional design approved. Proceeding to Code Generation Part 1 (planning) for unit 3."
**Context**: CONSTRUCTION - Unit 3 Functional Design approved
---
## Unit 3 Prijzen — Code Generation Plan
**Timestamp**: 2026-10-20T02:05:00Z
**User Input**: (none — AI-initiated)
**AI Response**: "Created construction/plans/prijzen-code-generation-plan.md (17 steps): decorations copied, content types and data, four pure helpers with PBT, arbitraries, linkButton 'fit' size (nowrap, smaller phone padding), PriceCard, Pricing, route validateSearch, app tests, pnpm check with visual check at 1440/390/320, summary, commit. Prompt: approve plan or request changes."
**Context**: CONSTRUCTION - Unit 3 Code Generation Part 1 (awaiting plan approval)
---
## Unit 3 Prijzen — Plan Approval
**Timestamp**: 2026-10-20T02:08:00Z
**User Input**: "Approve plan"
**AI Response**: "Plan approved. Starting Code Generation Part 2."
**Context**: CONSTRUCTION - Unit 3 Code Generation Part 2 (start)
---
## Unit 3 Prijzen — Code Generation Complete
**Timestamp**: 2026-10-20T03:05:00Z
**User Input**: (none — generation)
**AI Response**: "Executed all 17 steps. Step 13.5: tsc rejected search on chakra(Link) (route generics lost) — switched the card link to TanStack's typed Link with the linkButton recipe via asChild; two test assertions corrected (NBSP normalisation, alt='' role); ESLint no-irregular-whitespace from escapes written as literal characters — rewritten as escapes, src scanned. Visual check found the second decoration covered by the last card — moved into the section's bottom padding. Final pnpm check green: 170 tests, 100% coverage on new lib files, Lighthouse home mobile 0.83–0.89, desktop 1.0, a11y/BP/SEO 1.0. Committed locally (not pushed)."
**Context**: CONSTRUCTION - Unit 3 Code Generation (complete, awaiting approval)
---
## Unit 3 Prijzen — Approval, Push and Test Deploy
**Timestamp**: 2026-10-20T03:10:00Z
**User Input**: "Ziet er goed uit. Kan je de changes tot nu toe committed en pushen. Kan je dan een deploy naar test doen?"
**AI Response**: "Unit 3 approved. All work was already committed (5 commits on feature/homepage-sections). Pushed the branch to origin (new branch). Dispatched the CI workflow on feature/homepage-sections with deploy_test=true, deploy_production=false (run 552); following it until completion."
**Context**: CONSTRUCTION - Unit 3 complete; branch pushed; test deploy requested
---
## Unit 4 Lieve woorden — Functional Design Plan and Questions
**Timestamp**: 2026-10-20T03:15:00Z
**User Input**: "Ga ondertussen verder naar de volgende stage"
**AI Response**: "Started unit 4 Functional Design while CI run 552 (test deploy) is running. Created construction/plans/lieve-woorden-functional-design-plan.md (6 steps) and lieve-woorden-fd-questions.md with 3 questions: behaviour at the end of the list, slide vs crossfade transition, equal vs adaptive height."
**Context**: CONSTRUCTION - Unit 4 Functional Design (awaiting answers)
---
## Unit 4 Lieve woorden — Functional Design Answers
**Timestamp**: 2026-10-20T03:25:00Z
**User Input**: "1a
2a
3a"
**AI Response**: "Recorded answers (loop around at the ends; sliding transition via Chakra Carousel; all slides the height of the tallest). No ambiguities. Generating functional design artifacts."
**Context**: CONSTRUCTION - Unit 4 Functional Design (answers received)
---
## Unit 4 Lieve woorden — Functional Design Complete
**Timestamp**: 2026-10-20T03:40:00Z
**User Input**: (none — generation)
**AI Response**: "Generated construction/lieve-woorden/functional-design/: domain-entities.md (Testimonial invariants, live data with alt texts), business-rules.md (BR-REV-01..11, two decision flowcharts), business-logic-model.md (navigation sequence; carousel state is Chakra's; visibleTestimonials and slideLabel with 6 PBT properties; PBT-06 N/A), frontend-components.md (Testimonials with Chakra Carousel parts, TestimonialSlide, equal height, reduced motion, single live announcement). Prompt: Request Changes or Continue to Code Generation."
**Context**: CONSTRUCTION - Unit 4 Functional Design (awaiting approval)
---
## Unit 4 Lieve woorden — Functional Design Approval
**Timestamp**: 2026-10-20T03:45:00Z
**User Input**: "Ga verder naar de volgende stage"
**AI Response**: "Functional design approved. Proceeding to Code Generation Part 1 (planning) for unit 4."
**Context**: CONSTRUCTION - Unit 4 Functional Design approved
---
## Test Deploy Result (units 1–3)
**Timestamp**: 2026-10-20T03:50:00Z
**User Input**: (none — CI run finished)
**AI Response**: "CI run 552 (workflow_dispatch on feature/homepage-sections, deploy_test=true) completed: check success, deploy-test success, lighthouse success, deploy-production skipped. Verified test.andreaslop.nl serves the new route chunk containing the Lifestyle fotografie, Over mij and Prijzen content."
**Context**: Test environment updated with units 1–3
---
## Unit 4 Lieve woorden — Code Generation Plan
**Timestamp**: 2026-10-20T03:55:00Z
**User Input**: (none — AI-initiated)
**AI Response**: "Created construction/plans/lieve-woorden-code-generation-plan.md (14 steps). Findings from @zag-js/carousel 1.43.3 that shape it: built-in triggers/indicators/keys always scroll smoothly from JS (CSS cannot honour reduced motion) but the API accepts an instant flag → own prev/next/dots/arrow keys calling the API with instant = reduced motion; item group has aria-live polite → set off, one own live region; default translations English → item label via slideLabel. Prompt: approve plan or request changes."
**Context**: CONSTRUCTION - Unit 4 Code Generation Part 1 (awaiting plan approval)
---
## Unit 4 Lieve woorden — Plan Approval
**Timestamp**: 2026-10-20T04:00:00Z
**User Input**: "Approve plan"
**AI Response**: "Plan approved. Starting Code Generation Part 2."
**Context**: CONSTRUCTION - Unit 4 Code Generation Part 2 (start)
---
## Unit 4 Lieve woorden — Code Generation Complete
**Timestamp**: 2026-10-20T05:00:00Z
**User Input**: (none — generation)
**AI Response**: "Executed all 14 steps. Step 13.5 findings: jsdom cannot page Zag (no layout) — unit tests cover our wiring, paging/looping/dots verified in real Chrome via CDP; jsdom lacks IntersectionObserver/ResizeObserver/Element.scrollTo — ResizeObserver no-op added to test setup, the others stubbed per test; real-browser check showed slides clipping/overlapping the sand block — spacing and per-slide padding added; Lighthouse home mobile median 0.83 → 0.81 because the carousel joined the route chunk (measured with 5-run medians against a unit-3 worktree build) — React.lazy alone did not help, the carousel now loads only when the section is within 200px of the screen; median back to 0.83. Reduced motion verified: instant scroll in the first frame vs ±330ms smooth. Final pnpm check green: 190 tests, mobile 0.83, desktop 1.0, a11y/BP/SEO 1.0. Note: a git checkout of routes/index.tsx during the lazy experiment also reverted the uncommitted Testimonials wiring; it was restored immediately. Temporary worktree and preview servers cleaned up. Committing locally (incl. earlier pending audit/state updates), not pushed."
**Context**: CONSTRUCTION - Unit 4 Code Generation (complete, awaiting approval)
---
## Change Request — Price Card Hover (unit 3), Commit, Push, Test Deploy
**Timestamp**: 2026-10-20T20:55:00Z
**User Input**: "okee top. ik wil verder met de openstaande feature voor de homepage sections. Ik heb de het Prijzen/Pakketten onderdeel getest. Die hover op de verschillende pakketten mag wel. De donkere border die je dna krijgt en helemaal die animatie op en neer. Alleen de knoppen mogen hun effecten behouden. Commit daarna de changes, push ze en start dan een deploy naar test. Laat me weten als je de changes hebt voltoid dan kan ik die vast testen via LAN"
**AI Response**: "Interpreted as: remove the hover effect from the price cards (accent border, lift animation, shadow); the booking buttons keep theirs. Removed in PriceCard.tsx, the now unused 'lift' shadow token, the static design (.price-card:hover) and the functional design; unit 3 code summary updated. pnpm check: a Testimonials test timed out waiting for the lazy carousel chunk under the full suite (cold import > 1s default findBy timeout) — given a 10s timeout for that wait; one Lighthouse mobile run scored 0.75 (TBT 410ms) right after the reboot — a 5-run median on the same build was 0.83 (0.83–0.85), Lighthouse rerun green (mobile 0.83, desktop 1.0). Committing, pushing feature/homepage-sections and dispatching CI with deploy_test=true. Unit 4 (Lieve woorden) is included in this push; its approval is still pending."
**Context**: CONSTRUCTION - change request on unit 3; push and test deploy (units 1–4)
---
## Feedback — Review Photo Size and Hero After Back-to-Top
**Timestamp**: 2026-10-20T21:20:00Z
**User Input**: "Ik heb even gekeken. De lieve woorden Carousel is grotendeels goed, maar op mobiel is het plaatje enorm en vult het scherm. Op desktop moet ik later even controleren, tenzij je hier een screenshot kan tonen van de desktop versie. Functioneel geloof ik het wel. Ik wil vooral de layout checken.
Dan zie ik ook het volgende gebeuren:
Ik navigeer naar de pagina en ik zie een beeldvullende hero. Ik scroll naar beneden en de back to top knop komt tevoorschijn en van de browser verdwijnen de ui balken boven en onder.. Ik klik op de knop en ga terug naar boven. Dat werkt zoals verwacht, maar vervolgens is de Hero niet schermvullend meer omdat die browserbalken weg zijn. Als ik gewoon naar boven scroll handmatig komen die balken terug en is de Hero wel schermvullend. Is daar wat aan te doen zonder vieze workarounds of iets? Anders accepteer ik het wel en dan is het geen probleem."
**AI Response**: "Review photo: limited to 240px wide on phones and 320px on tablets (was up to 420px), left-aligned; placeholder heights re-measured (390: 772px, 768: 813px). Sent desktop (1440) and phone (390) screenshots. Hero: explained the cause — the hero is 100svh (small viewport, toolbars shown); mobile browsers only bring their toolbars back on a user scroll, not on a scroll from JavaScript, and there is no API to show them; the clean alternative is 100dvh (always fills, but the hero and everything below change height whenever the toolbars slide in or out); recommended accepting. Changes not yet committed (awaiting the user's call)."
**Context**: CONSTRUCTION - Unit 4 review feedback
---
## Feedback — Viewport Units and Review Photo Size
**Timestamp**: 2026-10-20T21:40:00Z
**User Input**: "Ah ja dat is inderdaad een vieze oplossing. Heel irritant als alles constant verspringt. Dus dat scrollen lekker laten. Wel vraag ik me af wat de verschillen zijn tussen de verschillende view height waarden. Vh, dvh en volgens mij svh?
De foto mag nog iets kleiner? 75% van huidige groote maken is denk ik goed. Het moet ook niet te klein worden. Kan je de afbeelding wel in het midden uitlijnen op mobiel?"
**AI Response**: "Hero stays at 100svh (accepted). Explained vh, svh, lvh and dvh. Interpreted '75%' as the answer to the desktop question: desktop grid 5fr 7fr → 5fr 11fr (photo ±75%, ±395×495 at 1440; block fits a ±1000px screen); phones keep 240px (not too small), now centred, tablets 320px centred. Placeholder heights re-measured; static design and functional design updated; screenshots sent; tests green. Not committed yet."
**Context**: CONSTRUCTION - Unit 4 review feedback (applied)
---
## Correction — Review Photo Size
**Timestamp**: 2026-10-20T21:50:00Z
**User Input**: "Ik zei dat je de grootte van de mobiele versie op ongeveer 75% moest zetten van de huidige grootte. Desktop wilde ik eerst zien met een screenshot voordat we daar wat aan gaan doen"
**AI Response**: "Misread the previous request. Reverted the desktop change (back to 5fr 7fr) and set the phone photo to 180px (75% of 240px), centred; tablets stay 320px. Static design, functional design and code summary aligned; placeholder heights re-measured (phones ±700px). Sent desktop (unchanged) and phone screenshots for review. CI run 553 (test deploy of 02a7b84) completed successfully. Not committed yet."
**Context**: CONSTRUCTION - Unit 4 review feedback (corrected)
---
## Feedback — Desktop Review Photo
**Timestamp**: 2026-10-20T21:55:00Z
**User Input**: "Hoe je desktop net had aangepast was mooier. De afbeelding nu is misschien toch wat te groot."
**AI Response**: "Re-applied the smaller desktop layout (grid 5fr 11fr, photo ±395×495 at 1440); phones stay 180px centred, tablets 320px. Docs, static design and placeholder heights (lg 460, xl 625) updated; tests green. Not committed yet."
**Context**: CONSTRUCTION - Unit 4 review feedback (applied)
---
## Feedback — Review Alignment on Phones
**Timestamp**: 2026-10-20T22:05:00Z
**User Input**: "Nee nog niet. Op mobiel is de uitlijning niet goed voor lieve woorden. Ze moeten verticaal omhoog uitgelijnd worden. De kleinere items met minder tekst worden nu gecentreerd ofzo. Dat ziet er gek uit. Ook mag de witruimte tussen de afbeelding en de tekst iets minder op mobiel"
**AI Response**: "Cause: all slides share the tallest one's height, and the stacked grid centred its content (alignItems center), so the short review floated in the middle. Below lg the slide grid now aligns content and rows to the top; desktop keeps vertical centring. Gap between photo and text below lg reduced to 1.25rem. Verified with screenshots of both reviews at 390px; placeholder heights re-measured; docs updated; tests green. Not committed (user: 'nog niet')."
**Context**: CONSTRUCTION - Unit 4 review feedback (applied)
---
## Unit 4 Lieve woorden — Approval, Push and Test Deploy
**Timestamp**: 2026-10-20T22:15:00Z
**User Input**: "Commit, push en deploy naar test. Ga dan verder naar de volgende stage"
**AI Response**: "pnpm check green (190 tests; Lighthouse mobile 0.83, desktop 1.0). Committing the review-photo layout changes, pushing feature/homepage-sections and dispatching CI with deploy_test=true. Unit 4 approved; proceeding to Unit 5 Contact — Functional Design."
**Context**: CONSTRUCTION - Unit 4 complete; Unit 5 start
---
## Unit 5 Contact — Functional Design Plan and Questions
**Timestamp**: 2026-10-20T22:20:00Z
**User Input**: (none — AI-initiated, following "Ga dan verder naar de volgende stage")
**AI Response**: "Committed 0b8e8d5, pushed, dispatched CI run 554 (deploy to test). Created construction/plans/contact-functional-design-plan.md (6 steps, listing what is already fixed) and contact-fd-questions.md with 6 questions: when errors appear, error messages, success behaviour (+ reply time text), mail button subject, focus after a 'Boek' click, failure message."
**Context**: CONSTRUCTION - Unit 5 Functional Design (awaiting answers)
---
## Unit 5 Contact — Functional Design Answers (partial)
**Timestamp**: 2026-10-20T22:30:00Z
**User Input**: "1B
2X, emailadres: \"Dit e-mailadres is ongeldig.\" Te lang: \"Het bericht is te lang\"
3A, maar het bericht is: \"Bedankt voor je bericht! Ik reageer binnen 1-2 werkdagen.
4A
5A"
**AI Response**: "Recorded answers 1–5 in contact-fd-questions.md. Question 6 unanswered; the 'too long' message is ambiguous for the name and e-mail fields. Created contact-fd-clarification-questions.md with 2 follow-up questions."
**Context**: CONSTRUCTION - Unit 5 Functional Design (awaiting clarifications)
---
## Unit 5 Contact — Clarification Answers
**Timestamp**: 2026-10-20T22:40:00Z
**User Input**: "1A, 2A"
**AI Response**: "Recorded: failure message with mailto link, input kept (Q6 = A); per-field 'too long' messages (A). Added design detail for Q1 = B: an untouched empty field gets no error on blur, and a shown error clears as soon as the field becomes valid while typing. Generating functional design artifacts."
**Context**: CONSTRUCTION - Unit 5 Functional Design (answers complete)
---
## Unit 5 Contact — Clarification Answers
**Timestamp**: 2026-10-20T22:40:00Z
**User Input**: "1A, 2A"
**AI Response**: "Recorded: failure message with mailto link, input kept (Q6 = A); per-field 'too long' messages (A). Added design detail for Q1 = B: an untouched empty field gets no error on blur, and a shown error clears as soon as the field becomes valid while typing. Generating functional design artifacts."
**Context**: CONSTRUCTION - Unit 5 Functional Design (answers complete)
---
## Unit 5 Contact — Functional Design Complete
**Timestamp**: 2026-10-20T23:00:00Z
**User Input**: (none — generation)
**AI Response**: "Generated construction/contact/functional-design/: domain-entities.md (values, errors, payload, shoot options, limits, setting, anti-spam inputs), business-rules.md (BR-FORM-01..13 incl. the user's messages and blur timing, BR-SEND-01..04 with the 1-2 werkdagen thank-you, BR-SPAM-01..03, BR-GATE-01..03, BR-MAIL-01 subject, BR-PARAM-02/04 and BR-FOCUS-01; two decision flowcharts; misuse notes), business-logic-model.md (submit sequence, pure reducer state machine, 8 pure functions, 10 PBT properties incl. stateful PBT-06), frontend-components.md (ContactSection, ContactFormGate, ContactForm, content, accessibility). Prompt: Request Changes or Continue to Code Generation."
**Context**: CONSTRUCTION - Unit 5 Functional Design (awaiting approval)
---
## Test Deploy Result (units 1–4 incl. review fixes)
**Timestamp**: 2026-10-20T23:05:00Z
**User Input**: (none — CI run finished)
**AI Response**: "CI run 554 (workflow_dispatch on feature/homepage-sections at 0b8e8d5, deploy_test=true) completed: check success, deploy-test success, lighthouse success, deploy-production skipped."
**Context**: Test environment updated with units 1–4 and the review fixes
---
## Unit 5 Contact — Functional Design Approval
**Timestamp**: 2026-10-20T23:10:00Z
**User Input**: "Ga verder naar de volgende stage"
**AI Response**: "Functional design approved. Proceeding to Code Generation Part 1 (planning) for unit 5."
**Context**: CONSTRUCTION - Unit 5 Functional Design approved
---
## Unit 5 Contact — Code Generation Plan
**Timestamp**: 2026-10-20T23:15:00Z
**User Input**: (none — AI-initiated)
**AI Response**: "Created construction/plans/contact-code-generation-plan.md (19 steps): types/content, six pure helpers incl. the form reducer with stateful PBT, adapter, formControl recipe and panel shadow, ContactForm, ContactFormGate, ContactSection (preselect, URL clean-up, focus), route + app tests, pnpm check with a performance comparison (defer the form like the carousel if it costs performance), visual checks, summary, commit. Prompt: approve plan or request changes."
**Context**: CONSTRUCTION - Unit 5 Code Generation Part 1 (awaiting plan approval)
---
## Unit 5 Contact — Plan Approval
**Timestamp**: 2026-10-20T23:20:00Z
**User Input**: "Approve plan. Je mag na het genereren de code alvast committed, pushen en een deploy naar test doen"
**AI Response**: "Plan approved. Authorised for this unit: after generation, commit, push and dispatch a test deploy. Starting Code Generation Part 2."
**Context**: CONSTRUCTION - Unit 5 Code Generation Part 2 (start)
---
## Unit 5 Contact — Code Generation Complete, Push and Test Deploy
**Timestamp**: 2026-10-21T00:30:00Z
**User Input**: "Kan je mij een screenshot van de desktop versie sturen zodra je klaar bent?" (received mid-generation)
**AI Response**: "Executed all 19 steps. Findings: labels were not linked (control id overridden; Ark uses Field.Root id) — fixed; React-compiler lint on field refs — focus by id instead; lazy form unmounted after ?pakket= cleanup — latched once loaded; two reducer branches only randomly covered — deterministic tests added. Performance: 5-run medians against a rebuilt unit-4 build (sparse worktree; a full worktree hit the Windows path limit): 0.83 → 0.80 with the form in the route chunk, 0.81 with the form lazy, 0.83 after replacing Chakra List/Blockquote (slot recipes) in PriceCard and TestimonialSlide with plain elements so the route no longer fetches a new shared chunk. Placeholder heights measured. Final pnpm check green: 237 tests, 100% lib coverage, Lighthouse mobile 0.83, desktop 1.0, a11y/BP/SEO 1.0. Sent desktop screenshots (overlay; form switched on locally and reverted) and a phone screenshot. Committing, pushing and dispatching a test deploy as authorised for this unit."
**Context**: CONSTRUCTION - Unit 5 Code Generation (complete, awaiting approval)
---
## Unit 5 Contact — Bugs Reported on LAN, Fixed
**Timestamp**: 2026-10-21T01:30:00Z
**User Input**: "Er gebeurt niks als ik klik op de Boeken-knoppen. Geen effect en hij scrolt niet" / "Ik heb op lan getest" / "Zodra je klaar bent mag je weer comitten, pushen en deployen" / "Als ik op boek zwangerschap klik scrolt hij minder ver dan op de andere 2 knoppen" / "Wederom. Je mag comitten, pushen en deployen zodra je klaar bent"
**AI Response**: "Reproduced in real Chrome (CDP trace): the click pushed /?pakket=newborn#contact, our clean-up replaced it with hashScrollIntoView:false before the router's onRendered scroll, so no scroll happened (test still had unit 4, where #contact did not exist yet). Fixed: the clean-up navigation requests the hash scroll (smooth / auto under reduced motion); anchored sections get scroll-margin-top = header. Added an app test clicking 'Boek Newborn' asserting scrollIntoView on #contact (verified failing on the old code). Second bug: from the top card the review carousel loaded mid-scroll and its fixed placeholder height differed from the real height except at measured widths (+29px at 360, -44px at 600). Placeholder is now the longest review rendered like a slide plus the control height; no movement at 7 widths. CI run 555: deploy-test succeeded, Lighthouse job died on the Pi runner with exit -1 after pnpm install (infra). pnpm check green (238 tests, mobile 0.83, desktop 1.0). Committing, pushing, dispatching a test deploy as authorised."
**Context**: CONSTRUCTION - Unit 5 bug fixes (awaiting approval of unit 5)
---
## Test Deploy Result (unit 5 incl. scroll fixes)
**Timestamp**: 2026-10-21T02:00:00Z
**User Input**: (none — CI run finished)
**AI Response**: "CI run 556 (0b00b78, deploy_test=true) completed: check, deploy-test and lighthouse success, deploy-production skipped. The Lighthouse failure of run 555 did not recur (runner issue). test.andreaslop.nl serves the Contact section."
**Context**: Test environment updated with unit 5 and the scroll fixes
---
## Unit 5 Contact — Change Request: Section Heading Size
**Timestamp**: 2026-10-21T20:10:48Z
**User Input**: "ik wil verder met d eopenstaande feature in aidlc. Ik had in ieder geval al een opmerking over de <h2>-tags. Die zijn wat groot. Kunnen die een grootte krijgen wat vertaald naar 30 pixels? Ze zijn nu in iede rgeval wat te groot en nu zijn ze computed 40px"
**AI Response**: "Resumed homepage-sections (unit 5 awaiting approval). The section h2s use textStyle sectionTitle (1.85rem / 2.125rem / 2.5rem = 40px at xl, from the design's --fs-h2). Changed it to a flat 1.875rem (30px) at every width; mobile was already 29.6px so a single size is simplest. Applies to all SectionHeading h2s on the homepage; footer h2s (eyebrow) and h1/h3 unchanged. Design static CSS left as is."
**Context**: CONSTRUCTION - Unit 5 change request (typography)
---
## Unit 5 Contact — Change Request: Price Card Heading Size
**Timestamp**: 2026-10-21T20:21:27Z
**User Input**: "de maten voor de prijskaarten mogen ietsje kleiner. Ze zijn nu bijna even groot als de h2's"
**AI Response**: "Price card h3 (package name) reduced from 1.75rem (28px) to 1.5rem (24px). The price itself stays 2.25rem (36px), larger than the 30px h2 — asked the owner whether that should shrink too."
**Context**: CONSTRUCTION - Unit 5 change request (typography)
---
## Unit 5 Contact — Change Request: Testimonial Quote Size
**Timestamp**: 2026-10-21T20:23:58Z
**User Input**: "De tekst van de lieve woorden. De blockquote is een beetje groot. zou je die ook wat kleiner kunnen maken?"
**AI Response**: "Testimonial blockquote reduced from clamp(1.35rem, 2.2vw, 1.75rem) (21.6–28px) to clamp(1.15rem, 1.7vw, 1.375rem) (18.4–22px). The carousel placeholder renders the longest slide itself, so its height follows automatically."
**Context**: CONSTRUCTION - Unit 5 change request (typography)
---
## Unit 5 Contact — Approval
**Timestamp**: 2026-10-21T20:36:20Z
**User Input**: "top het werkt. okee. dan kan je nu verder met de volgende unit"
**AI Response**: "Unit 5 approved (incl. the review typography changes: section h2 30px, price card h3 24px, testimonial quote 18.4–22px; price amount size question left open). Moving to Unit 6 Instagram."
**Context**: CONSTRUCTION - Unit 5 Code Generation approved
---
## Unit 6 Instagram — Code Generation Plan
**Timestamp**: 2026-10-21T20:36:20Z
**User Input**: (none — AI-initiated)
**AI Response**: "Created construction/plans/instagram-code-generation-plan.md (11 steps): content type and data reusing six already-bundled photos, HomeSection width='full' for the design's full-bleed grid, InstagramGrid (handle link, list of six square tiles 2/3/6 columns, accessible names alt + hint, hover/focus with reduced motion), route renders it only with a valid https Instagram link via visibleSocials, tests, pnpm check, LAYOUT.md check, summary, commit (typography changes in a separate commit first). Prompt: approve plan or request changes."
**Context**: CONSTRUCTION - Unit 6 Code Generation Part 1 (awaiting plan approval)
---
## Unit 6 Instagram — Plan Approval
**Timestamp**: 2026-10-21T20:40:08Z
**User Input**: "approve plan"
**AI Response**: "Plan approved. Starting Code Generation Part 2 (commit at the end, not pushed)."
**Context**: CONSTRUCTION - Unit 6 Code Generation Part 2 (start)
---
## Unit 6 Instagram — Code Generation (Lighthouse gate pending)
**Timestamp**: 2026-10-21T21:01:47Z
**User Input**: (none — AI-initiated)
**AI Response**: "Steps 1–7, 9, 10 done. pnpm check: lint, format, 244 tests, build, audits green; Lighthouse home mobile 0.73 (budget 0.8), /contact 0.84 in the first run. Benchmark index was halved (1889 vs ~4200). A/B with the unit 5 build (git stash of web/, 3 runs each): both 0.68–0.84, TBT 190–600 ms, no difference; machine under load (game and a Vite dev server). Visual check in headless Chrome: 6/3/2 columns, full-bleed, h2 30px, no extra image requests. Not committed; asked the owner whether to rerun the gate on a quiet machine first."
**Context**: CONSTRUCTION - Unit 6 Code Generation, Step 8 Lighthouse pending
---
## Unit 6 Instagram — Lighthouse Rerun
**Timestamp**: 2026-10-21T22:26:33Z
**User Input**: "ik heb rocket league afgesloten. Ik zie in de browser bij performance ook ineens maar een score van 44 en 51 op desktop. De rest is in beide gevallen 100. Op mobiel is dat 35 en 33 terwijl de andere onderdelen 100 zijn."
**AI Response**: "The browser scores come from the Vite dev server (port 5173): measured it at desktop 0.55 / mobile 0.36 with 137 unbundled requests, so not representative. Rebuilt and reran pnpm lighthouse on the production build: passed — home mobile 0.81 (TBT 230 ms), desktop 1.0, other pages 0.93–0.94 / 1.0, a11y/BP/SEO 1.0. Step 8 ticked; committing as in the approved plan (Step 11), not pushed."
**Context**: CONSTRUCTION - Unit 6 Code Generation, Step 8 complete
---
## Unit 6 Instagram — Approval
**Timestamp**: 2026-10-21T23:24:36Z
**User Input**: "je mag committen pushen en deployen. dan mag je ook een PR gaan aanmaken als die er nog niet is en dan mag je door naar Build & Test"
**AI Response**: "Unit 6 approved. Authorised: commit, push, test deploy, create the PR to master if none exists, then start Build and Test."
**Context**: CONSTRUCTION - Unit 6 Code Generation approved
---
## Build and Test — Push, PR, Browser Checks
**Timestamp**: 2026-10-21T23:29:37Z
**User Input**: (none — continuing the authorised steps)
**AI Response**: "Pushed 1905295, dispatched a test deploy (run 557), created PR #6 (Gitea rejects 4-byte emoji in PR bodies, so the attribution line has none). Scripted browser checks on the production build (headless Chrome, 1440 and 390): section order ✅, layout shift while scrolling 0.0008 / 0 ✅, every Boek button selects its package and tidies the URL ✅, keyboard focus on Instagram tiles visible and on top ✅. Contact lands 24px below the header on desktop: its scroll-margin is the full header height (92px) while the header has shrunk to 68px by then. On phones 9px: the page is 394px wide instead of 390 because the Lifestyle fotografie row (unit 1) bleeds out by the gutter token (20px) while Chakra's Container pads 16/24/32px instead of the design's --gutter (clamp(20px, 4vw, 48px)); Chrome zooms the layout viewport and the visual viewport sits 9px lower. Asked the owner how to fix (site-wide Container padding = gutter as in the design, or a local fix in the gallery) and whether to align the Contact offset with the shrunken header."
**Context**: CONSTRUCTION - Build and Test (in progress, awaiting decision)
---
## Build and Test — Owner Decisions on the Findings
**Timestamp**: 2026-10-21T23:33:28Z
**User Input**: "Zijmarge: Overal zoals design (Recommended)" / "Contact: Direct onder header"
**AI Response**: "Container padding becomes the design's gutter token site-wide; anchored sections use the shrunken (sticky) header height as scroll margin."
**Context**: CONSTRUCTION - Build and Test, fixes
---
## Build and Test Stage
**Timestamp**: 2026-10-21T23:46:08Z
**Build Status**: Success
**Test Status**: Pass (244 unit/app tests; browser integration scenarios after two fixes; Lighthouse home mobile 0.83, desktop 1.0, other pages 0.94–0.95 / 1.0)
**Files Generated**:
- build-instructions.md
- unit-test-instructions.md
- integration-test-instructions.md
- performance-test-instructions.md
- build-and-test-summary.md
**Fixes**: Container padding = gutter site-wide (page was 394px wide on phones), header extra padding removed, to-top aligned to gutter, anchored sections scroll to the sticky header height. A local pnpm check failed once on port 4173, occupied by the CI Lighthouse job on the PC runner (host network); rerun after the job: green.
**Operations Phase Decision**: Undecided (asked in the completion message)
---
## Build and Test — Operations Decision and Workflow Complete
**Timestamp**: 2026-10-22T00:04:22Z
**User Input**: "Complete without operations"
**AI Response**: "Operations Phase set to No (decided at Build and Test). Feature marked ✅ Complete in active-features.md and aidlc-state.md. Deployment stays with the existing CI pipeline (merge of PR #6 to master deploys to test; production via a release/* branch). Presented the Workflow Complete summary."
**Context**: Workflow complete
---
@@ -0,0 +1,52 @@
# Build and Test Summary — homepage-sections
## Build
- **Tool**: pnpm + Vite (`tsc && vite build`)
- **Status**: ✅ Success (built in ~2.5 s locally; CI `check` job green on the Pi and on the PC runner)
- **Artifacts**: `web/dist/`
## Unit tests
- **Total**: 244 in 53 files. **Passed**: 244. **Failed**: 0.
- **Coverage**: `src/lib/` 100%, overall ~92% of statements
- **Status**: ✅ Pass
## Integration (whole homepage)
- **Automated, in the suite**: section order with one h1 and axe clean; "Boek Newborn" scrolls to Contact and selects the package; `?pakket=` selects, tidies and focuses; Instagram absent without a valid https link. ✅
- **Browser, production build, 1440 px and 390 px phone** (scenarios in `integration-test-instructions.md`):
| Scenario | Result |
|---|---|
| Section order | ✅ |
| Layout shift while scrolling the whole page | ✅ 0.0008 / 0 |
| All three "Boek" buttons | ✅ after fixes 1 and 2 below |
| Keyboard focus on the Instagram tiles | ✅ |
| Horizontal overflow, 7 pages × 5 widths | ✅ after fix 1 below |
| No new image requests from Instagram | ✅ |
### Found and fixed in this stage
1. **Phones: the page was 4 px too wide.**
- Cause: Chakra's `Container` padded 16 / 24 / 32 px, while the design's `.container` uses `--gutter` (clamp(20 px, 4vw, 48 px)). The Lifestyle fotografie row bleeds out by the gutter, so it stuck out 4 px on both sides.
- Effect: Chrome widened the layout viewport to 394 px, and the page could be nudged sideways.
- Fix (the owner chose to follow the design everywhere): `Container` pads with `gutter`. The header loses its extra padding from the first hero commit, and the to-top button aligns with the gutter. The logo, hero controls and content now share one edge.
2. **Desktop: Contact landed 24 px below the header.**
- Cause: the scroll margin was the full header height (92 px), but the header has shrunk to 68 px by the time the page reaches Contact.
- Fix: anchored sections use the sticky header height (`spacing.header.sticky`).
## Performance (Lighthouse CI, production build)
| Page | Mobile | Desktop |
|---|---|---|
| Homepage | 0.83 (budget 0.8) | 1.0 |
| Other pages | 0.94–0.95 (budget 0.9) | 1.0 |
Accessibility and best practices are 1.0 on every page, and SEO passes everywhere. CI `lighthouse` job: ✅ (reporting only).
Two things disturb local measurements: a busy machine, and the CI Lighthouse job on the PC runner. That job uses `--network host`, so it occupies port 4173 and makes a local `pnpm check` fail with "port in use". See `performance-test-instructions.md`.
## Additional
- **Security**: `pnpm audit --prod` clean. The new section adds no new dependencies or external resources. External links use `noopener noreferrer`, and only https links are rendered.
- **Contract / E2E suite**: N/A (static front end without an API). The browser checks above cover the user flows.
## Overall
- **Build**: ✅ **Tests**: ✅ **Performance budgets**: ✅
- **Test environment**: test.andreaslop.nl was updated with unit 6 (run 557). The layout fixes are deployed in a follow-up run.
- **Ready for Operations**: yes, depending on the owner's decision about the Operations phase
@@ -0,0 +1,24 @@
# Build Instructions — homepage-sections
## Prerequisites
- **Node.js** 24 and **pnpm** (version pinned in `web/package.json`)
- **OS**: Windows, Linux or macOS. CI builds on the Raspberry Pi runner (arm64).
- **Environment variables**: none for the build. `LIGHTHOUSE_PERFORMANCE=warn` only in CI (see performance instructions)
## Build steps
```bash
cd web
pnpm install # also runs `chakra typegen` (postinstall)
pnpm build # tsc && vite build
```
After changing theme tokens (`src/theme.ts`), run `pnpm typegen` so token names such as `header.sticky` type-check.
## Verify
- **Expected output**: `✓ built in …s` and no TypeScript errors
- **Artifacts**: `web/dist/` (`index.html`, `assets/*.js|css|jpg|png`)
- **Accepted warning**: Vite's chunk-size warning for the main bundle (`index-*.js`, ~575 kB unminified size before gzip). This is known and tracked under responsive images and prerendering (NFR-P-01).
## Troubleshooting
- **Unknown token type errors after a theme change** → `pnpm typegen`.
- **Lighthouse or preview fails with "port in use"** → a preview server is still running on 4173. Stop it first.
@@ -0,0 +1,19 @@
# Integration Test Instructions — homepage-sections
The six units are sections of one page, so "integration" means how they behave together on the real homepage.
## Automated (in `pnpm test`, `src/app.test.tsx`)
- **Section order**: Hero → Lifestyle fotografie → Over mij → Prijzen → Lieve woorden → Contact → Instagram, exactly one h1, axe clean on the whole page
- **Prijzen → Contact**: a click on "Boek Newborn" scrolls to `#contact` and selects Newborn. A `?pakket=` link selects the package, tidies the URL and focuses Contact.
- **siteContent → Instagram**: the section is absent when the Instagram link is missing or not https
## In a real browser (production build)
Run against `pnpm build && pnpm preview`, with headless Chrome (puppeteer-core and chrome-launcher are already installed as Lighthouse dependencies) or by hand, at 1440 px and at an emulated 390 px phone:
| # | Scenario | Expected |
|---|---|---|
| 1 | Scroll the whole homepage in steps | Cumulative layout shift < 0.1 (measured 0.0008 / 0) |
| 2 | Each "Boek …" button, starting from the top | Contact's top edge lines up with the bottom of the (shrunken) header, the select shows the package, the URL ends in `/#contact` |
| 3 | Tab from the Instagram handle to the first tile | 2px focus ring visible on top of the neighbouring tiles; the photo zooms in |
| 4 | Every page at 320, 390, 768, 1024 and 1440 px | `scrollWidth === innerWidth`: no horizontal overflow |
| 5 | Network panel while scrolling the homepage | The Instagram section requests no new images |
@@ -0,0 +1,22 @@
# Performance Test Instructions — homepage-sections
A static site: there is no load or throughput testing. Performance means page-load performance, measured with Lighthouse CI.
```bash
cd web
pnpm build
pnpm lighthouse # mobile (lighthouserc.cjs) then desktop (lighthouserc.desktop.cjs)
```
## Budgets
- **Performance**:
- homepage on mobile ≥ 0.8. This is a temporary budget until responsive images and prerendering arrive (NFR-P-01).
- every other page on mobile ≥ 0.9.
- every page on desktop ≥ 0.9.
- **Accessibility and best practices**: 1.0 on every page
- **SEO**: the basic audits on every page; `is-crawlable` only on indexed pages
## Measuring reliably
- Measure the **production build**. The Vite dev server (`pnpm dev`) serves 137 unbundled modules and scores ~0.55 on desktop and ~0.36 on mobile, which says nothing about the site.
- Lighthouse throttles the CPU relative to the machine's own speed. A busy machine (a game, a dev server rebuilding) scatters the homepage mobile score between 0.68 and 0.84. Compare `environment.benchmarkIndex` in the report: when it is far below ~3500–4200, rerun on a quiet machine.
- In CI the Raspberry Pi scores 30–40 points lower, so performance is reported there and does not block (`LIGHTHOUSE_PERFORMANCE=warn`).
@@ -0,0 +1,12 @@
# Unit Test Execution — homepage-sections
```bash
cd web
pnpm test # vitest run --coverage
```
- **Expected**: 53 files, 244 tests, 0 failures (count at the end of unit 6)
- **Coverage**: `src/lib/` (all business logic) at 100%. The suite overall is ~92% of statements.
- **Includes**: axe checks per section and per page, property-based tests (fast-check) for the contact form logic, and app-level tests through the real route tree (`src/app.test.tsx`)
- **Report**: terminal output plus `web/coverage/`
- jsdom has no layout or scrolling, so anything about positions, sizes and scroll behaviour is checked in the browser instead (see integration instructions).
@@ -0,0 +1,66 @@
# Code Summary — Unit 5: Contact
Plan: [contact-code-generation-plan.md](../../plans/contact-code-generation-plan.md). Functional design: [../functional-design/](../functional-design/). Branch: `feature/homepage-sections`.
## Files
### Created
| File | Purpose |
|---|---|
| `web/src/contact/types.ts` | Values, errors, payload, shoot option, limits, empty values |
| `web/src/contact/submitContactForm.ts` + test | The single submission adapter; fails until the API exists (comment shows the future `POST /api/contact`) |
| `web/src/lib/shootOptions.ts` + test | Shown packages + Overig |
| `web/src/lib/validateContact.ts` + test | `validateField` / `validateContact` with the agreed messages |
| `web/src/lib/toContactPayload.ts` + test | Trimmed payload |
| `web/src/lib/isLikelySpam.ts` + test | Honeypot or under 3000 ms |
| `web/src/lib/mailLink.ts` + test | `mailSubject`, `mailtoLink` |
| `web/src/lib/contactFormReducer.ts` + test | The form as a pure state machine (editing → sending → sent / failed) |
| `web/src/recipes/formControl.ts` | The design's square fields for Input, Textarea and NativeSelect |
| `web/src/components/ContactForm/ContactForm.tsx` + test | The form (lazy chunk) |
| `web/src/components/ContactForm/ContactFormGate.tsx` + test | Dimmed, inert form under the coming-soon notice |
| `web/src/components/home/ContactSection/ContactSection.tsx` + test | The section: heading, gate, lazy form, `?pakket=` handling, focus |
### Modified
| File | Change |
|---|---|
| `web/src/content/types.ts`, `homeContent.ts`, `siteContent.ts` | `HomeContent.contact`; `SiteContent.contactForm = { enabled: false }` |
| `web/src/theme.ts` | `error` colour (#a4443a: 5.7:1 on paper, 6.1:1 on white), `panel` shadow, `formControl` recipe |
| `web/src/components/SectionHeading/SectionHeading.tsx` | `focusable` (tabIndex −1 for the programmatic focus) |
| `web/src/components/home/Pricing/PriceCard.tsx` | Feature list as plain `ul`/`li` instead of Chakra `List` (see performance) |
| `web/src/components/home/Testimonials/TestimonialSlide.tsx` | Plain `figure`/`blockquote`/`figcaption` instead of Chakra `Blockquote` (see performance) |
| `web/src/routes/index.tsx` | Renders `ContactSection` with `pakket` from `Route.useSearch()` |
| `web/src/test/arbitraries.ts` | `contactValues`, `anyContactValues`, `contactEvent` |
| `web/src/test/setup.ts` | No-op `Element.scrollIntoView` (the router's hash scroll; jsdom lacks it) |
| `web/src/app.test.tsx` | "Contact" in the page order; full "Boek Newborn" path through the real route |
## Findings and fixes during generation
- **Labels not linked** (found by a test): Chakra's `Field.Root` links the label to the control through its own id; overriding the control's `id` broke that. In Ark, `Field.Root`'s `id` is the control's id (and `ids.control` is, confusingly, the root group's id), so the id now goes on `Field.Root`. Ark links the error text with `aria-errormessage` (not `aria-describedby` as written in the functional design); `aria-invalid` is set.
- **Field refs vs the React compiler lint**: refs set from a helper called during render were rejected; focus now finds the first invalid field by its id.
- **Form disappearing after a "Boek" arrival**: with the form loaded because of `?pakket=`, removing the parameter made it unload until the observer fired, losing typed input. Once loaded the form now stays (asserted in the app test).
- **Coverage**: two reducer branches were only reached randomly by the stateful property test; fixed with deterministic example tests (100% on `src/lib/**`).
- **Performance** (5-run Lighthouse medians, unit 4 rebuilt alongside for the same conditions):
| Build | Median | LCP | TBT |
|---|---|---|---|
| Unit 4 | 0.83 | 3.84 s | 177 ms |
| Unit 5, form in the route chunk | 0.80 | 3.99 s | 232 ms |
| Unit 5, form lazy | 0.81 | 3.99 s | 207 ms |
| Unit 5, form lazy, no slot recipes in the route chunk | **0.83** | 3.84 s | 175 ms |
First the form was moved into its own chunk, loaded when the section comes within 200 px of the screen, or at once when arriving via "Boek …". The remaining gap came from a new shared chunk (Chakra's slot-recipe factory, now used by three chunks) that the route had to fetch on page load: the price cards' `List` and the review slide's `Blockquote` were the only slot-recipe components on the route, so they became plain elements with the same styling, and the route no longer needs that chunk.
- **Placeholder** while the form loads: measured 604 px on phones, 502 px from `sm`.
## Bugs found by the owner on LAN, fixed (2026-10-21)
1. **"Boek …" did not scroll.** The click navigates to `/?pakket=<id>#contact` and the router scrolls to the hash in its `onRendered` step. Our clean-up navigation (removing `?pakket=`) ran first and passed `hashScrollIntoView: false`, so the router's last instruction was "don't scroll". Traced in real Chrome: `pushState`, `replaceState`, no `scrollIntoView`. The clean-up now asks the router to scroll to `#contact` (`smooth`, or `auto` under reduced motion). Anchored sections get `scroll-margin-top` equal to the header, so the section lands below the fixed header. A new app test clicks "Boek Newborn" on the price card and asserts the scroll to `#contact`; it fails with the old code and passes with the fix. jsdom tests missed it because `scrollIntoView` is a stub there.
2. **"Boek Zwangerschap" scrolled less far than the others.** Smooth scrolling fixes its target when it starts. From the top card the review carousel was not loaded yet and loaded during the scroll; its fixed-height placeholder only matched the carousel at the measured widths, so `#contact` moved by +29 px (360 px wide) or −44 px (600 px) mid-scroll. The placeholder is now the longest review rendered like a slide plus the control bar's height, which is as tall as the carousel at every width. Measured at 360, 390, 412, 600, 768, 1024 and 1440 px: no movement during the scroll; every button ends at the same place.
3. CI run 555: the Lighthouse job on the Pi runner stopped with exit code −1 right after `pnpm install`, before any measurement (runner/infra, not a check failure); rerun with the next deploy.
## Verification (`pnpm check`)
- Lint ✅, Prettier ✅, build ✅ (`ContactForm` in its own chunk, ±5.7 KB gzipped)
- Tests: 52 files, **238 passed** (after the fixes); 100% coverage on `src/lib/**`
- Lighthouse home: mobile **0.83**, desktop **1.0**; accessibility, best practices, SEO **1.0**
- Visual check: 1440 and 390 with the overlay; 1440 with the form switched on locally (reverted before the build that was checked)
## Extension compliance
- **Security Baseline**: client-side limits and format (SECURITY-05, server side in the API feature); misuse: gate + honeypot + time check (SECURITY-11); generic failure text (SECURITY-15); the e-mail address is assembled in the browser; no new dependencies or external resources; CSP unchanged.
- **PBT**: PBT-02 (mailto round-trip), PBT-03 (validation invariants), PBT-04 (payload idempotency), PBT-05 (spam and e-mail oracles), PBT-06 (stateful reducer test over random event sequences), PBT-07 (generators), PBT-08/09 (existing seed setup), PBT-10 (example tests).
@@ -0,0 +1,80 @@
# Business Logic Model — Unit 5: Contact
## Submit sequence
```mermaid
sequenceDiagram
box rgba(246,224,94,0.4) Visitor
participant V as Visitor
end
box rgba(99,179,237,0.4) Homepage
participant F as ContactForm
participant L as PureHelpers
participant A as SubmitAdapter
end
V->>F: Clicks the send button
F->>L: validateContact with the values and options
L-->>F: Errors per field, or none
F->>L: isLikelySpam with honeypot and elapsed time
L-->>F: Spam or not
F->>A: submitContactForm with the trimmed payload
A-->>F: Resolved or rejected
F-->>V: Thank-you message, or failure message with mail link
```
Text alternative: on submit the form validates, checks for spam, sends the trimmed payload through the single adapter, and shows the thank-you or the failure message.
## Form state (a pure reducer)
The form's behaviour is a pure reducer `contactFormReducer(state, event)`, so it can be tested as a state machine (PBT-06) independently of React.
```mermaid
graph LR
Editing["editing"] -->|"submit, invalid"| Editing
Editing -->|"submit, spam"| Sent["sent"]
Editing -->|"submit, valid"| Sending["sending"]
Sending -->|"resolved"| Sent
Sending -->|"rejected"| Failed["failed"]
Failed -->|"edit or blur"| Failed
Failed -->|"submit, valid"| Sending
classDef state fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef final fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class Editing,Sending,Failed state;
class Sent final;
```
Text alternative: the form is editing until a submit; an invalid submit stays in editing (with errors), spam goes straight to sent, a valid submit goes to sending, which ends in sent or failed; from failed, a valid submit sends again.
**State**: `{ status: 'editing' | 'sending' | 'sent' | 'failed'; values; touched: Set of fields; errors }`
**Events**: `edit(field, value)`, `blur(field)`, `preselect(shoot)`, `submit({ now, shownAt, honeypot })`, `resolved`, `rejected`.
## Pure functions (`web/src/lib/`)
| Function | Purpose | Rules |
|---|---|---|
| `shootOptions(packages)` | shown packages + Overig | domain-entities.md |
| `validateField(field, values, options)` | first failing message for one field, or undefined | BR-FORM-01…07 |
| `validateContact(values, options)` | errors for all fields | BR-FORM-01…07 |
| `toContactPayload(values)` | trimmed payload | BR-SEND-01 |
| `isLikelySpam({ honeypot, shownAt, now })` | honeypot or under 3000 ms | BR-SPAM-01 |
| `mailSubject(packageName?)` | "Aanvraag fotoshoot: X" or "Vraag via andreaslop.nl" | BR-MAIL-01 |
| `mailtoLink(address, subject)` | `mailto:` with encoded subject | BR-MAIL-01 |
| `contactFormReducer(state, event)` | the state machine above | BR-FORM-10…12, BR-SEND-01…04, BR-SPAM-02 |
## Testable properties (PBT-01)
| Function | Category | Property |
|---|---|---|
| `shootOptions` | Invariant | Last option is Overig; the others are the packages' ids and names in order |
| `validateContact` | Oracle | For generated valid values there are no errors |
| `validateContact` | Invariant | Emptying any one required field gives exactly that field's "required" message |
| `validateContact` | Invariant | Exceeding a limit gives that field's "te lang" message |
| `validateContact` | Oracle | E-mail error ⇔ the trimmed value fails the format regex (for non-empty, short values) |
| `toContactPayload` | Idempotency | Making a payload of a payload changes nothing; no field has outer whitespace |
| `isLikelySpam` | Oracle | Equals `honeypot !== '' \|\| now - shownAt < 3000` |
| `mailtoLink` | Round-trip | Decoding the `subject` parameter gives back the subject; the link starts with `mailto:<address>?` |
| `mailSubject` | Invariant | Contains the package name when given, otherwise the general subject |
| `contactFormReducer` | Stateful (PBT-06) | For random event sequences: status only moves along the allowed transitions; `sending` only after a valid, non-spam submit; values never change while `sending`; errors never show for an untouched field unless a submit happened; after `sent` nothing changes |
Generators (PBT-07): valid `contactValues` (realistic names, e-mails from the existing `validEmail`, a shoot from the options, messages up to the limit), `anyContactValues` (empty, whitespace, overlong, bad e-mails), and event sequences for the reducer (`fc.commands` or a list of events).
@@ -0,0 +1,114 @@
# Business Rules — Unit 5: Contact
Sources: FR-HP-06…09, unit 3's BR-PARAM-02…04, [contact-fd-questions.md](../../plans/contact-fd-questions.md) and [contact-fd-clarification-questions.md](../../plans/contact-fd-clarification-questions.md).
## Validation
| ID | Rule | Message |
|---|---|---|
| BR-FORM-01 | `naam` is required (after trimming) | "Vul je naam in." |
| BR-FORM-02 | `email` is required | "Vul je e-mailadres in." |
| BR-FORM-03 | `email` must look like an address: `^[^\s@]+@[^\s@]+\.[^\s@]{2,}$` after trimming | "Dit e-mailadres is ongeldig." |
| BR-FORM-04 | `shoot` must be one of the shoot options | "Kies een soort shoot." |
| BR-FORM-05 | `bericht` is required | "Schrijf hier je vraag." |
| BR-FORM-06 | Maximum lengths: `naam` 100, `email` 254, `bericht` 2000 (also `maxLength` on the fields) | "De naam is te lang." / "Het e-mailadres is te lang." / "Het bericht is te lang." |
| BR-FORM-07 | Per field the first failing rule wins, in the order required → length → format | — |
## When errors show (Q1 = B)
| ID | Rule |
|---|---|
| BR-FORM-10 | A field is checked when the visitor **leaves** it, but only once they have typed in it; tabbing through an untouched empty field shows nothing. |
| BR-FORM-11 | On **submit** every field is checked; if any is invalid, nothing is sent and focus moves to the first invalid field. |
| BR-FORM-12 | A shown error is re-checked while typing and **disappears** as soon as the field is valid (it is not re-shown while typing; a new error only appears on leaving or submitting). |
| BR-FORM-13 | Errors are linked to their field (`aria-describedby`, `aria-invalid`) and announced. |
## Sending
| ID | Rule |
|---|---|
| BR-SEND-01 | Valid and not spam → state **sending**: button disabled, label "Versturen…"; the payload (trimmed values) goes to `submitContactForm`. |
| BR-SEND-02 | Success → state **sent**: the form is replaced by "Bedankt voor je bericht! Ik reageer binnen 1-2 werkdagen." and focus moves to that message (Q3 = A). |
| BR-SEND-03 | Failure → state **failed**: above the button "Versturen lukte niet. Probeer het later nog eens of mail naar info@andreaslop.nl" with the address as a mail link (BR-MAIL-01); what the visitor typed stays; the next submit tries again (Q6 = A). |
| BR-SEND-04 | A second submit while sending is ignored. |
## Anti-spam (FR-HP-08)
| ID | Rule |
|---|---|
| BR-SPAM-01 | Spam when the honeypot `website` is not empty, or less than 3000 ms passed since the form became usable. |
| BR-SPAM-02 | Spam gets the normal success (state **sent**), but nothing is sent. Validation still runs first, like for a person. |
| BR-SPAM-03 | No robot-check script is loaded in this feature; the form keeps a slot for Friendly Captcha (FR-HP-09). |
## Gate (FR-HP-07)
| ID | Rule |
|---|---|
| BR-GATE-01 | `contactForm.enabled = false` → the form is visible but dimmed and `inert`; over it the notice "Binnenkort", "Het contactformulier komt binnenkort. Mail me voor nu op info@andreaslop.nl" and the button "Stuur een e-mail". |
| BR-GATE-02 | The address is assembled from `siteContent.email` in the browser (existing `emailAddress`); if it is invalid the notice shows only "Het contactformulier komt binnenkort." without address or button. |
| BR-GATE-03 | `enabled = true` → the form works normally and the notice is not rendered. |
## Mail link (Q4 = A)
| ID | Rule |
|---|---|
| BR-MAIL-01 | Every mail link (notice button, address in the notice, address in the failure message) opens a mail with a subject: "Aanvraag fotoshoot: <package name>" when the visitor arrived via a "Boek …" link (a package is selected from `?pakket=`), otherwise "Vraag via andreaslop.nl". Subject is URL-encoded. |
## Preselection from "Boek …" (unit 3, BR-PARAM-02…04)
| ID | Rule |
|---|---|
| BR-PARAM-02 | When the page has a `pakket` value: if it names a shown package (`packageFromSearch`), the shoot field takes that package — replacing an earlier choice (last click wins, BR-PARAM-03). Then `pakket` is removed from the URL with a history *replace*, keeping `#contact`, without scrolling. Unknown values are removed the same way and change nothing. |
| BR-PARAM-04 | This happens the same way with the gate on or off (with the gate on, the package still feeds the mail subject). |
| BR-FOCUS-01 | After arriving via a "Boek …" link (any `pakket` value present), focus moves to the "Contact" heading (programmatic focus, no visible ring), so keyboard and screen reader users continue in the right place (Q5 = A). A normal page load does not move focus. |
## Decision flow: submit
```mermaid
graph TD
Submit["Visitor submits"] --> Busy{"Already sending?"}
Busy -->|"yes"| Ignore["Ignore"]
Busy -->|"no"| Valid{"All fields valid?"}
Valid -->|"no"| ShowErrors["Show errors, focus first invalid field"]
Valid -->|"yes"| Spam{"Honeypot filled or under 3 s?"}
Spam -->|"yes"| FakeSent["Show thank-you, send nothing"]
Spam -->|"no"| Sending["Sending: button disabled"]
Sending --> Result{"Adapter result"}
Result -->|"ok"| Sent["Replace form by thank-you, focus it"]
Result -->|"error"| Failed["Failure message with mail link, keep input"]
classDef input fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef decision fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef outcome fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class Submit input;
class Busy,Valid,Spam,Result decision;
class Ignore,ShowErrors,FakeSent,Sending,Sent,Failed outcome;
```
Text alternative: a submit is ignored while sending; otherwise invalid input shows errors and focuses the first invalid field; valid spam gets the thank-you without sending; valid input is sent, and the result either replaces the form by the thank-you or shows the failure message with a mail link while keeping the input.
## Decision flow: arriving with `?pakket=`
```mermaid
graph TD
Arrive["Homepage with pakket in the URL"] --> Known{"Names a shown package?"}
Known -->|"yes"| Select["Shoot field takes the package, replacing an earlier choice"]
Known -->|"no"| Keep["Shoot field unchanged"]
Select --> Clean["Remove pakket with history replace, keep hash contact"]
Keep --> Clean
Clean --> Focus["Focus the Contact heading"]
classDef input fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef decision fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef outcome fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class Arrive input;
class Known decision;
class Select,Keep,Clean,Focus outcome;
```
Text alternative: a known package is selected (replacing an earlier choice), an unknown one changes nothing; either way the parameter is removed from the URL with a history replace and focus moves to the Contact heading.
## Misuse considerations (SECURITY-11)
- Form spam: gate today; honeypot and time check in the browser; Friendly Captcha, server-side validation and rate limiting in the API feature (the browser checks are never the only defence).
- Input is only ever rendered as text by React and sent as JSON later; `pakket` is never reflected.
- Failure messages are generic (no technical details, SECURITY-15).
@@ -0,0 +1,57 @@
# Domain Entities — Unit 5: Contact
## Relationships
```mermaid
graph TD
Values["ContactValues"]
Errors["ContactErrors"]
Payload["ContactPayload"]
Option["ShootOption"]
Package["PricingPackage"]
Config["Contact form setting"]
Address["EmailAddress"]
Package -->|"becomes, plus Overig"| Option
Option -->|"allowed values of shoot"| Values
Values -->|"checked into"| Errors
Values -->|"trimmed into"| Payload
Config -->|"switches form or notice"| Values
Address -->|"mail link in notice and failure message"| Config
classDef entity fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef value fill:#FF9800,stroke:#e65100,stroke-width:1px,color:#000;
classDef config fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class Values,Payload entity;
class Errors,Option,Package,Address value;
class Config config;
```
Text alternative: packages (plus Overig) become the shoot options that limit the shoot value; what the visitor typed is checked into errors and trimmed into the payload; the contact form setting switches between the form and the coming-soon notice, which, like the failure message, uses the site's e-mail address.
## ContactValues (what the visitor typed)
| Field | Type | Limit | Required |
|---|---|---|---|
| `naam` | string | 100 characters | yes |
| `email` | string | 254 characters | yes, valid format |
| `shoot` | string | one of the shoot option values | yes |
| `bericht` | string | 2000 characters | yes |
The limits are also set as `maxLength` on the fields, so in practice they are rarely exceeded; the check is a safety net (and the server repeats it).
## ContactErrors
`Partial<Record<'naam' | 'email' | 'shoot' | 'bericht', string>>` — one message per field at most.
## ContactPayload (sent to the API later)
Same four fields, trimmed. `shoot` is a package id (e.g. `newborn`) or `overig`. The Friendly Captcha token is added in the API feature.
## ShootOption
`{ value: string; label: string }` — the shown packages in their order (`value` = package id, `label` = name), then `{ value: 'overig', label: 'Overig' }`. The empty "Kies een optie..." is the placeholder, not an option.
## Contact form setting
`siteContent.contactForm.enabled: boolean` — `false` today (coming-soon notice); later delivered by the CMS.
## Anti-spam inputs
- Honeypot field `website` (hidden from people and assistive technology).
- `shownAt`: when the form became usable (shown and enabled); minimum fill time **3000 ms**.
@@ -0,0 +1,66 @@
# Frontend Components — Unit 5: Contact
## Hierarchy
```mermaid
graph TD
Route["routes/index.tsx"] --> Section["home/ContactSection"]
Section --> Home["HomeSection id contact, narrow"]
Section --> Heading["SectionHeading, focus target"]
Section --> Gate["ContactForm/ContactFormGate"]
Gate --> Form["ContactForm/ContactForm"]
Gate --> Notice["Coming-soon notice with mail button"]
Form --> Fields["Chakra Field: Input, NativeSelect, Textarea"]
Form --> Honeypot["Honeypot field"]
Form --> Slot["Robot-check slot, empty"]
Form --> Status["Sending, failure and thank-you"]
Logic["lib: reducer, validation, spam, mail link"] -.-> Form
Logic -.-> Gate
Adapter["contact/submitContactForm"] -.-> Form
classDef root fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
classDef ui fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef logic fill:#9C27B0,stroke:#4a148c,stroke-width:1px,color:#000;
classDef ext fill:#F44336,stroke:#b71c1c,stroke-width:1px,color:#000;
class Route root;
class Section,Home,Heading,Gate,Form,Notice,Fields,Honeypot,Slot,Status ui;
class Logic logic;
class Adapter ext;
```
Text alternative: the home route renders ContactSection (HomeSection with id contact, the heading as focus target, and the gate); the gate wraps the form and the coming-soon notice; the form has Chakra fields, a honeypot, an empty robot-check slot and status messages; pure helpers and the submit adapter support it.
## ContactSection (`components/home/ContactSection`)
- **Props**: `{ content: HomeContent['contact']; packages: PricingPackage[]; enabled: boolean; email: EmailAddress; pakket?: string }`
- **Behaviour**: resolves `pakket` with `packageFromSearch`; passes the selected id to the form (`preselect`) and the package name to the mail subject; removes `pakket` from the URL (router `navigate({ search: {}, hash: 'contact', replace: true, resetScroll: false })`); moves focus to the heading when `pakket` was present (BR-PARAM-02, BR-FOCUS-01).
- **Layout**: `HomeSection` `id="contact"`, `width="narrow"`, plain background, centred `SectionHeading` "Contact" with lead; the heading has `tabIndex={-1}` for the programmatic focus (no visible ring, theme rule `[tabindex="-1"]:focus`).
## ContactFormGate (`components/ContactForm/ContactFormGate`)
- **Props**: `{ enabled: boolean; email: EmailAddress; subject: string; children }`
- **Off**: wraps children in a dimmed (`opacity 0.35`, slight blur), `inert`, non-selectable box; renders the notice centred over it: eyebrow "Binnenkort", the text with the address as an underline link, and an accent `LinkButton`-style anchor "Stuur een e-mail" (`mailtoLink`). White panel, hairline border, `shadow` from the design (a theme token). Invalid address → text only.
- **On**: renders children only.
## ContactForm (`components/ContactForm/ContactForm`)
- **Props**: `{ idPrefix: string; options: ShootOption[]; preselect?: { shoot: string; key: number }; mailSubject: string; email: EmailAddress; submit?: (payload) => Promise<void> }` (`key` changes per "Boek" click so the same package can be applied again)
- **State**: `useReducer(contactFormReducer)`; `shownAt` recorded when the form becomes usable.
- **Fields**: Chakra `Field.Root` + `Field.Label` + control + `Field.ErrorText` (`invalid` from state); square inputs in the design style (theme), `autocomplete` name/email, `maxLength` per limit; the select has the placeholder "Kies een optie..." and the shoot options; the textarea min height 170 px with placeholder "Vul hier je bericht in".
- **Honeypot**: label "Website" + input `name="website"`, off-screen, `aria-hidden`, `tabIndex={-1}`, `autoComplete="off"`.
- **Robot-check slot**: an empty `div` with `data-robot-check` (FR-HP-09).
- **Submit button**: accent `linkButton` style on a `button`, "(Aan)vraag versturen" / "Versturen…" while sending, disabled while sending.
- **Failure**: a status box above the button (`role="alert"`) with the mail link.
- **Sent**: the form is replaced by the thank-you (`role="status"`, `tabIndex={-1}`, focused).
- **Layout**: name and e-mail side by side from `sm`, the rest full width; labels in the eyebrow style (`ink.soft` for contrast).
- **Test ids**: `contact-form`, `contact-form-<field>`, `contact-form-submit`, `contact-form-status`, `contact-form-sent`, `contact-gate-notice`, `contact-gate-mail`.
## Loading
The form is a lazy chunk, loaded when the section comes within 200 px of the screen or at once when arriving via "Boek …", and it stays once loaded; the heading and the gate's notice render immediately over a placeholder of the form's height (unit 5 code summary, performance).
## Content
- `HomeContent.contact = { title: 'Contact', lead: 'Wil je meer informatie ontvangen? Neem gerust contact met mij op.' }`
- `siteContent.contactForm = { enabled: false }`
## Accessibility (NFR-HP-01)
- Labels visible and linked; errors via `aria-errormessage`/`aria-invalid` (Ark's Field) and announced; focus to the first invalid field on submit; thank-you focused; failure announced (`role="alert"`).
- With the gate on, the inert form is skipped by keyboard and screen readers; the notice and its button are reachable.
- Contrast: labels and placeholder text meet 4.5:1 (no `ink.muted` on paper); the dimmed form is decorative while inert.
- Axe clean in both gate states; Lighthouse accessibility stays 1.0.
@@ -0,0 +1,25 @@
# Code Summary — Unit 6: Instagram
Plan: [instagram-code-generation-plan.md](../../plans/instagram-code-generation-plan.md)
## Files
| File | Change |
|---|---|
| `web/src/content/types.ts` | `HomeContent.instagram: { title; handle; photos: ContentImage[] }` |
| `web/src/content/homeContent.ts` | Intro photos moved to a shared `introPhotos` constant; `instagram` content reuses them plus the two review photos (`testimonials`), so one photo keeps one alt text and the section adds no image downloads |
| `web/src/components/HomeSection/HomeSection.tsx` + test | `width="full"`: no `Container`, for edge-to-edge content |
| `web/src/components/SectionHeading/SectionHeading.tsx` | `lead` accepts a `ReactNode` (the handle link) |
| `web/src/components/home/InstagramGrid/InstagramGrid.tsx` + test | New section: centred heading with the handle as external link, full-bleed list of square tiles (2 / 3 from `md` / 6 from `xl`, 2px gap), each an external link named by the photo's alt plus "(Instagram, opent in nieuw tabblad)"; hover and keyboard focus zoom 1.06 and fade to 85%, fade only under reduced motion; focused tile lifted above its neighbours so the ring is not covered |
| `web/src/routes/index.tsx` | Renders `InstagramGrid` last, only when `visibleSocials` yields an Instagram link (https) |
| `web/src/app.test.tsx` | Instagram added to the page-order check; section absent when the link is missing or not https (`siteContent.socials` overridable through a hoisted mock) |
`LAYOUT.md` already lists Instagram as the last homepage block: unchanged.
## Verification
- Lint, Prettier, typecheck/build, dependency audit: ✅
- Tests: 244 passed (53 files); new: 3 InstagramGrid, 1 HomeSection, 3 app (order + two absent cases)
- Visual (headless Chrome, preview build): 6 columns at 1440px, 3 at 1024px, 2 at 390px; grid as wide as the viewport; h2 30px; the page requests the same 15 images as before (no new ones)
- Lighthouse (`pnpm lighthouse`, production build): ✅ homepage mobile 0.81 (TBT 230 ms, LCP 3.8 s), desktop 1.0; other pages mobile 0.93–0.94, desktop 1.0; accessibility, best practices and SEO 1.0 everywhere.
- A first run failed (home mobile 0.73, /contact 0.84) while the machine was under load (a game and a Vite dev server). Back-to-back runs of the unit 5 build and this build both scattered between 0.68 and 0.84, with no difference between them; with the game closed the gate passed. Scores measured in the browser against the Vite dev server (desktop 0.55, mobile 0.36, 137 unbundled requests) say nothing about the production site.
@@ -0,0 +1,52 @@
# Code Summary — Unit 4: Lieve woorden
Plan: [lieve-woorden-code-generation-plan.md](../../plans/lieve-woorden-code-generation-plan.md). Functional design: [../functional-design/](../functional-design/). Branch: `feature/homepage-sections`.
## Files
### Created
| File | Purpose |
|---|---|
| `web/src/assets/home/review-trouwshoot.jpg`, `review-newbornshoot.jpg` | Live photos, centre-cropped to 4:5, 880×1100, ±100 KB |
| `web/src/content/testimonials.ts` | The two live reviews |
| `web/src/lib/visibleTestimonials.ts` + test | Invariants filter, first-wins de-duplication (BR-REV-01) |
| `web/src/lib/slideLabel.ts` + test | "Review n van m" (BR-REV-08/09) |
| `web/src/recipes/carouselControl.ts` | Arrow and dot buttons under a carousel |
| `web/src/components/home/Testimonials/Testimonials.tsx` + test | The section; heading always rendered; carousel loaded when near the screen |
| `web/src/components/home/Testimonials/TestimonialCarousel.tsx` | Chakra `Carousel` (Zag) with our own controls and live region; separate chunk |
| `web/src/components/home/Testimonials/TestimonialSlide.tsx` + test | One review: framed photo, quotation mark, shoot, quote, names |
### Modified
| File | Change |
|---|---|
| `web/src/content/types.ts`, `homeContent.ts` | `Testimonial`; `HomeContent.testimonials` |
| `web/src/theme.ts` | Registers `carouselControl` |
| `web/src/test/arbitraries.ts` | `testimonial`, `uniqueTestimonials`, `anyTestimonial` |
| `web/src/test/setup.ts` | No-op `ResizeObserver` (jsdom lacks it; the carousel needs it) |
| `web/src/routes/index.tsx` | Renders `Testimonials` after `Pricing` |
| `web/src/app.test.tsx` | "Lieve woorden" in the page order; stubs `IntersectionObserver` and `Element.scrollTo` for the carousel |
## Decisions and fixes during generation
- **Own controls for reduced motion** (plan finding 1): Zag's built-in triggers, dots and keys scroll smoothly from JavaScript; ours pass `instant` when the visitor prefers reduced motion. Verified in real Chrome: normally the slide moves over ±330 ms, with reduced motion it is in place in the first frame.
- **One announcement** (finding 2): the item group's `aria-live` is off; our polite region says "Review n van m" on each change, nothing on load.
- **Slides clipped each other's frame**: the sand block sticks out 1.5 rem left and below the photo, and the item group clips everything outside a slide, so the next slide's block showed over the quote. Fixed with 4 rem `spacing` between slides and 1.5 rem padding left/bottom in each slide (from `sm`).
- **Carousel cost on page load**: the carousel in the route chunk lowered home mobile Lighthouse from a median **0.83** (unit 3, 5 runs) to **0.81**; `React.lazy` alone did not help (the chunk still loaded at once). Now the section and heading render immediately, and the carousel chunk loads only when the section comes within 200 px of the screen (same rule as the deferred photos), with a placeholder of the measured height. Median back to **0.83** (LCP 3.84 s).
- **Testing approach**: jsdom has no layout, so Zag cannot page there. Unit tests check our wiring (calls to `scrollNext/scrollPrev/scrollTo` with the right `instant`, announcements, labels, loop option, deferred loading); paging, looping, dots and the hidden off-screen slide were checked in real Chrome via the DevTools protocol (next → "Review 2 van 2", next again → back to review 1, dot 2 → review 2).
## Change request after testing on test (2026-10-20)
The photo was too large on phones (it filled the screen). Now: phones max 180 px wide (±75% of a first 240 px step), tablets max 320 px, centred above the quote. Desktop grid `5fr 11fr` after reviewing screenshots of both, so the photo is ±75% of its earlier size (±395×495 px at 1440) and the whole block fits a ±1000 px high screen. Stacked slides align their content to the top (a short review no longer floats in the middle of the shared height) with a 1.25 rem gap between photo and text. Placeholder heights re-measured.
## Later change (unit 5)
The carousel's fixed-height placeholder was replaced by the longest review rendered like a slide plus the control bar's height, so it matches the carousel at every width (a mismatch moved `#contact` during a "Boek" scroll; see the unit 5 code summary).
The quote is a plain `figure`/`blockquote`/`figcaption` instead of Chakra's `Blockquote`: its slot recipe pulled a shared chunk into the route bundle on page load (see the unit 5 code summary, performance).
## Verification (`pnpm check`)
- Lint ✅, Prettier ✅, build ✅ — carousel in its own chunk (`TestimonialCarousel-*.js`, 43 KB raw)
- Tests: 42 files, **190 passed**; 100% coverage on the new `lib/` files
- Lighthouse home: mobile **0.83** (LCP 3.8 s), desktop **1.0** (LCP 0.8 s); accessibility, best practices, SEO **1.0**
- Visual check: 1440 and 390, both reviews
## Extension compliance
- **Security Baseline**: content rendered as text; no new dependencies (Chakra Carousel and Ant Design icons already installed); no external resources. Other rules N/A.
- **PBT**: PBT-02 (`slideLabel` round-trip), PBT-03 (invariants), PBT-04 (idempotency), PBT-05 (oracle), PBT-07 (generators), PBT-08/09 (existing), PBT-10 (example tests). PBT-06 N/A — the stateful part is Zag's.
@@ -0,0 +1,45 @@
# Business Logic Model — Unit 4: Lieve woorden
## Navigation flow
```mermaid
sequenceDiagram
box rgba(246,224,94,0.4) Visitor
participant V as Visitor
end
box rgba(99,179,237,0.4) Testimonials
participant C as Carousel
participant L as LiveRegion
end
V->>C: Next button, dot, arrow key or swipe
C->>C: Compute target page, looping at the ends
C->>C: Scroll to the target slide, instantly under reduced motion
C->>L: Page changed to n
L-->>V: Announces Review n van m
```
Text alternative: a navigation action makes the carousel compute the target page (looping), scroll to it (instantly under reduced motion) and report the new page to a polite live region, which announces "Review n van m".
The carousel state (current page, scrolling, dragging, looping) is Chakra's `Carousel` (Ark UI); this unit does not reimplement it. Our own logic is limited to the pure functions below and wiring `onPageChange` to the live region.
## Pure functions (`web/src/lib/`)
| Function | Input → output | Rules |
|---|---|---|
| `visibleTestimonials(items: Testimonial[]): Testimonial[]` | raw list → shown list | BR-REV-01 |
| `slideLabel(index: number, count: number): string` | `(1, 2)` → `'Review 2 van 2'` (index is zero-based) | BR-REV-08/09 |
## Testable properties (PBT-01)
| Function | Category | Property |
|---|---|---|
| `visibleTestimonials` | Invariant | Every result meets the invariants; ids unique |
| `visibleTestimonials` | Invariant | Result is a subsequence of the input |
| `visibleTestimonials` | Idempotency | Applying it twice equals applying it once |
| `visibleTestimonials` | Oracle | Valid, unique input comes back unchanged |
| `slideLabel` | Round-trip | The two numbers parsed back from the label are `index + 1` and `count` |
| `slideLabel` | Invariant | For `0 ≤ index < count` the label has the form `Review n van m` with `1 ≤ n ≤ m` |
The looping and paging itself is Chakra's (tested upstream); our component tests cover the behaviour at our boundary: loop from last to first, announcement text, controls hidden for one review, nothing rendered for none. PBT-06 (stateful) is N/A because the state machine is not ours.
Generators (PBT-07) in `src/test/arbitraries.ts`: `testimonial` (valid; slug ids, non-blank texts, image with positive size), `uniqueTestimonials`, `anyTestimonial` (incl. blank quote/author/shoot, empty src, zero size, duplicate ids).
@@ -0,0 +1,64 @@
# Business Rules — Unit 4: Lieve woorden
## Rules
| ID | Rule | Source |
|---|---|---|
| BR-REV-01 | Only testimonials that meet the invariants are shown; duplicates by id keep the first; order is kept. | domain-entities.md |
| BR-REV-02 | No valid testimonial → the section is not rendered. One → it is shown without arrows, dots or carousel semantics. Two or more → carousel. | FR-HP-05 |
| BR-REV-03 | One review is visible at a time; there is no autoplay. | FR-HP-05, design Q2 |
| BR-REV-04 | Navigation: previous/next buttons, one dot per review, arrow keys when focus is in the carousel, and swiping (and mouse dragging) on the slides. | FR-HP-05 |
| BR-REV-05 | At the ends the carousel loops: "next" on the last review goes to the first, "previous" on the first to the last. The buttons are never disabled. | Q1 = A |
| BR-REV-06 | A change slides horizontally (the slides lie side by side; a swipe follows the finger). Under `prefers-reduced-motion` the change is immediate, without animation. | Q2 = A |
| BR-REV-07 | Every slide has the height of the tallest one, so the page below does not move when the review changes. | Q3 = A |
| BR-REV-08 | Every manual change is announced once, politely, as "Review n van m". Nothing is announced on page load. | NFR-HP-01 |
| BR-REV-09 | Each slide is labelled "Review n van m"; the buttons are "Vorige review" / "Volgende review"; each dot is "Review n", and the current dot is marked as current. | NFR-HP-01 |
| BR-REV-10 | Off-screen slides are hidden from assistive technology and not focusable. | NFR-HP-01 |
| BR-REV-11 | The quote is shown as a blockquote with the author as its caption; the large quotation mark is decorative and hidden from assistive technology. | design |
## Decision flow: what is rendered (BR-REV-01/02)
```mermaid
graph TD
In["Testimonials from content"] --> Filter["Keep valid, first of each id"]
Filter --> Count{"How many remain?"}
Count -->|"none"| Nothing["Section not rendered"]
Count -->|"one"| Single["Single review, no controls"]
Count -->|"two or more"| Carousel["Carousel with arrows, dots, keyboard and swipe, looping"]
classDef input fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef decision fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef outcome fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class In,Filter input;
class Count decision;
class Nothing,Single,Carousel outcome;
```
Text alternative: after filtering, no testimonials means no section, one means a single review without controls, two or more means a looping carousel with arrows, dots, keyboard and swipe.
## Decision flow: navigation (BR-REV-05/06/08)
```mermaid
graph TD
Act["Visitor uses arrow, dot, key or swipe"] --> Target{"Past the last or before the first?"}
Target -->|"yes"| Wrap["Wrap around to the other end"]
Target -->|"no"| Go["Go to the chosen review"]
Wrap --> Motion{"Prefers reduced motion?"}
Go --> Motion
Motion -->|"yes"| Jump["Switch immediately"]
Motion -->|"no"| Slide["Slide horizontally"]
Jump --> Say["Announce Review n van m once"]
Slide --> Say
classDef input fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef decision fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef outcome fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class Act input;
class Target,Motion decision;
class Wrap,Go,Jump,Slide,Say outcome;
```
Text alternative: any navigation action wraps around at the ends, then either switches immediately (reduced motion) or slides, and is announced once as "Review n van m".
## Misuse considerations (SECURITY-11)
Testimonials are static content (later from the CMS) and rendered as text by React; no HTML from content is interpreted.
@@ -0,0 +1,57 @@
# Domain Entities — Unit 4: Lieve woorden
## Relationships
```mermaid
graph TD
List["Testimonial list"]
Item["Testimonial"]
Image["ContentImage"]
Slide["Carousel slide"]
List -->|"contains, in display order"| Item
Item -->|"has one photo"| Image
Item -->|"shown as"| Slide
classDef entity fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef value fill:#FF9800,stroke:#e65100,stroke-width:1px,color:#000;
classDef ui fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class List,Item entity;
class Image value;
class Slide ui;
```
Text alternative: the testimonial list holds testimonials in display order; each has one photo and is shown as one carousel slide (blue = data, orange = value, green = UI).
## Testimonial
| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Stable, unique key (e.g. `majella-mark`) |
| `shoot` | string | yes | Shoot type as a label (e.g. "Trouwshoot") |
| `quote` | string | yes | The review text, without quotation marks (the design adds a decorative one) |
| `author` | string | yes | Names as they should appear (e.g. "Majella & Mark") |
| `image` | ContentImage | yes | Photo for the review, with alt text and size |
### Invariants
- `id` unique within the list.
- `shoot`, `quote` and `author` non-empty after trimming.
- `image.src` non-empty; `image.width` and `image.height` positive.
- List order is the display order.
Testimonials that break an invariant are skipped; of two with the same id the first is kept (same approach as packages and socials).
## Initial data (live site, 2026-10-19)
| id | shoot | author | quote (start) | photo |
|---|---|---|---|---|
| `majella-mark` | Trouwshoot | Majella & Mark | "Super mooie foto's door Andrea gemaakt op onze trouwdag en pré-wedding shoot. …" | live `IMG_2497-5.jpg` (rings), alt "Bruidegom schuift de trouwring om de vinger van de bruid" |
| `demi-kevin` | Newbornshoot | Demi & Kevin | "Heel tevreden met de newbornshoot. …" | live `5-F41A4650-scaled.jpg` (baby's fist), alt "Vuistje van een pasgeboren baby tussen gebreide dekens" |
Full texts: requirements FR-HP-05.
## Section content (`HomeContent.testimonials`)
| Field | Value |
|---|---|
| `title` | "Lieve woorden" |
@@ -0,0 +1,49 @@
# Frontend Components — Unit 4: Lieve woorden
## Hierarchy
```mermaid
graph TD
Route["routes/index.tsx"] --> T["home/Testimonials"]
T --> Section["HomeSection tone alt"]
T --> Heading["SectionHeading"]
T --> Root["Carousel.Root loop"]
Root --> Group["Carousel.ItemGroup"]
Group --> Item["Carousel.Item x n"]
Item --> Slide["home/Testimonials/TestimonialSlide"]
Slide --> Framed["FramedImage 4 by 5"]
Root --> Control["Carousel.Control: Prev, Indicators, Next"]
T --> Live["Live region"]
Lib["lib: visibleTestimonials, slideLabel"] -.-> T
classDef root fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
classDef ui fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef logic fill:#9C27B0,stroke:#4a148c,stroke-width:1px,color:#000;
class Route root;
class T,Section,Heading,Root,Group,Item,Slide,Framed,Control,Live ui;
class Lib logic;
```
Text alternative: the home route renders Testimonials, which uses HomeSection, SectionHeading, a looping Chakra Carousel with one item per review (each a TestimonialSlide with a FramedImage) and a control bar with previous, dots and next, plus a live region; pure helpers supply the shown reviews and labels.
## Testimonials
- **Props**: `{ content: HomeContent['testimonials']; testimonials: Testimonial[] }`
- **Behaviour**: `visibleTestimonials`; none → `null`; one → the `TestimonialSlide` directly (no carousel); two or more → `Carousel.Root` with `slideCount`, `loop`, `allowMouseDrag`, one slide per page.
- **Layout**: `HomeSection` with `tone="alt"`, `data-testid="testimonials"`, centred `SectionHeading`. Controls centred below the slides, margin `clamp(2.5rem, 5vw, 4rem)`.
- **Equal height** (BR-REV-07): items stretch in the item group's row, so all slides take the tallest height; content vertically centred within.
- **Reduced motion** (BR-REV-06): the item group's scrolling is instant (`scroll-behavior: auto`).
- **Announcements** (BR-REV-08): a `VisuallyHidden` polite live region, empty on load, set to `slideLabel(page, count)` in `onPageChange`. Any live region Chakra adds itself is checked so only one announcement is made.
- **Controls**: `Carousel.PrevTrigger` / `NextTrigger` with Dutch `aria-label`s and arrow icons from the offline icon set (as the hero), 48 px square, `line` border, `ink` border on hover/focus; `Carousel.Indicator` per page, 44 px hit area around an 8 px dot (`accent.deep` outline, filled when current).
- **Test ids**: `testimonials`, `testimonials-prev`, `testimonials-next`, `testimonials-dot-{n}`, `testimonial-{id}`.
## TestimonialSlide
- **Props**: `{ testimonial: Testimonial }`
- **Layout**: grid `5fr 11fr` from `lg` (photo column ±75% of the design's `5fr 7fr`) with gap `clamp(2rem, 6vw, 5.5rem)`, centred vertically; stacked below `lg` with the photo centred, max 180 px wide on phones and 320 px on tablets, content aligned to the top (slides share the tallest height) and a 1.25 rem gap between photo and text (owner's choices after review).
- **Photo**: `FramedImage` with aspect `4 / 5` (the source photos are cropped to 4:5 when prepared).
- **Text**: decorative quotation mark (Marcellus, `clamp(5rem, 9vw, 7.5rem)`, `accent`, `aria-hidden`); shoot as eyebrow (`accent.deep`); `figure` > `Blockquote` (Marcellus, `clamp(1.35rem, 2.2vw, 1.75rem)`, line-height 1.5, `ink`) > `figcaption` with "— " + author in small caps (`ink.soft`).
## Accessibility (NFR-HP-01)
- Region named by the h2 "Lieve woorden"; the carousel has `aria-roledescription` "carrousel" and a label "Reviews"; slides "Review n van m" (BR-REV-09).
- Hidden slides are inert to keyboard and screen readers (BR-REV-10).
- Focus ring from the theme on all controls; targets ≥ 44 px.
- Axe clean; Lighthouse accessibility stays 1.0.
@@ -0,0 +1,92 @@
# Code Summary — Unit 1: Lifestyle fotografie
Plan: [lifestyle-fotografie-code-generation-plan.md](../../plans/lifestyle-fotografie-code-generation-plan.md). Branch: `feature/homepage-sections`.
## Files
### Created
| File | Purpose |
|---|---|
| `web/src/assets/home/intro-1…4.jpg` | Gallery photos, 800×1200, 92–141 KB |
| `web/src/content/homeContent.ts` | Homepage section content (intro part) |
| `web/src/hooks/useInView.ts` | Shared "has come into/near view, once" hook (IntersectionObserver; immediate without it) |
| `web/src/hooks/useReveal.ts` + test | Reveal trigger on top of `useInView`; immediate under reduced motion |
| `web/src/hooks/usePageLoaded.ts` + test | True once the window load event has fired |
| `web/src/components/Reveal/Reveal.tsx` + test | Fade-in-and-up wrapper, optional stagger delay, passes Box props |
| `web/src/components/DeferredImage/DeferredImage.tsx` + test | Below-the-fold image that loads after the load event and within 600 px of the viewport |
| `web/src/components/SectionHeading/SectionHeading.tsx` + test | Eyebrow, h2 with id, lead |
| `web/src/components/HomeSection/HomeSection.tsx` + test | Section frame: rhythm, tone, width, `aria-labelledby`, anchor |
| `web/src/components/home/IntroGallery/IntroGallery.tsx` + test | The "Lifestyle fotografie" section |
| `web/src/test/fakeIntersectionObserver.ts` | Shared, controllable IntersectionObserver test double |
### Modified
| File | Change |
|---|---|
| `web/src/theme.ts` | Spacing `sectionY`, `sectionYTight`, `sectionHeadGap`, `gridGap`; size `contentNarrow`; duration `reveal`; text styles `sectionTitle`, `lead` |
| `web/src/content/types.ts` | `ContentImage`, `HomeContent` (intro) |
| `web/src/routes/index.tsx` | Renders `IntroGallery` after the Hero |
| `web/src/app.test.tsx` | Homepage: sections follow the hero in order, one h1, axe clean |
## Deviation from the plan (Step 18a)
The first `pnpm check` failed on Lighthouse home mobile performance (0.78, budget 0.8). The LCP rose from 3.8 s to 5.3 s because Chrome fetches `loading="lazy"` images within ±1250 px of the viewport straight away: the gallery photos right under the hero were downloaded together with the first hero photo and, under Lighthouse's throttling, took its bandwidth. `DeferredImage` now holds back the `src` until the page has loaded and the image is near the viewport. Every later unit uses it for its photos.
## Change request after review: swipeable row on phones
Requested: on phones the four photos stacked vertically were too much; show one at a time and swipe to the next.
- `IntroGallery` now renders the photos as a list (`ul` named "Foto's"). Below `sm` it is a full-bleed row with CSS scroll snap: each photo 85% of the width, centred on snap, the next one peeking in; scrollbar hidden; the list is focusable (`tabIndex=0`, only while it scrolls, via `useBreakpointValue`) so keyboard users can scroll it with the arrow keys. From `sm` the grid (2 / 4 columns, staggered offsets) is unchanged.
- Photos clipped by the scroller never intersect on their own, so the gallery observes its list once (`useInView`, 600 px margin) and passes `near` to each `DeferredImage` (new optional prop). The gallery now fades in as one block instead of per photo.
- Static design updated to match (`style.css`, ≤ 680 px); FR-HP-02 updated.
- Verified at an emulated 390×844 phone via the Chrome DevTools Protocol (one photo with the next peeking in; second photo snaps to the centre after swiping).
- `pnpm check` green: **139 tests**, Lighthouse home mobile **0.84** (LCP 3.9 s), desktop **1.0**, accessibility/best practices/SEO **1.0**.
## Image script
Images are resized with a one-off PowerShell script (not part of the project; .NET `System.Drawing`, Windows). Command used:
```powershell
1..4 | ForEach-Object {
& .\resize-image.ps1 -Source "design\andreaslop-static\assets\img\intro-$_.jpg" `
-Target "web\src\assets\home\intro-$_.jpg" -Width 800 -Quality 80
}
```
```powershell
param(
[Parameter(Mandatory)] [string] $Source,
[Parameter(Mandatory)] [string] $Target,
[Parameter(Mandatory)] [int] $Width,
[int] $Quality = 80
)
Add-Type -AssemblyName System.Drawing
$image = [System.Drawing.Image]::FromFile((Resolve-Path $Source))
try {
$height = [int][Math]::Round($image.Height * $Width / $image.Width)
$bitmap = New-Object System.Drawing.Bitmap $Width, $height
try {
$graphics = [System.Drawing.Graphics]::FromImage($bitmap)
$graphics.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
$graphics.PixelOffsetMode = [System.Drawing.Drawing2D.PixelOffsetMode]::HighQuality
$graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality
$graphics.DrawImage($image, 0, 0, $Width, $height)
$graphics.Dispose()
$codec = [System.Drawing.Imaging.ImageCodecInfo]::GetImageEncoders() | Where-Object MimeType -eq 'image/jpeg'
$params = New-Object System.Drawing.Imaging.EncoderParameters 1
$params.Param[0] = New-Object System.Drawing.Imaging.EncoderParameter ([System.Drawing.Imaging.Encoder]::Quality), ([long]$Quality)
$bitmap.Save($Target, $codec, $params)
}
finally { $bitmap.Dispose() }
}
finally { $image.Dispose() }
```
Results: intro-1 92 KB, intro-2 141 KB, intro-3 137 KB, intro-4 110 KB.
## Verification (`pnpm check`)
- Lint ✅, Prettier ✅ (after reformatting CRLF line endings introduced by an edit script)
- Tests: 30 files, **138 passed** (incl. existing property-based tests; coverage thresholds met)
- Build ✅ (`tsc` + Vite) — after rewriting constructor parameter properties in a test (`erasableSyntaxOnly`)
- `audit:deps` ✅ no known vulnerabilities; `audit:dev` 8 findings in dev tooling (report-only, unchanged from master)
- Lighthouse home: mobile performance **0.85** (LCP 3.8 s, equal to master), desktop **1.0**; accessibility, best practices and SEO **1.0** on all 7 URLs
- Note: a leftover `vite preview` on port 4173 from an earlier session blocked the first Lighthouse run; it was stopped.
## Extension compliance
- **Security Baseline**: SECURITY-10 compliant (no new dependencies); SECURITY-13 compliant (no external resources); SECURITY-04 compliant (headers unchanged); other rules N/A (no input, server, data store or auth in this unit).
- **PBT**: PBT-01 N/A — no business logic, data transformation or algorithm in this unit; PBT-10 compliant (example-based tests for every component and hook); PBT-08/09 unchanged.
@@ -0,0 +1,37 @@
# Code Summary — Unit 2: Over mij
Plan: [over-mij-code-generation-plan.md](../../plans/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:dev` report-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.
@@ -0,0 +1,65 @@
# Code Generation Plan — Unit 5: Contact
**This plan is the single source of truth for Code Generation of unit 5.**
## Unit context
- **Requirements**: FR-HP-06, FR-HP-07, FR-HP-08, FR-HP-09, NFR-HP-01/02/03/04/05/06
- **Functional design**: [contact/functional-design/](../contact/functional-design/) — BR-FORM-01…13, BR-SEND-01…04, BR-SPAM-01…03, BR-GATE-01…03, BR-MAIL-01, BR-PARAM-02/04, BR-FOCUS-01
- **Depends on**: unit 1 (`HomeSection`, `SectionHeading`, `Reveal`), unit 3 (`packages`, `visiblePackages`, `packageFromSearch`, `pakket` search), existing `emailAddress`, `linkButton` and `link` recipes
- **PBT**: full — all pure helpers plus a stateful test of the form reducer (PBT-06)
- Conventions as in units 1–4.
## Steps
### Types and content
- [x] **Step 1** — `src/contact/types.ts`: `ContactField`, `ContactValues`, `ContactErrors`, `ContactPayload`, `ShootOption`, `CONTACT_LIMITS` (naam 100, email 254, bericht 2000). `content/types.ts`: `HomeContent.contact { title; lead }`, `SiteContent.contactForm { enabled }`. Content: `homeContent.contact`, `siteContent.contactForm = { enabled: false }`.
### Pure helpers (`src/lib/`, each with example and property tests)
- [x] **Step 2** — `shootOptions.ts`: shown packages (`visiblePackages`) + Overig.
- [x] **Step 3** — `validateContact.ts`: `validateField` and `validateContact` with the exact messages of BR-FORM-01…07.
- [x] **Step 4** — `toContactPayload.ts`: trimmed payload.
- [x] **Step 5** — `isLikelySpam.ts`: honeypot or under `MIN_FILL_MS = 3000`.
- [x] **Step 6** — `mailLink.ts`: `mailSubject(packageName?)`, `mailtoLink(address, subject)`.
- [x] **Step 7** — `contactFormReducer.ts`: state `{ status, values, touched, errors }`, events `edit`, `blur`, `preselect`, `submit`, `resolved`, `rejected` (BR-FORM-10…12, BR-SEND-01…04, BR-SPAM-02). Stateful property test with random event sequences checking the invariants of business-logic-model.md.
- [x] **Step 8** — `test/arbitraries.ts`: `contactValues` (valid), `anyContactValues`, `contactEvent`.
### Adapter
- [x] **Step 9** — `src/contact/submitContactForm.ts` (+ test): `async (payload) => { throw new Error(...) }` today, with a comment pointing to `POST /api/contact` and the captcha token; generic, no details shown to visitors.
### Styling
- [x] **Step 10** — `recipes/formControl.ts`: the design's square fields (white, `line` border, 0.95 × 1.1 rem padding, weight 300, `accent` border + soft ring on focus, error border with sufficient contrast), applied to `Input`, `Textarea` and `NativeSelect.Field`; register in `theme.ts`. Add a `panel` shadow token (design `--shadow-md`) for the notice; error colour token if needed (≥ 4.5:1 on paper).
### Components
- [x] **Step 11** — `components/ContactForm/ContactForm.tsx`: reducer, `shownAt`, Chakra `Field` per field (labels in the eyebrow style, `ink.soft`), name + e-mail side by side from `sm`, select with placeholder, textarea, honeypot, empty `data-robot-check` slot, failure status (`role="alert"`, mail link), submit button (accent `linkButton` style, "Versturen…" while sending), thank-you replacing the form (`role="status"`, focused); `preselect` prop applied on change of its key; injectable `submit`.
- [x] **Step 12** — `components/ContactForm/ContactFormGate.tsx`: off → dimmed, `inert` wrapper + notice (eyebrow, text with underline mail link, "Stuur een e-mail" button), text only when the address is invalid; on → children.
- [x] **Step 13** — `components/home/ContactSection/ContactSection.tsx`: `HomeSection id="contact" width="narrow"`, heading (`tabIndex={-1}`) and lead, gate + form; resolves `pakket`, preselects, removes it from the URL (`navigate` replace, keep `#contact`, no scroll reset) and focuses the heading (BR-PARAM-02, BR-FOCUS-01).
- [x] **Step 14** — Tests: `ContactForm.test.tsx` (labels; blur shows errors only after typing; messages per rule; submit focuses first invalid; errors clear while typing; spam → thank-you, `submit` not called; success → thank-you focused; failure → alert with mail link, values kept; double submit ignored; preselect; axe), `ContactFormGate.test.tsx` (inert form, notice, mailto with subject, invalid address → text only, enabled → form only, axe both), `ContactSection.test.tsx` (preselect from `pakket`, URL cleaned with replace, heading focused, unknown value ignored and cleaned, no focus move without `pakket`).
### Route
- [x] **Step 15** — `routes/index.tsx`: render `ContactSection` after `Testimonials` with `homeContent.contact`, `packages`, `siteContent.contactForm.enabled`, `siteContent.email` and `pakket` from `Route.useSearch()`.
- [x] **Step 16** — `app.test.tsx`: "Contact" in the page order; `/?pakket=newborn` → shoot "Newborn" selected, URL without `pakket`, focus on the Contact heading.
### Verification and wrap-up
- [x] **Step 17** — `pnpm check`; Lighthouse home mobile compared with a 5-run median against the unit 4 build. **If the form code costs measurable performance** (as the carousel did), load the form (not the heading and notice) when the section comes near the screen, as in unit 4. Visual check at 1440 / 390 (gate on), and with the gate switched on locally for one screenshot of the working form.
- [x] **Step 18** — `construction/contact/code/code-summary.md`.
- [x] **Step 19** — Commit ("Adds the Contact section to the homepage" + attribution). Not pushed.
### Fixes during Step 17
- [x] **Step 17a** — Lighthouse median 0.83 → 0.80: the form moved to its own chunk, loaded when the section is within 200 px of the screen or at once via "Boek …", and stays once loaded; placeholder of the measured height.
- [x] **Step 17b** — Remaining 0.81: a new shared chunk (Chakra's slot-recipe factory) was fetched by the route on load. PriceCard's `List` and TestimonialSlide's `Blockquote` replaced by plain elements with the same styling; median back to 0.83.
## Requirement / rule traceability
| Item | Steps |
|---|---|
| FR-HP-06 / BR-FORM-* | 1–3, 7, 10, 11, 14 |
| FR-HP-07 / BR-GATE-* | 1, 12, 14 |
| FR-HP-08 / BR-SPAM-* | 5, 7, 11, 14 |
| FR-HP-09 | 11 (slot) |
| BR-SEND-* | 4, 7, 9, 11, 14 |
| BR-MAIL-01 | 6, 11, 12, 14 |
| BR-PARAM-02/04, BR-FOCUS-01 | 13, 14, 16 |
| NFR-HP-05 | 17 |
## Extension compliance (planned)
- **Security**: client-side limits/format checks (server-side in the API feature, SECURITY-05); misuse covered by gate + honeypot + time check (SECURITY-11); generic failure text (SECURITY-15); e-mail never literal in HTML or bundle; no new dependencies or external resources; CSP unchanged.
- **PBT**: PBT-02 (mailto round-trip), PBT-03 (validation invariants), PBT-04 (payload idempotency), PBT-05 (spam and e-mail oracles), PBT-06 (reducer state machine), PBT-07 (generators), PBT-08/09 (existing), PBT-10 (example tests).
@@ -0,0 +1,20 @@
# Functional Design — Vervolgvragen Unit 5: Contact
## Ontbrekend antwoord: Vraag 6 — Versturen mislukt (straks, met de API)
Vraag 6 in [contact-fd-questions.md](contact-fd-questions.md) is nog niet beantwoord.
- A) Een melding boven de knop: "Versturen lukte niet. Probeer het later nog eens of mail naar info@andreaslop.nl", met het adres als mailto-link. Wat de bezoeker typte blijft staan. (aanbevolen)
- B) Alleen "Versturen lukte niet. Probeer het later nog eens."
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Onduidelijkheid: melding "te lang" bij Vraag 2
Je gaf voor "te lang": "Het bericht is te lang". Er gelden ook grenzen voor naam (100 tekens) en e-mail (254 tekens).
Let op: de velden krijgen ook een maximum in de browser, zodat je er niet meer in kunt typen of plakken. De melding is dus vooral een vangnet en zal een bezoeker zelden zien.
- A) Per veld een eigen melding: "De naam is te lang.", "Het e-mailadres is te lang.", "Het bericht is te lang." (aanbevolen)
- B) Overal dezelfde melding: "Het bericht is te lang"
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
@@ -0,0 +1,63 @@
# Functional Design Questions — Unit 5: Contact
Vul per vraag de letter in na `[Answer]:` (of geef ze in de chat, bijv. "1A, 2A, …"). Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**.
Zolang het formulier achter de overlay zit, merkt een bezoeker van vraag 1–3 nog niets; ze bepalen hoe het werkt zodra je het aanzet (of als je het op test even aanzet om te proberen).
## Vraag 1: Wanneer verschijnen foutmeldingen?
- A) Pas bij versturen. Daarna wordt per veld opnieuw gecontroleerd zodra de bezoeker het aanpast, zodat een melding verdwijnt zodra het goed is. Niemand krijgt een fout tijdens het typen van een eerste poging. (aanbevolen)
- B) Bij het verlaten van elk veld (tab of klik ergens anders), en bij versturen
- C) Alleen bij versturen; meldingen blijven staan tot de volgende poging
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B
## Vraag 2: Foutmeldingen
Voorstel (uit het ontwerp, aangevuld):
- Naam leeg: "Vul je naam in."
- E-mail leeg: "Vul je e-mailadres in." · ongeldig: "Dit e-mailadres klopt nog niet."
- Shoot niet gekozen: "Kies een soort shoot."
- Bericht leeg: "Schrijf hier je vraag."
- Te lang (naam 100, e-mail 254, bericht 2000 tekens): "Dit is te lang (maximaal N tekens)."
- A) Zo overnemen (aanbevolen)
- X) Anders (pas hieronder aan na de [Answer]:-tag)
[Answer]: X — E-mail ongeldig: "Dit e-mailadres is ongeldig." Te lang: "Het bericht is te lang"
## Vraag 3: Na succesvol versturen
- A) Het formulier verdwijnt en er komt een bevestiging voor in de plaats: "Bedankt voor je bericht! Andrea reageert binnen 2-3 werkdagen." De focus gaat naar die bevestiging, zodat ook een schermlezer hem hoort. (aanbevolen)
- B) Het formulier blijft staan en wordt leeggemaakt; de bevestiging staat eronder
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
Klopt "binnen 2-3 werkdagen"? Pas het anders aan bij je antwoord.
[Answer]: A, maar het bericht is: "Bedankt voor je bericht! Ik reageer binnen 1-2 werkdagen."
## Vraag 4: De mailknop in de overlay
- A) De mail krijgt alvast een onderwerp: "Vraag via andreaslop.nl", en als de bezoeker via "Boek …" kwam het pakket erbij: "Aanvraag fotoshoot: Newborn". Scheelt de bezoeker typen en Andrea ziet meteen waar het over gaat. (aanbevolen)
- B) Een gewone mailto zonder onderwerp
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 5: Waar komt de focus na "Boek …"?
Na een klik op "Boek Newborn" scrollt de pagina naar Contact. De toetsenbordfocus staat dan nog op de knop bij Prijzen, buiten beeld: wie daarna op Tab drukt, springt terug omhoog.
- A) De focus gaat naar de kop "Contact" (onzichtbaar, zonder focusring). Toetsenbord- en schermlezergebruikers zitten dan op de juiste plek; de volgende Tab gaat naar het formulier, of nu naar de mailknop. (aanbevolen)
- B) De focus gaat direct naar het keuzeveld "In welke shoot …" (of nu naar de mailknop)
- C) Niets aan doen
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 6: Versturen mislukt (straks, met de API)
- A) Een melding boven de knop: "Versturen lukte niet. Probeer het later nog eens of mail naar info@andreaslop.nl", met het adres als mailto-link. Wat de bezoeker typte blijft staan. (aanbevolen)
- B) Alleen "Versturen lukte niet. Probeer het later nog eens."
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A (via contact-fd-clarification-questions.md)
@@ -0,0 +1,12 @@
# Functional Design Plan — Unit 5: Contact
Scope: FR-HP-06 (form), FR-HP-07 (coming-soon gate), FR-HP-08 (anti-spam, browser side), FR-HP-09 (robot-check slot), and BR-PARAM-02…04 from unit 3 (applying and removing `?pakket=`). Questions: [contact-fd-questions.md](contact-fd-questions.md).
Already fixed by requirements and earlier design (no question): fields Naam, E-mail, "In welke shoot heb je interesse?" (package names + Overig), "Stel hier je vraag"; button "(Aan)vraag versturen"; gate on by default via `siteContent.contactForm.enabled = false`, form dimmed and `inert`, notice "Het contactformulier komt binnenkort. Mail me voor nu op info@andreaslop.nl" with a mail button; address assembled in the browser; honeypot + ±3 s time check, spam gets the normal success and nothing is sent; `submitContactForm` adapter (rejects generically today); Friendly Captcha later; last "Boek" click wins; `?pakket=` removed from the URL once applied.
- [x] 1. Collect and analyze answers (follow-up questions if needed)
- [x] 2. `domain-entities.md` — `ContactValues`, `ContactPayload`, `ContactErrors`, `ShootOption`, field limits, `siteContent.contactForm`
- [x] 3. `business-rules.md` — validation rules and messages, when errors appear and disappear, spam rules, submit states (idle, sending, sent, failed), gate on/off, mail link, preselection and URL clean-up, focus after "Boek"; decision flowcharts
- [x] 4. `business-logic-model.md` — submit sequence, the form state machine, pure functions (`shootOptions`, `validateContact`, `toContactPayload`, `isLikelySpam`, `mailtoLink`), PBT-01 properties incl. a stateful check of the form states (PBT-06)
- [x] 5. `frontend-components.md` — `ContactSection`, `ContactFormGate`, `ContactForm`; props, states, layout, accessibility
- [x] 6. Validate against FR-HP-06…09, BR-PARAM-02…04, NFR-HP-01/03/04 and the Security/PBT extensions
@@ -0,0 +1,58 @@
# Code Generation Plan — Unit 6: Instagram
**This plan is the single source of truth for Code Generation of unit 6.**
## Unit context
- **Requirements**: FR-HP-10, FR-HP-11 (reveal, reused), FR-HP-12, NFR-HP-01/02/03/05/06; security NFR on external links
- **Design**: [unit-of-work.md](../../inception/application-design/unit-of-work.md) unit 6; [component-methods.md](../../inception/application-design/component-methods.md) (`HomeContent.instagram`, `InstagramGrid` props); design reference `design/andreaslop-static/index.html` (Instagram section: `.section--tight`, centred `.section__head`, handle as `.lead` with `.link-underline`) and `style.css` §17 (`.instagram__grid`, `.instagram__tile`) plus the 1100px (3 columns) and 680px (2 columns) breakpoints
- **Depends on**: unit 1 (`HomeSection` incl. `spacing="tight"`, `SectionHeading`, `Reveal`, `DeferredImage`), unit 2 (`underline` link variant), the existing `visibleSocials` helper (BR-SOC-01) and the footer's external-link pattern
- **Functional Design**: skipped (presentational). **PBT-01**: N/A, no new business logic; picking the Instagram link reuses `visibleSocials`, which already has tests. Example-based tests (PBT-10).
- Conventions as in the earlier units: English comments and test names, Dutch visitor text, `data-testid`, theme tokens, deferred images.
## Decisions taken in this plan
- **Full-bleed grid**: in the design the tile grid sits outside `.container` and runs from edge to edge, while the heading stays in the content column. `HomeSection` gets a `width="full"` option (no `Container`), and `InstagramGrid` puts its heading in its own `Container`.
- **Images, no new files**: the six tiles reuse photos that the homepage already bundles and loads (`intro-1` to `intro-4`, `review-newbornshoot`, `review-trouwshoot`). The browser fetches them only once, so the section adds no image bytes. They show as squares (`object-fit: cover`). Andrea can replace them later, and the API feature replaces them with the real feed.
- **Accessible names**: each tile is a link to the profile. Its name is the photo's alt text plus a hidden "(Instagram, opent in nieuw tabblad)". Six links with the same name "Instagramfoto", as in the design, would tell a screen reader user nothing.
- **Hidden without a valid link**: the route picks the Instagram entry from `visibleSocials(siteContent.socials)`. Without one, the section is not rendered at all, because the handle and every tile would have nowhere to link to.
- **Hover**: as in the design, the photo scales to 1.06 and drops to 85% opacity on hover and on keyboard focus. Under reduced motion it changes opacity only, without scaling. Focus gets the theme's visible focus ring.
## Steps
### Content
- [x] **Step 1** — `content/types.ts`: extend `HomeContent` with `instagram: { title: string; handle: string; photos: ContentImage[] }`.
- [x] **Step 2** — `content/homeContent.ts`: title "Instagram", handle "@andreaslopfotografie", the six reused photos with their existing alt texts (shared constants where the intro gallery already defines them, so the texts do not drift apart).
### Shared pieces
- [x] **Step 3** — `HomeSection`: `width` gains `'full'` (children rendered without `Container`). Test for the full-width variant.
### The section
- [x] **Step 4** — `components/home/InstagramGrid/InstagramGrid.tsx`: `HomeSection` with `spacing="tight"`, `width="full"`; a `Container` with a `Reveal` around the centred `SectionHeading` (h2 "Instagram") and below it the handle as a `lead`-sized external link (`underline` variant, `target="_blank"`, `rel="noopener noreferrer"`, hidden "(opent in nieuw tabblad)"), `data-testid="instagram-handle-link"`. Below it a `Reveal` with the grid: plain `ul`/`li` (a list of six), 2 columns, 3 from `md`, 6 from `xl` (the design's 680/1100px steps mapped onto the theme breakpoints), 2px gap; each tile is an external link (`data-testid="instagram-tile-{n}"`) with a square `DeferredImage` on a `paper.deep` background, hover and focus as decided above.
- [x] **Step 5** — `components/home/InstagramGrid/InstagramGrid.test.tsx`: region named by the h2; handle link with href, `target`, `rel` and the hidden hint; six tiles, each linking to the profile with `target`/`rel` and a name made of the alt text plus the hint; zero photos still renders heading and handle; axe clean.
- [x] **Step 6** — `routes/index.tsx`: find the Instagram link in `visibleSocials(siteContent.socials)` and render `InstagramGrid` after `ContactSection` only when it exists.
- [x] **Step 7** — `app.test.tsx`: add "Instagram" (named by its h2) as the last section in the page-order check; a test that the section is absent when there is no valid Instagram link (mocked `siteContent`, as the earlier unit tests do for the contact form).
### Verification and wrap-up
- [x] **Step 8** — `pnpm check` (incl. Lighthouse); fix and rerun until green. Visual check at desktop width (6 columns, full-bleed), at 1024px (3 columns) and at an emulated 390px phone (2 columns); confirm in the network panel that no extra image requests appear.
- [x] **Step 9** — `LAYOUT.md`: check the homepage diagram against the finished section order (following `.ai/layout-conventions.md`), update it only if it differs.
- [x] **Step 10** — `construction/instagram/code/code-summary.md`.
- [x] **Step 11** — Commit on `feature/homepage-sections` ("Adds the Instagram section to the homepage" + attribution), together with the typography changes from the unit 5 review in a separate commit before it. Not pushed unless the owner asks.
## Requirement traceability
| Requirement | Steps |
|---|---|
| FR-HP-10 | 1, 2, 4–7 |
| FR-HP-11 | 4 |
| FR-HP-12 | 2 |
| NFR-HP-01 (accessibility) | 4, 5, 8 |
| NFR-HP-02 (design fidelity) | 3, 4, 8 |
| NFR-HP-03 (tests) | 3, 5, 7, 8 |
| NFR-HP-05 (performance) | 2, 4, 8 |
| NFR-HP-06 (API-ready content) | 1, 2 |
| External links (security NFR) | 4–6 |
## Extension compliance (planned)
- **Security**: no new dependencies or external resources (no embed, no third-party script, no request to Instagram); external links use `noopener noreferrer`; only `https:` links are rendered (BR-SOC-01 via `visibleSocials`). Other rules N/A.
- **PBT**: PBT-01 N/A (no new logic); PBT-10 example-based tests present.
### Note on Step 8
- Everything except the Lighthouse performance gate is green. The homepage mobile score scattered between 0.68 and 0.84 for both the unit 5 build and this build in back-to-back runs (machine under load), so the gate was rerun on a quiet machine: passed (home mobile 0.81, desktop 1.0).
@@ -0,0 +1,64 @@
# Code Generation Plan — Unit 4: Lieve woorden
**This plan is the single source of truth for Code Generation of unit 4.**
## Unit context
- **Requirements**: FR-HP-05, FR-HP-11, FR-HP-12, NFR-HP-01/02/03/05/06
- **Functional design**: [lieve-woorden/functional-design/](../lieve-woorden/functional-design/) — BR-REV-01…11
- **Depends on**: unit 1 (`HomeSection`, `SectionHeading`, `Reveal`, `DeferredImage`), unit 2 (`FramedImage`)
- **PBT**: full — `visibleTestimonials`, `slideLabel`; PBT-06 N/A (carousel state machine is Chakra's/Zag's).
- Conventions as in units 1–3.
## Findings that shape the plan (from the installed `@zag-js/carousel` 1.43.3)
1. **Reduced motion**: the built-in triggers, indicators and arrow keys call `scrollTo({ behavior: 'smooth' })` from JavaScript; CSS `scroll-behavior` cannot override that. The API does accept an `instant` flag (`scrollPrev(instant)`, `scrollNext(instant)`, `scrollTo(page, instant)`). → We keep Chakra's carousel for state, snapping, looping, swiping, slide semantics and hidden off-screen slides, but render **our own** previous/next buttons and dots (and arrow-key handling on the controls) that pass `instant = prefersReducedMotion` (BR-REV-06).
2. **Double announcement**: the item group already carries `aria-live="polite"`. → We set it to `off` and keep one own polite live region with "Review n van m" (BR-REV-08).
3. **Labels**: Zag's default translations are English. → `translations.item = slideLabel` so slides are "Review n van m" (BR-REV-09).
## Steps
### Images and content
- [x] **Step 1** — Extend the one-off resize script with a centre crop to a target aspect ratio. Prepare the two live photos, cropped to **4:5** from the centre and resized to **880×1100**, quality 80: `IMG_2497-5.jpg` → `web/src/assets/home/review-trouwshoot.jpg`, `5-F41A4650-scaled.jpg` → `web/src/assets/home/review-newbornshoot.jpg`. Record the script change in the summary.
- [x] **Step 2** — `content/types.ts`: `Testimonial { id; shoot; quote; author; image: ContentImage }`; `HomeContent.testimonials { title }`.
- [x] **Step 3** — `content/testimonials.ts` with the two live reviews (full texts from FR-HP-05, alt texts from domain-entities.md); `homeContent.testimonials.title = 'Lieve woorden'`.
### Pure helpers
- [x] **Step 4** — `lib/visibleTestimonials.ts` (+ test): invariants filter, first-wins de-duplication. Properties: valid + unique; subsequence; idempotent; oracle.
- [x] **Step 5** — `lib/slideLabel.ts` (+ test): `slideLabel(index, count)` → `Review ${index + 1} van ${count}`. Properties: numbers round-trip; form and range invariant.
- [x] **Step 6** — `test/arbitraries.ts`: `testimonial`, `uniqueTestimonials`, `anyTestimonial`.
### Components
- [x] **Step 7** — `components/home/Testimonials/TestimonialSlide.tsx`: grid `5fr 7fr` from `lg` (stacked below, photo max 420 px), `FramedImage` 4/5, decorative quotation mark (`aria-hidden`), shoot as eyebrow (`accent.deep`), `figure` > `Blockquote` > `figcaption` "— author"; `data-testid="testimonial-<id>"`.
- [x] **Step 8** — `components/home/Testimonials/Testimonials.tsx`: `visibleTestimonials`; none → `null`; one → `TestimonialSlide` without carousel; two or more → `useCarousel({ slideCount, loop: true, allowMouseDrag: true, translations })` + `Carousel.RootProvider` (`aria-label="Reviews"`, `aria-roledescription="carrousel"`), `Carousel.ItemGroup` with `aria-live="off"` and stretched items (equal height, BR-REV-07), one `Carousel.Item` per review; own controls: "Vorige review" / "Volgende review" buttons (Ant Design left/right outlined icons, offline), one dot per review (`aria-label="Review n"`, `aria-current` on the current one, 44 px hit area), arrow keys on the control bar; every control calls the API with `instant = reducedMotion`; `onPageChange` sets the polite `VisuallyHidden` live region to `slideLabel`. `HomeSection tone="alt"`, centred heading.
- [x] **Step 9** — Tests: `TestimonialSlide.test.tsx` (photo alt, shoot, quote in a blockquote, author caption, quotation mark hidden, axe) and `Testimonials.test.tsx` (region "Lieve woorden"; two slides labelled "Review 1 van 2" / "Review 2 van 2"; buttons and dots named in Dutch; next from the last review goes to the first (loop) and is announced; a dot jumps to its review and marks itself current; arrow keys move; with reduced motion the API is called with `instant`; one review → no controls; none → no section; invalid reviews skipped; live region empty on load; axe clean).
### Route
- [x] **Step 10** — `routes/index.tsx`: render `Testimonials` after `Pricing` with `homeContent.testimonials` and `testimonials`.
- [x] **Step 11** — `app.test.tsx`: "Lieve woorden" in the page-order check.
### Verification and wrap-up
- [x] **Step 12** — `pnpm check` (incl. Lighthouse); visual check at 1440, 390 (CDP), including a swipe/next to the second review.
- [x] **Step 13** — `construction/lieve-woorden/code/code-summary.md`.
- [x] **Step 14** — Commit (including the pending audit/state updates) — "Adds the Lieve woorden section to the homepage" + attribution. Not pushed.
### Fixes during Step 12
- [x] **Step 12a** — Real-browser check showed the next slide's sand block over the quote and the own block clipped: 4 rem `spacing` between slides, 1.5 rem padding left/bottom per slide (from `sm`).
- [x] **Step 12b** — Home mobile Lighthouse median 0.83 → 0.81 with the carousel in the route chunk. `React.lazy` alone did not help; the carousel moved to `TestimonialCarousel.tsx` and loads only when the section is within 200 px of the screen (heading always rendered, placeholder of the measured height). Median back to 0.83.
## Requirement / rule traceability
| Item | Steps |
|---|---|
| FR-HP-05 | 2, 3, 7–11 |
| BR-REV-01 | 4, 8, 9 |
| BR-REV-02 | 8, 9 |
| BR-REV-03/04/05 | 8, 9 |
| BR-REV-06 | 8, 9 (finding 1) |
| BR-REV-07 | 8, 12 |
| BR-REV-08 | 5, 8, 9 (finding 2) |
| BR-REV-09 | 5, 8, 9 (finding 3) |
| BR-REV-10 | 8 (Zag sets `aria-hidden` on off-screen slides), 9 |
| BR-REV-11 | 7, 9 |
| NFR-HP-05 | 1, 7 (deferred image), 12 |
## Extension compliance (planned)
- **Security**: content rendered as text; no new dependencies (Chakra Carousel and Ant Design icons already installed); no external resources.
- **PBT**: PBT-02 (slideLabel round-trip), PBT-03 (invariants), PBT-04 (idempotency), PBT-05 (oracle), PBT-07 (generators), PBT-08/09 (existing), PBT-10 (example tests); PBT-06 N/A.
@@ -0,0 +1,31 @@
# Functional Design Questions — Unit 4: Lieve woorden
Vul per vraag de letter in na `[Answer]:` (of geef ze in de chat, bijv. "1A, 2A, 3A"). Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**.
## Vraag 1: Aan het einde van de reeks
Een bezoeker staat op de laatste review en klikt op "volgende".
- A) Hij gaat rond naar de eerste review. Met maar een paar reviews voelt dat natuurlijk, en de knoppen werken altijd. (aanbevolen)
- B) Het stopt: op de laatste review is "volgende" uitgeschakeld, op de eerste "vorige"
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 2: Hoe wisselt een review?
- A) **Schuiven**: de reviews liggen naast elkaar en schuiven opzij; bij vegen op een telefoon volgt de review je vinger. Zo werkt Chakra's Carousel uit zichzelf, en het sluit aan bij het vegen in de galerij. (aanbevolen)
- B) **Overvloeien**: de oude review vervaagt en de nieuwe verschijnt, zoals in het statische ontwerp. Vegen werkt dan als "volgende/vorige", zonder dat de review je vinger volgt.
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
Bij "minder beweging" (systeeminstelling) wisselt de review in beide gevallen direct, zonder animatie.
[Answer]: A
## Vraag 3: Verschillende lengtes
De trouwshoot-review is ongeveer twee keer zo lang als de newbornshoot-review.
- A) Alle reviews krijgen de hoogte van de langste. Bij het wisselen springt de rest van de pagina (Contact eronder) dan niet op en neer. (aanbevolen)
- B) De hoogte past zich per review aan; minder witruimte bij korte reviews, maar de pagina eronder verschuift bij elke wissel
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
@@ -0,0 +1,10 @@
# Functional Design Plan — Unit 4: Lieve woorden
Scope: FR-HP-05 — one review at a time with photo, quotation mark, shoot label, quote and names; previous/next and dots; no autoplay; announcements; Chakra `Carousel`. Questions: [lieve-woorden-fd-questions.md](lieve-woorden-fd-questions.md).
- [x] 1. Collect and analyze answers (follow-up questions if needed)
- [x] 2. `domain-entities.md` — `Testimonial`, its invariants, initial data, relation to `ContentImage`
- [x] 3. `business-rules.md` — which reviews are shown, 0 / 1 / many reviews, navigation at the ends, transitions and reduced motion, height of the slides, announcements, accessible names; decision flowchart
- [x] 4. `business-logic-model.md` — navigation flow (buttons, dots, keyboard, swipe), pure functions (`visibleTestimonials`, `slideLabel`), PBT-01 properties
- [x] 5. `frontend-components.md` — `Testimonials` (Chakra Carousel parts), `TestimonialSlide`; props, states, responsive layout, accessibility
- [x] 6. Validate against FR-HP-05, NFR-HP-01/02/03/05/06 and the Security/PBT extensions
@@ -0,0 +1,83 @@
# Code Generation Plan — Unit 1: Lifestyle fotografie
**This plan is the single source of truth for Code Generation of unit 1.**
## Unit context
- **Requirements**: FR-HP-02 (section), FR-HP-11 (scroll reveal, introduced), FR-HP-12 (content + images), NFR-HP-01/02/03/05/06
- **Design**: [unit-of-work.md](../../inception/application-design/unit-of-work.md) unit 1; [components.md](../../inception/application-design/components.md); [component-methods.md](../../inception/application-design/component-methods.md)
- **Design reference**: `design/andreaslop-static/index.html` (`.section`, `.section__head--center`, `.lead`, `.intro-gallery`) and `assets/css/style.css` §4, §11, §19
- **Depends on**: nothing (first unit); introduces the shared blocks every later unit uses
- **Functional Design**: skipped (presentational). **PBT-01**: no business logic, data transformation or algorithm in this unit → no property-based tests; this is recorded as N/A, not skipped silently. Example-based tests cover the components and hook (PBT-10).
- **Workspace**: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie`, code in `web/`
## Conventions for this unit
- Code comments in English; visitor-facing text (headings, alt texts) in Dutch. **Test names in English** too, since they are code, not visitor-facing (existing tests stay Dutch).
- `data-testid` on the section and its gallery (`intro-gallery`, `intro-gallery-photo-{n}`).
- Styling via theme tokens/text styles and Chakra primitives; no CSS files, no hard-coded colours.
## Steps
### Branch and baseline
- [x] **Step 1** — Create branch `feature/homepage-sections` from `master`. First commit: the inception artifacts so far (`aidlc-docs/…/homepage-sections/`, refreshed `aidlc-docs/_shared/reverse-engineering/`, `active-features.md`) and the static design update (`design/andreaslop-static/`, `LAYOUT.md`, `.ai/layout-conventions.md`). Not pushed.
### Images
- [x] **Step 2** — Resize the four live gallery photos (`design/andreaslop-static/assets/img/intro-1…4.jpg`, 1067×1600) to **800×1200**, JPEG quality ~80, into `web/src/assets/home/intro-1.jpg … intro-4.jpg`. Tool: a one-off PowerShell script using .NET `System.Drawing` (already on Windows; not added to the project). The script and its parameters are recorded in the code summary so later units reuse them. Target ≤ ~150 KB per photo.
### Theme (shared)
- [x] **Step 3** — `web/src/theme.ts`: add tokens from the design that later units also need:
- spacing `sectionY` (`clamp(4.5rem, 9vw, 8.5rem)`), `sectionYTight` (60% of it), `gridGap` (`clamp(1rem, 2.2vw, 2rem)`), `sectionHeadGap` (`clamp(2.5rem, 5vw, 4.5rem)`)
- size `contentNarrow` (`820px`)
- text styles `sectionTitle` (Marcellus; 1.85 / 2.125 / 2.5rem, line-height 1.15) and `lead` (1.25rem, weight 300, line-height 1.6)
- duration `reveal` (`0.8s`)
- then run `pnpm typegen`
### Content
- [x] **Step 4** — `web/src/content/types.ts`: add `ContentImage` and `HomeContent` with the `intro` part only (`{ title, lead, photos: ContentImage[] }`); later units extend `HomeContent`.
- [x] **Step 5** — Create `web/src/content/homeContent.ts`: title "Lifestyle fotografie", lead "Jouw favoriete momenten, vastgelegd op een natuurlijke en ongedwongen manier.", four photos with width/height 800×1200 and alt texts:
1. "Babyhandje in de hand van de moeder, op een gebreid dekentje"
2. "Moeder drukt haar pasgeboren baby in een gebreid truitje tegen zich aan"
3. "Zwangere vrouw op blote voeten in het zand bij zonsondergang"
4. "Aanstaande vader omarmt zijn zwangere partner in de duinen"
### Shared blocks
- [x] **Step 6** — `web/src/hooks/useReveal.ts`: returns `{ ref, visible }`; visible immediately when `prefers-reduced-motion: reduce` or `IntersectionObserver` is missing; otherwise observes once (threshold 0.12, rootMargin `0px 0px -60px 0px`, as in the design) and disconnects on reveal and on unmount.
- [x] **Step 7** — `web/src/hooks/useReveal.test.tsx`: visible without IntersectionObserver (jsdom); visible under reduced motion; hidden until intersecting with a mocked observer, then visible, then unobserved; disconnect on unmount.
- [x] **Step 8** — `web/src/components/Reveal/Reveal.tsx`: wraps children in a `Box`; opacity 0 + translateY(24px) until visible, transition `reveal` duration with the `smooth` easing; optional `delay` (seconds) for staggering.
- [x] **Step 9** — `web/src/components/Reveal/Reveal.test.tsx`: children always in the DOM and accessible; visible state without observer.
- [x] **Step 10** — `web/src/components/SectionHeading/SectionHeading.tsx`: optional eyebrow (`eyebrow` text style, `accent.deep`), h2 with `id` (`sectionTitle` text style), optional lead (`lead` text style, `ink.soft`); `align` center (default, max width 620px, centred) or start; bottom margin `sectionHeadGap`.
- [x] **Step 11** — `web/src/components/SectionHeading/SectionHeading.test.tsx`: h2 with id, optional eyebrow/lead, axe clean.
- [x] **Step 12** — `web/src/components/HomeSection/HomeSection.tsx`: `<section aria-labelledby>` with `py="sectionY"` (or `sectionYTight`), `bg` `paper` or `paper.alt` (`tone`), inner `Container` (`content` or `contentNarrow` width), optional `id` and `data-testid`.
- [x] **Step 13** — `web/src/components/HomeSection/HomeSection.test.tsx`: region named by its heading, tone and width variants render, id passes through.
### The section
- [x] **Step 14** — `web/src/components/home/IntroGallery/IntroGallery.tsx`: `HomeSection` + `SectionHeading` (in `Reveal`) + grid of four `figure`s, each in a `Reveal` with a staggered delay; 4 columns from `lg`, 2 from `sm`, 1 below; 2nd and 4th photo offset downward from `sm` (design `margin-top`); image `aspectRatio 3/4`, `objectFit cover`, `loading="lazy"`, explicit width/height; slow hover zoom (1.05, `fade` duration), none under reduced motion.
- [x] **Step 15** — `web/src/components/home/IntroGallery/IntroGallery.test.tsx`: region "Lifestyle fotografie", h2 + lead, four images with their alt texts and lazy loading, works with any number of photos (0 shows only the heading), axe clean.
- [x] **Step 16** — `web/src/routes/index.tsx`: render `IntroGallery` with `homeContent.intro` after the Hero.
- [x] **Step 17** — `web/src/app.test.tsx`: the homepage shows the "Lifestyle fotografie" section after the hero, still exactly one h1, axe clean (extend the existing home checks).
### Verification and wrap-up
- [x] **Step 18** — Run `pnpm check` (lint, format, tests incl. coverage thresholds, build, audits, Lighthouse mobile + desktop). Fix and rerun until green.
- [x] **Step 19** — Write `aidlc-docs/features/homepage-sections/construction/lifestyle-fotografie/code/code-summary.md`: files created/modified, image script + parameters and resulting sizes, test results, Lighthouse scores, extension compliance.
- [x] **Step 20** — Commit unit 1 on `feature/homepage-sections` ("Adds the Lifestyle fotografie section to the homepage" + attribution). Not pushed.
### Fix during Step 18 (Step 13.5 self-check)
- [x] **Step 18a** — Lighthouse home mobile failed (0.78 < 0.8; LCP 3.8 s → 5.3 s). Root cause: Chrome fetches `loading="lazy"` images within ±1250 px of the viewport immediately, so the gallery photos right under the hero competed with the hero for bandwidth under Lighthouse's throttling. Fix: `hooks/useInView.ts` (shared observer logic; `useReveal` now builds on it), `hooks/usePageLoaded.ts`, `components/DeferredImage` (sets `src` only after the load event and when within 600 px of the viewport; width/height reserve the space), `test/fakeIntersectionObserver.ts` (shared test double); IntroGallery uses DeferredImage with a `paper.deep` placeholder. Result: mobile 0.85 (LCP 3.8 s, equal to master).
### Change request at review
- [x] **Step 21** — Phones: one photo at a time in a swipeable scroll-snap row with the next photo peeking in; keyboard-scrollable list; gallery-level loading via `DeferredImage near`; static design and FR-HP-02 updated; `pnpm check` green.
## Requirement traceability
| Requirement | Steps |
|---|---|
| FR-HP-02 | 5, 14–17 |
| FR-HP-11 | 6–9, 14 |
| FR-HP-12 | 2, 4, 5 |
| NFR-HP-01 | 10–15, 17, 18 (Lighthouse a11y) |
| NFR-HP-02 | 3, 8–14 |
| NFR-HP-03 | 7, 9, 11, 13, 15, 17, 18 |
| NFR-HP-05 | 2, 14, 18 |
| NFR-HP-06 | 4, 5 |
## Extension compliance (planned)
- **Security**: no new dependencies or external resources (SECURITY-10/13); no input handling; other rules N/A.
- **PBT**: PBT-01 N/A for this unit (no logic); PBT-08/09 unchanged; PBT-10 example-based tests present.
@@ -0,0 +1,56 @@
# Code Generation Plan — Unit 2: Over mij
**This plan is the single source of truth for Code Generation of unit 2.**
## Unit context
- **Requirements**: FR-HP-03, FR-HP-11 (reveal, reused), FR-HP-12, NFR-HP-01/02/03/05/06
- **Design**: [unit-of-work.md](../../inception/application-design/unit-of-work.md) unit 2; design reference `design/andreaslop-static/index.html` (`.about`, `.about__media`, `.about__body`, `.link-underline`) and `style.css` §5, §12
- **Depends on**: unit 1 (`HomeSection`, `SectionHeading`, `Reveal`, `DeferredImage`, `ContentImage`, `homeContent.ts`)
- **Introduces**: `FramedImage` (reused by unit 4), the `underline` link variant (reused by units 5 and 6)
- **Functional Design**: skipped (presentational). **PBT-01**: N/A — no business logic in this unit; example-based tests (PBT-10).
- Conventions as in unit 1 (English comments and test names, Dutch visitor text, `data-testid`, theme tokens, deferred images).
## Steps
### Image
- [x] **Step 1** — Resize the original live photo of Andrea (`WhatsApp-Image-2024-10-27-at-14.31.42.jpeg`, 1600×1067; the live site shows the 1024 px version) to **1200×800**, quality 80, into `web/src/assets/home/andrea.jpg`, with the resize script from unit 1.
### Content
- [x] **Step 2** — `content/types.ts`: extend `HomeContent` with `about: { eyebrow; title; paragraphs: string[]; image: ContentImage; link: { label; to: RoutePath } }` (`RoutePath` from `navigation.ts`, so a wrong route is a type error).
- [x] **Step 3** — `content/homeContent.ts`: eyebrow "Over mij", title "Lifestyle fotograaf met een passie voor storytelling", the three live paragraphs, the photo (alt "Andrea Slop met haar camera, glimlachend over haar schouder"), link "Lees mijn verhaal" → `/over-mij`.
### Shared pieces
- [x] **Step 4** — `recipes/link.ts`: add variant `underline` (design `.link-underline`): ink text, 1px underline in `currentColor` that slides in from the left on hover and focus, `interaction` duration, `smooth` easing, no motion under reduced motion. Used with `asChild` around `RouterLink`, like the footer menu.
- [x] **Step 5** — `SectionHeading`: optional `spacing: 'default' | 'compact'` (compact = `1.5rem` below, design `.about__body h2`), so the about text can use the same heading block left-aligned. Test for the compact variant.
- [x] **Step 6** — `components/FramedImage/FramedImage.tsx`: `DeferredImage` with a fixed `aspectRatio` on a `paper.deep` placeholder, plus the decorative sand block behind it (bottom-left, offset 1.5rem, 55% × 55%, `sand`), hidden below `sm`; the block is CSS only (`::before`), so it is never announced.
- [x] **Step 7** — `components/FramedImage/FramedImage.test.tsx`: image with alt and dimensions, lazy, axe clean.
### The section
- [x] **Step 8** — `components/home/AboutBlock/AboutBlock.tsx`: `HomeSection` with `tone="alt"`; grid 1 column, 2 equal columns from `lg`, gap `clamp(2rem, 6vw, 5.5rem)`, vertically centred; left `FramedImage` (aspect 4/3) in a `Reveal`; right in a `Reveal`: `SectionHeading` (eyebrow, h2, start-aligned, compact), the paragraphs (`ink.soft`), and the link with the `underline` variant.
- [x] **Step 9** — `components/home/AboutBlock/AboutBlock.test.tsx`: region named by the h2, eyebrow, three paragraphs, photo alt, link to `/over-mij`, axe clean.
- [x] **Step 10** — `routes/index.tsx`: render `AboutBlock` after `IntroGallery`.
- [x] **Step 11** — `app.test.tsx`: add the "Over mij" section (named by its h2) to the page-order check.
### Verification and wrap-up
- [x] **Step 12** — `pnpm check` (incl. Lighthouse); fix and rerun until green. Visual check at desktop width and at an emulated 390 px phone.
- [x] **Step 13** — `construction/over-mij/code/code-summary.md`.
- [x] **Step 14** — Commit on `feature/homepage-sections` ("Adds the Over mij section to the homepage" + attribution). Not pushed.
### Fix during Step 12
- [x] **Step 12a** — Lighthouse home mobile 0.77: deferred photos started before the observed LCP whenever they won a race (600 px margin reached the gallery right after the load event). Load margin lowered to 200 px and shared as `DEFERRED_LOAD_MARGIN` (DeferredImage + IntroGallery); no photo below the hero is requested on page open any more.
## Requirement traceability
| Requirement | Steps |
|---|---|
| FR-HP-03 | 2, 3, 6, 8–11 |
| FR-HP-11 | 8 |
| FR-HP-12 | 1–3 |
| NFR-HP-01 | 4, 6–9, 11, 12 |
| NFR-HP-02 | 4–8 |
| NFR-HP-03 | 5, 7, 9, 11, 12 |
| NFR-HP-05 | 1, 6, 12 |
| NFR-HP-06 | 2, 3 |
## Extension compliance (planned)
- **Security**: no new dependencies or external resources; internal link only; other rules N/A.
- **PBT**: PBT-01 N/A (no logic); PBT-10 example-based tests present.
@@ -0,0 +1,62 @@
# Code Generation Plan — Unit 3: Prijzen
**This plan is the single source of truth for Code Generation of unit 3.**
## Unit context
- **Requirements**: FR-HP-04, FR-HP-11, FR-HP-12, NFR-HP-01/02/03/04/05/06
- **Functional design**: [prijzen/functional-design/](../prijzen/functional-design/) — BR-PRICE-01…03, BR-BOOK-01…03, BR-PARAM-01 (BR-PARAM-02…04 are carried out in unit 5)
- **Depends on**: unit 1 (`HomeSection`, `SectionHeading`, `Reveal`, `DeferredImage`, `ContentImage`)
- **Introduces for unit 5**: `PricingPackage`, `content/packages.ts`, `visiblePackages`, `packageFromSearch`, `pakket` search on `/`
- **PBT**: full enforcement — properties from business-logic-model.md for all four helpers; generators per PBT-07.
- Conventions as in units 1–2.
## Steps
### Assets and content
- [x] **Step 1** — Copy `design/andreaslop-static/assets/img/deco-1.png` (143×112, 15 KB) and `deco-2.png` (239×224, 42 KB) unchanged to `web/src/assets/home/`.
- [x] **Step 2** — `content/types.ts`: `PricingPackage { id; name; price; features }`; `HomeContent.pricing { title; lead; decorations: ContentImage[] }`.
- [x] **Step 3** — `content/packages.ts`: the three live packages in live order (domain-entities.md). `content/homeContent.ts`: pricing title "Prijzen", lead "Pakketten", two decorations with `alt=""` and their sizes.
### Pure helpers (each with example-based and property-based tests)
- [x] **Step 4** — `lib/formatPrice.ts` (+ test): `Intl.NumberFormat('nl-NL', { style: 'currency', currency: 'EUR', maximumFractionDigits: 0 })`; ensures a non-breaking space after `€` (BR-PRICE-01). Properties: digit round-trip, prefix and no regular space.
- [x] **Step 5** — `lib/visiblePackages.ts` (+ test): invariants filter and first-wins de-duplication (BR-PRICE-02). Properties: every result valid, unique ids, subsequence, idempotent, oracle for valid unique input.
- [x] **Step 6** — `lib/bookLabel.ts` (+ test): `BOOK_LABEL_MAX_NAME = 14`; `{ visible: 'Boek <name>' }` or `{ visible: 'Boek je shoot', hidden: ': <name>' }` (BR-BOOK-02). Properties: name always in the full text; visible form exactly per the length rule.
- [x] **Step 7** — `lib/packageFromSearch.ts` (+ test): string only, trimmed, case-insensitive match → the package's id (BR-PARAM-01). Properties: result is undefined or a given id; any-case/whitespace oracle; non-strings undefined; idempotent.
- [x] **Step 8** — `test/arbitraries.ts`: `pricingPackage` (valid), `uniquePackages`, `anyPackage` (incl. invalid: empty name, price 0 / negative / fractional / NaN, bad id, duplicates).
### Styling
- [x] **Step 9** — `recipes/linkButton.ts`: new `size` variant `fit` — `white-space: nowrap`, horizontal padding 1.25 rem on phones and the design's 2.4 rem from `sm` (BR-BOOK-03); default size unchanged so the hero button stays as it is. Verify at an emulated 320 px phone that "Boek Zwangerschap" stays on one line inside the card.
### Components
- [x] **Step 10** — `components/home/Pricing/PriceCard.tsx`: `article` with h3, formatted price (`accent.deep`), feature list, `LinkButton` (`size="fit"`) to `/` with `search={{ pakket: id }}` and `hash="contact"`, label per `bookLabel` with `VisuallyHidden`; hover lift/border/shadow, none under reduced motion; `data-testid`s per frontend-components.md.
- [x] **Step 11** — `components/home/Pricing/Pricing.tsx`: `HomeSection` (plain), decorations (`DeferredImage`, `aria-hidden`, positioned behind content), `SectionHeading` with lead, grid of `PriceCard`s from `visiblePackages` (1 column max 460 px centred below `lg`, 3 from `lg`), staggered `Reveal`; renders nothing when no package is valid.
- [x] **Step 12** — `components/home/Pricing/Pricing.test.tsx` and `PriceCard.test.tsx`: region "Prijzen", three cards in order with h3, price `€ 175` etc., features as list items, link names "Boek Zwangerschap" / "Boek Newborn" / "Boek Gezin" with `href="/?pakket=<id>#contact"`, long name → "Boek je shoot" + hidden name, invalid packages skipped, empty list → no section, decorations hidden from assistive technology, axe clean.
### Route
- [x] **Step 13** — `routes/index.tsx`: `validateSearch` → `{ pakket?: string }` (string kept, everything else dropped); render `Pricing` after `AboutBlock` with `homeContent.pricing` and `packages`.
- [x] **Step 14** — `app.test.tsx`: "Prijzen" in the page-order check; `/?pakket=newborn` and `/?pakket=123` both render the homepage without errors.
### Verification and wrap-up
- [x] **Step 15** — `pnpm check` (coverage 100% for the new `lib/` files, Lighthouse); visual check desktop 1440 and phones 390 and 320.
- [x] **Step 16** — `construction/prijzen/code/code-summary.md`.
- [x] **Step 17** — Commit ("Adds the Prijzen section to the homepage" + attribution). Not pushed.
## Requirement / rule traceability
| Item | Steps |
|---|---|
| FR-HP-04 | 2, 3, 10–14 |
| BR-PRICE-01 | 4, 10 |
| BR-PRICE-02 | 5, 11 |
| BR-PRICE-03 | — (no note rendered) |
| BR-BOOK-01 | 10, 12 |
| BR-BOOK-02 | 6, 10, 12 |
| BR-BOOK-03 | 9, 15 |
| BR-PARAM-01 | 7, 13, 14 |
| NFR-HP-01 | 10–12, 15 |
| NFR-HP-03 / PBT | 4–8, 12, 14, 15 |
| NFR-HP-05 | 1, 11, 15 |
| NFR-HP-06 | 2, 3 |
## Extension compliance (planned)
- **Security**: `pakket` never reflected, only known ids come out (SECURITY-05 spirit for client input, SECURITY-11 misuse noted); no new dependencies or external resources.
- **PBT**: PBT-01 done in functional design; PBT-02 (round-trip formatPrice), PBT-03 (invariants), PBT-04 (idempotency), PBT-05 (oracles), PBT-07 (domain generators), PBT-08/09 (existing seed setup), PBT-10 (example tests alongside). PBT-06 N/A (no stateful component in this unit).
@@ -0,0 +1,50 @@
# Functional Design Questions — Unit 3: Prijzen
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**.
## Vraag 1: BTW bij de prijzen
Voor consumenten moeten prijzen in Nederland inclusief btw getoond worden. Op de live site staat er niets bij.
- A) De prijzen zijn inclusief btw; zet er een korte regel onder de kaarten: "Alle prijzen zijn inclusief btw." (aanbevolen, als Andrea btw rekent)
- B) De prijzen zijn inclusief btw; geen extra regel, net als nu op de live site
- C) Andrea valt onder de kleineondernemersregeling (KOR) en rekent geen btw; geen regel nodig
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: C
## Vraag 2: Drie keer "Boek je shoot"
Elke kaart heeft een knop met dezelfde tekst. Een schermlezer die alle links opsomt, hoort dan drie keer "Boek je shoot" zonder te weten welk pakket.
- A) Zichtbaar blijft "Boek je shoot"; voor schermlezers komt de naam van het pakket erbij ("Boek je shoot: Newborn"), via verborgen tekst. (aanbevolen)
- B) De zichtbare tekst wordt "Boek Newborn", "Boek Zwangerschap", enzovoort
- C) Zo laten, drie keer dezelfde tekst
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B, mits dat past, anders A. De knop moet 1 regel blijven, in ieder geval op desktop.
## Vraag 3: Nog een keer klikken
Een bezoeker klikt "Boek je shoot" bij Newborn, kiest in het formulier zelf toch "Gezin", scrolt terug en klikt "Boek je shoot" bij Zwangerschap.
- A) De laatste klik wint: het formulier springt naar Zwangerschap. De bezoeker heeft immers net opnieuw gekozen. (aanbevolen)
- B) Wat de bezoeker zelf in het formulier koos, blijft staan; een klik vult alleen een lege keuze in
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 4: `?pakket=` in de adresbalk
Na een klik staat bijvoorbeeld `andreaslop.nl/?pakket=newborn#contact` in de adresbalk.
- A) Laten staan. De link is te delen ("boek een newbornshoot"), en een refresh houdt de keuze vast. (aanbevolen)
- B) Na het invullen van het formulier weghalen, zodat de adresbalk weer `andreaslop.nl/` toont; delen kan dan niet meer
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B
## Vraag 5: Pakket zonder prijs
Straks levert de API de pakketten. Wat als Andrea een pakket zonder vaste prijs toevoegt (bijv. een bruiloft)?
- A) Prijs is altijd verplicht; een pakket zonder prijs kan niet (de API controleert dat). Eenvoudigst. (aanbevolen)
- B) Prijs is optioneel; zonder prijs toont de kaart "Prijs op aanvraag"
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
@@ -0,0 +1,11 @@
# Functional Design Plan — Unit 3: Prijzen
Scope: FR-HP-04 (cards, link with package), the package data that unit 5 reuses, and the `pakket` search parameter on `/`. Questions: [prijzen-fd-questions.md](prijzen-fd-questions.md).
- [x] 1. Collect and analyze answers (follow-up questions if needed)
- [x] 2. `domain-entities.md` — `PricingPackage`, its invariants (unique id slug, positive whole-euro price, non-empty features) and its relation to the contact form's shoot options
- [x] 3. `business-rules.md` — price formatting, `pakket` search parameter (accepted values, unknown/invalid values, multiple values, case), link targets, what happens on a second "Boek je shoot" click, VAT note, accessible link names; decision flowchart
- [x] 4. `business-logic-model.md` — flow from "Boek je shoot" via the URL to the preselected form value (unit 5 consumes it), and the pure functions `formatPrice` and `packageFromSearch`
- [x] 5. `frontend-components.md` — `Pricing`, `PriceCard`, decorations; props, states (hover, focus, reduced motion), responsive layout, accessibility
- [x] 6. PBT-01 property identification for `formatPrice` and `packageFromSearch` (invariants, oracle, idempotency where relevant)
- [x] 7. Validate against FR-HP-04, NFR-HP-01/02/03/06 and the Security/PBT extensions
@@ -0,0 +1,57 @@
# Code Summary — Unit 3: Prijzen
Plan: [prijzen-code-generation-plan.md](../../plans/prijzen-code-generation-plan.md). Functional design: [../functional-design/](../functional-design/). Branch: `feature/homepage-sections`.
## Files
### Created
| File | Purpose |
|---|---|
| `web/src/assets/home/deco-1.png`, `deco-2.png` | Design decorations, unchanged (15 KB, 42 KB) |
| `web/src/content/packages.ts` | The three live packages (Zwangerschap 175, Newborn 185, Gezin 175) |
| `web/src/lib/formatPrice.ts` + test | `€ 175` with a non-breaking space (BR-PRICE-01) |
| `web/src/lib/visiblePackages.ts` + test | `isValidPackage` + filter with first-wins de-duplication (BR-PRICE-02) |
| `web/src/lib/bookLabel.ts` + test | "Boek <name>" up to 14 characters, else "Boek je shoot" + hidden name (BR-BOOK-02) |
| `web/src/lib/packageFromSearch.ts` + test | `?pakket=` → known id or undefined (BR-PARAM-01) |
| `web/src/components/home/Pricing/Pricing.tsx` + test | The section: decorations, heading, card grid |
| `web/src/components/home/Pricing/PriceCard.tsx` + test | One package card with the booking link |
### Modified
| File | Change |
|---|---|
| `web/src/content/types.ts` | `PricingPackage`; `HomeContent.pricing` |
| `web/src/content/homeContent.ts` | Pricing title, lead, decorations |
| `web/src/recipes/linkButton.ts` | `size: 'fit'` — no wrapping, smaller side padding on phones (BR-BOOK-03); default unchanged |
| `web/src/theme.ts` | ~~Shadow token `lift` for the card hover~~ — removed again with the card hover (change request 2026-10-20) |
| `web/src/test/arbitraries.ts` | `pricingPackage`, `uniquePackages`, `anyPackage` |
| `web/src/routes/index.tsx` | `validateSearch` keeps `pakket` only as a string; renders `Pricing` after `AboutBlock` |
| `web/src/app.test.tsx` | "Prijzen" in the page order; `?pakket=newborn`, `?pakket=123` and `?pakket=<script>` render without errors and without reflecting the value |
## Notes and deviations
- **Typed link**: the shared `RouterLink` (`chakra(Link)`) drops TanStack Router's route generics, so `search={{ pakket }}` would not type-check. The card uses the router's own `Link` with the `linkButton` recipe applied via Chakra's `asChild`, so the search parameter is checked against the homepage route.
- **Second decoration**: the design positions it relative to the whole section; in the content box the last card covered it, so it was moved into the section's bottom padding (found in the visual check).
- **Literal special spaces**: an editing tool turned ` `/` ` escapes into the characters themselves, which ESLint rejects (`no-irregular-whitespace`); they were written back as escapes and `src` was scanned for others.
## Change request after testing on test (2026-10-20)
The owner removed the hover effect from the cards (lift, accent border, shadow); only the booking button keeps its effects. Removed in `PriceCard.tsx`, the `lift` shadow token in `theme.ts`, the static design (`.price-card:hover`) and the functional design.
## Later change (unit 5)
The feature list is a plain `ul`/`li` instead of Chakra's `List`: its slot recipe pulled a shared chunk into the route bundle on page load (see the unit 5 code summary, performance).
## Property-based tests (PBT)
| Function | Properties |
|---|---|
| `formatPrice` | digit round-trip; starts with `€` + NBSP, no breaking space |
| `visiblePackages` | only valid + unique ids; subsequence; idempotent; oracle on valid unique input |
| `bookLabel` | name always in the full text; visible form follows the 14-character rule |
| `packageFromSearch` | result undefined or a given id; any case/whitespace oracle; non-strings undefined; idempotent |
## Verification (`pnpm check`)
- Lint ✅, Prettier ✅, build ✅
- Tests: 38 files, **170 passed**; 100% coverage on the new `lib/` files (threshold)
- Lighthouse home: mobile **0.83–0.89** across runs (LCP 2.3–3.9 s), desktop **1.0**; accessibility, best practices, SEO **1.0**
- Visual check (CDP): 1440 three cards with decorations; 390 and 320 one column; "Boek Zwangerschap" stays on one line at 320 px
## Extension compliance
- **Security Baseline**: `pakket` never reflected (tested with a script-like value); only known ids come out; no new dependencies or external resources. Other rules N/A.
- **PBT**: PBT-02/03/04/05 covered per the table, PBT-07 domain generators, PBT-08/09 existing setup, PBT-10 example tests alongside; PBT-06 N/A (no stateful component).
@@ -0,0 +1,53 @@
# Business Logic Model — Unit 3: Prijzen
## Booking flow (across units 3 and 5)
```mermaid
sequenceDiagram
box rgba(246,224,94,0.4) Visitor
participant V as Visitor
end
box rgba(99,179,237,0.4) Homepage
participant Card as PriceCard
participant Route as RouteIndex
participant Form as ContactForm
end
V->>Card: Clicks Boek Newborn
Card->>Route: Navigate to the homepage with pakket newborn and hash contact
Route->>Route: packageFromSearch checks the value against the shown packages
Route->>Form: Preselected package id newborn
Route-->>V: Scrolls to the contact section
Form->>Form: Selects newborn, replacing any earlier choice
Form->>Route: Remove pakket from the URL with history replace
```
Text alternative: a click on a price card navigates to the homepage with the package in the URL; the route validates it and hands it to the contact form, scrolls to the contact section, and after the form has selected the package the parameter is removed from the URL.
## Pure functions (`web/src/lib/`)
| Function | Input → output | Rules |
|---|---|---|
| `formatPrice(euros: number): string` | `185` → `'€ 185'` | BR-PRICE-01 |
| `visiblePackages(packages: PricingPackage[]): PricingPackage[]` | raw list → shown list | BR-PRICE-02 |
| `bookLabel(name: string): { visible: string; hidden?: string }` | `'Newborn'` → `{ visible: 'Boek Newborn' }`; a 15+ character name → `{ visible: 'Boek je shoot', hidden: ': <name>' }` | BR-BOOK-02 |
| `packageFromSearch(value: unknown, packages: PricingPackage[]): string \| undefined` | `'Newborn '` → `'newborn'`; `'onbekend'` → `undefined` | BR-PARAM-01 |
The route's `validateSearch` only keeps `pakket` when it is a string (anything else becomes `undefined`); `packageFromSearch` does the matching against the shown packages.
## Testable properties (PBT-01)
| Function | Category | Property |
|---|---|---|
| `formatPrice` | Round-trip | For any positive integer `n`, removing everything but digits from `formatPrice(n)` gives back `n` |
| `formatPrice` | Invariant | Output starts with `€` followed by a non-breaking space and contains no regular space |
| `visiblePackages` | Invariant | Every result meets all invariants; ids are unique |
| `visiblePackages` | Invariant | The result is a subsequence of the input (order kept, nothing invented) |
| `visiblePackages` | Idempotency | `visiblePackages(visiblePackages(x))` equals `visiblePackages(x)` |
| `visiblePackages` | Oracle | A list of only valid, unique packages comes back unchanged |
| `bookLabel` | Invariant | The visible text plus the hidden text always contains the name; the visible text is `Boek <name>` exactly when the name has ≤ 14 characters, otherwise `Boek je shoot` |
| `packageFromSearch` | Invariant | The result is `undefined` or the id of one of the given packages |
| `packageFromSearch` | Oracle | For every package, its id in any letter case and with surrounding spaces returns that id |
| `packageFromSearch` | Invariant | Non-string input always gives `undefined` |
| `packageFromSearch` | Idempotency | Feeding the result back in gives the same result |
Generators (PBT-07) are added to `src/test/arbitraries.ts`: a valid `pricingPackage` (slug ids, Dutch-like names, 1–5 features, prices 1–5000), a list with unique ids, and an `anyPackage` mix that includes invalid ones (empty name, price 0 / negative / fractional / NaN, bad id, duplicates).
@@ -0,0 +1,65 @@
# Business Rules — Unit 3: Prijzen
## Rules
| ID | Rule | Source |
|---|---|---|
| BR-PRICE-01 | A price is shown as `€` + non-breaking space + the amount in Dutch notation without decimals: `€ 175`, `€ 1.250`. The non-breaking space keeps the price on one line. | Live site, NFR-HP-01 |
| BR-PRICE-02 | Only packages that meet the invariants (domain-entities.md) are shown; invalid ones are skipped, duplicates by id keep the first. The order of the list is kept. | Q5 = A, robustness for API data |
| BR-PRICE-03 | No VAT note (KOR). | Q1 = C |
| BR-BOOK-01 | Each card has one link to the contact section of the homepage with the package id: `/?pakket=<id>#contact`. | FR-HP-04, design Q4 |
| BR-BOOK-02 | The visible link text is `Boek <name>` when the name has at most **14 characters**; otherwise `Boek je shoot` with the package name added as visually hidden text (`Boek je shoot: <name>` for screen readers). 14 characters is what fits on one line in the button down to a 320 px phone. | Q2 = B if it fits, else A |
| BR-BOOK-03 | The button text never wraps (one line on every screen width); on phones the button uses less horizontal padding so the longest allowed label still fits. | Q2 |
| BR-PARAM-01 | `pakket` is accepted only as a string that matches a shown package id, compared case-insensitively and trimmed; the result is the package's own id. Anything else (unknown id, empty, number, array, missing) is ignored without an error. | design Q4, security (no reflection of input) |
| BR-PARAM-02 | When the form has taken over the package, `pakket` is removed from the address bar with a history *replace* (the `#contact` hash stays, no extra history entry, no scroll jump). Reloading the page therefore no longer preselects. | Q4 = B |
| BR-PARAM-03 | Every "Boek" click selects that package in the form, also when the visitor had chosen something else in the form before: the last click wins. | Q3 = A |
| BR-PARAM-04 | Applying, ignoring and removing `pakket` happen the same way whether the form is switched on or covered by the coming-soon gate. | FR-HP-07 |
BR-PARAM-02/03/04 are carried out by the contact form (unit 5); this unit defines them and delivers `packageFromSearch` and the links.
## Decision flow: link label (BR-BOOK-02)
```mermaid
graph TD
Start["Package name"] --> Len{"At most 14 characters?"}
Len -->|"yes"| Short["Visible: Boek name"]
Len -->|"no"| Long["Visible: Boek je shoot"]
Long --> Hidden["Hidden for screen readers: colon and name"]
Short --> Done["Accessible name always contains the package name"]
Hidden --> Done
classDef input fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef decision fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef outcome fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class Start input;
class Len decision;
class Short,Long,Hidden,Done outcome;
```
Text alternative: a name of at most 14 characters gives the visible label "Boek" plus the name; a longer one gives "Boek je shoot" with the name as hidden text; either way the accessible name contains the package name.
## Decision flow: `pakket` parameter (BR-PARAM-01…03)
```mermaid
graph TD
In["Search parameter pakket"] --> IsString{"Is it a string?"}
IsString -->|"no"| Ignore["Ignore, no preselection"]
IsString -->|"yes"| Match{"Trimmed, lowercase, equals a shown package id?"}
Match -->|"no"| Ignore
Match -->|"yes"| Select["Form selects that package, replacing any earlier choice"]
Select --> Clean["Remove pakket from the URL with history replace, keep hash contact"]
Ignore --> CleanAlso["Remove pakket from the URL as well"]
classDef input fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef decision fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef outcome fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class In input;
class IsString,Match decision;
class Ignore,Select,Clean,CleanAlso outcome;
```
Text alternative: a non-string or unknown `pakket` is ignored; a matching one selects that package in the form (replacing an earlier choice); in both cases the parameter is then removed from the URL with a history replace, keeping `#contact`.
## Misuse considerations (SECURITY-11)
- `pakket` is never rendered or reflected; only a known id from our own list can come out of `packageFromSearch`.
- Crafted values (very long strings, script, unicode look-alikes) simply match nothing.
@@ -0,0 +1,64 @@
# Domain Entities — Unit 3: Prijzen
## Relationships
```mermaid
graph TD
Package["PricingPackage"]
List["Package list"]
Card["Price card"]
Option["Shoot option"]
Param["pakket search parameter"]
List -->|"contains, in display order"| Package
Package -->|"shown as"| Card
Package -->|"becomes"| Option
Card -->|"links with id as"| Param
Param -->|"preselects"| Option
classDef entity fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef value fill:#FF9800,stroke:#e65100,stroke-width:1px,color:#000;
classDef ui fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class Package,List entity;
class Param,Option value;
class Card ui;
```
Text alternative: the package list holds packages in display order; each package is shown as a price card and becomes a shoot option in the contact form; a card links with the package id as the `pakket` parameter, which preselects that option (blue = data, orange = derived value, green = UI).
## PricingPackage
| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Stable slug, lowercase letters, digits and hyphens (e.g. `newborn`). Used in `?pakket=` and as the shoot value in the contact payload. |
| `name` | string | yes | Display name (e.g. "Newborn"); also the label of the shoot option |
| `price` | number | yes | Whole euros, > 0 (Q5 = A: no package without a price) |
| `features` | string[] | yes | What is included; at least one item |
### Invariants
- `id` is unique within the list and matches `^[a-z0-9-]+$`.
- `name` is non-empty after trimming.
- `price` is a finite integer > 0.
- `features` has ≥ 1 non-empty item.
- The list order is the display order (live: Zwangerschap, Newborn, Gezin).
Packages that break an invariant are left out of the page rather than breaking it (same approach as `visibleSocials`); the API is the place that rejects them at input (Q5 = A).
## Initial data (live site, 2026-10-19)
| id | name | price | features |
|---|---|---|---|
| `zwangerschap` | Zwangerschap | 175 | 1 uur fotografie · Minstens 30 zorgvuldig nabewerkte foto's · Persoonlijke online fotogalerij |
| `newborn` | Newborn | 185 | 1-2 uur fotografie · Minstens 40 zorgvuldig nabewerkte foto's · Persoonlijke online fotogalerij |
| `gezin` | Gezin | 175 | 1 uur fotografie · Minstens 30 zorgvuldig nabewerkte foto's · Persoonlijke online fotogalerij |
## Section content (`HomeContent.pricing`)
| Field | Value |
|---|---|
| `title` | "Prijzen" |
| `lead` | "Pakketten" |
| `decorations` | two decorative images from the design (`deco-1.png`, `deco-2.png`), `alt=""` |
## VAT
Andrea uses the small business scheme (KOR) and charges no VAT, so prices are shown as they are, without a VAT note (Q1 = C).
@@ -0,0 +1,48 @@
# Frontend Components — Unit 3: Prijzen
## Hierarchy
```mermaid
graph TD
Route["routes/index.tsx"] --> Pricing["home/Pricing"]
Pricing --> Section["HomeSection"]
Pricing --> Deco["Decorations x2"]
Pricing --> Heading["SectionHeading"]
Pricing --> Card["home/Pricing/PriceCard x n"]
Card --> Link["Book link: Chakra Link with linkButton style around RouterLink"]
Lib["lib: formatPrice, visiblePackages, bookLabel"] -.-> Pricing
Lib -.-> Card
classDef root fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
classDef ui fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef logic fill:#9C27B0,stroke:#4a148c,stroke-width:1px,color:#000;
class Route root;
class Pricing,Section,Deco,Heading,Card,Link ui;
class Lib logic;
```
Text alternative: the home route renders Pricing, which uses HomeSection, two decorations, SectionHeading and one PriceCard per shown package; each card has a book link; the pure helpers supply the shown packages, prices and link labels.
## Pricing
- **Props**: `{ content: HomeContent['pricing']; packages: PricingPackage[] }`
- **Behaviour**: renders `visiblePackages(packages)`; if none remain, the section is not rendered at all (no empty heading).
- **Layout**: `HomeSection` on `paper` (plain), `data-testid="pricing"`, heading centred with lead. Cards in a grid: 1 column, centred, max 460 px below `lg`; 3 columns from `lg`; gap `gridGap`.
- **Decorations**: two decorative images (`alt=""`, `aria-hidden`), absolutely positioned (top-left 8% / 2%, bottom-right 6% / 3%), `clamp(90px, 10vw, 160px)` wide, opacity 0.55, behind the content, not clickable; loaded deferred.
- **Reveal**: heading and each card fade in, cards staggered by 0.08 s.
## PriceCard
- **Props**: `{ pkg: PricingPackage }`
- **Markup**: `article` with `h3` (name), price paragraph, `ul` of features, book link. `data-testid="price-card-<id>"`, link `data-testid="price-card-<id>-book"`.
- **Style**: white background, 1 px `line` border, centred text, padding `clamp(2rem, 3.5vw, 3rem) clamp(1.5rem, 3vw, 2.5rem)`; name in heading font 1.75 rem; price in heading font 2.25 rem, `accent.deep` (contrast, NFR-HP-01); features small text `ink.soft` between two hairlines, gap 0.75 rem; link aligned to the bottom (cards in a row get equal button positions).
- **Hover**: none on the card itself — no lift, border change or shadow (owner's choice after testing on test, 2026-10-20). Only the book link keeps its button hover/focus effect.
- **Book link**: the outline `linkButton` style; text per `bookLabel` (BR-BOOK-02) with `VisuallyHidden` for the hidden part; `white-space: nowrap`; horizontal padding 1.25 rem on phones, the design's 2.4 rem from `sm` (BR-BOOK-03). Target `/` with `search={{ pakket: id }}` and `hash="contact"`.
## Route (`/`)
- `validateSearch`: `{ pakket?: string }` — keeps a string, drops anything else (BR-PARAM-01, first half).
- Passes `homeContent.pricing` and `packages` to `Pricing`. Resolving and applying the value, and removing it from the URL, follow in unit 5.
## Accessibility (NFR-HP-01)
- Region named by the h2 "Prijzen"; each card has an h3; features are a real list.
- Every link has a unique accessible name containing the package name.
- Decorations are hidden from assistive technology.
- Focus ring from the theme on the link; touch target ≥ 44 px high.
@@ -0,0 +1,82 @@
# Application Design — homepage-sections
Consolidated design. Details: [components.md](components.md), [component-methods.md](component-methods.md), [services.md](services.md), [component-dependency.md](component-dependency.md). Decisions: [application-design-plan.md](../plans/application-design-plan.md) (Q1–Q6 all A, except Q1 = B).
## 1. Design reference (FR-HP-01, done in this stage)
- `design/andreaslop-static/index.html` + `assets/css/style.css` + `assets/js/main.js`:
- Prijzen: live packages (Zwangerschap € 175, Newborn € 185, Gezin € 175 with the live inclusions); "Boek je shoot" → `index.html?pakket=<id>#contact`, preselected by the script
- **Lieve woorden** (new, section 13b in the CSS): between Prijzen and Contact on `paper.alt`; one review at a time — framed photo (same sand offset block as the about block), large Marcellus quotation mark in heidegroen, shoot type as eyebrow, quote in Marcellus, names in small caps; prev/next arrows and dots (44 px hit areas); polite live region; no autoplay; stacked below 1024 px
- Contact: live fields (Naam, E-mail, "In welke shoot heb je interesse?" select, "Stel hier je vraag"), button "(Aan)vraag versturen", honeypot, time check; the form sits dimmed and `inert` under a "Binnenkort" notice with "Stuur een e-mail" (`data-form-disabled` switch); now on a plain `paper` background so backgrounds keep alternating
- Lifestyle fotografie: `intro-3.jpg` replaced by the current live photo (manifest updated)
- `LAYOUT.md`: Home now has seven blocks (Hero, Highlights, About me, Prices, **Testimonials**, Contact, Instagram); new letter G colour added to `.ai/layout-conventions.md`.
- `contact.html` (the `/contact` page design) is unchanged — out of scope (Q16); the script supports both forms.
## 2. Structure
```mermaid
graph TD
Route["routes/index.tsx (validateSearch pakket)"] --> Hero["Hero (exists)"]
Route --> S1["home/IntroGallery"]
Route --> S2["home/AboutBlock"]
Route --> S3["home/Pricing"]
Route --> S4["home/Testimonials"]
Route --> S5["home/ContactSection"]
Route --> S6["home/InstagramGrid"]
S5 --> Gate["ContactForm/ContactFormGate"]
Gate --> Form["ContactForm/ContactForm"]
Form --> Adapter["contact/submitContactForm"]
classDef route fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef home fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef shared fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef existing fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
class Route route;
class S1,S2,S3,S4,S5,S6 home;
class Gate,Form,Adapter shared;
class Hero existing;
```
Text alternative: the home route renders the Hero and six home sections in page order; the contact section wraps the reusable form in a gate, and the form submits through a single adapter.
- **Folders** (Q1 = B): `components/home/{IntroGallery,AboutBlock,Pricing,Testimonials,ContactSection,InstagramGrid}`; reusable pieces in `components/{HomeSection,SectionHeading,Reveal,FramedImage,ContactForm}`; `hooks/useReveal.ts`; `contact/{types,submitContactForm}.ts`.
- **Shared building blocks**: `HomeSection` (padding, tone, width, `aria-labelledby`, anchor), `SectionHeading` (eyebrow, h2, lead), `Reveal` (+ `useReveal`), `FramedImage` (photo + sand offset block).
## 3. Content (Q2 = A)
- `content/packages.ts` (`PricingPackage[]`), `content/testimonials.ts` (`Testimonial[]`), `content/homeContent.ts` (`HomeContent`: section texts, gallery, about, instagram), `siteContent.contactForm.enabled = false` (Q5 = A).
- Images as `ContentImage { src, alt, width, height }` from `web/src/assets`.
- Only the route imports content; components get props.
## 4. Key interactions
- **Testimonials** (Q3 = A): Chakra `Carousel` (Ark UI) — keyboard, swipe, indicators and slide semantics built in; no autoplay; custom styling; live-region text from `slideLabel`; controls hidden for a single review.
- **Prijzen → Contact** (Q4 = A): `/?pakket=<id>#contact`; `packageFromSearch` ignores unknown ids; preselected value flows into the form as `initialShoot`.
- **Contact form**: Chakra `Field`/`Input`/`Textarea`/`NativeSelect`; plain React state; `validateContact` → per-field errors, focus to the first invalid field; `isLikelySpam` (honeypot + time check) → silent success; `submitContactForm` adapter (today rejects generically).
- **Gate**: `ContactFormGate` with `enabled` from `siteContent.contactForm`; when off, the form is dimmed and `inert`, the notice shows the e-mail address (assembled with the existing `emailAddress`) and a mailto button; without a valid address only the coming-soon text.
- **Instagram**: profile URL derived from `siteContent.socials` via `visibleSocials`; section hidden without one.
## 5. Pure helpers (`lib/`, PBT candidates)
`formatPrice`, `shootOptions`, `packageFromSearch`, `validateContact`, `toContactPayload`, `isLikelySpam`, `slideLabel`. Property identification per unit in Functional Design (PBT-01).
## 6. Requirements coverage
| Requirement | Covered by |
|---|---|
| FR-HP-01 | §1 (done) |
| FR-HP-02 | IntroGallery |
| FR-HP-03 | AboutBlock, FramedImage |
| FR-HP-04 | Pricing, PriceCard, packages.ts, formatPrice, package handover |
| FR-HP-05 | Testimonials (Chakra Carousel), testimonials.ts, slideLabel |
| FR-HP-06 | ContactSection, ContactForm, validateContact, shootOptions, submitContactForm |
| FR-HP-07 | ContactFormGate, siteContent.contactForm |
| FR-HP-08 | isLikelySpam, honeypot field, max lengths |
| FR-HP-09 | Widget slot in ContactForm (no script); integration in the API feature |
| FR-HP-10 | InstagramGrid, homeContent.instagram |
| FR-HP-11 | Reveal, useReveal |
| FR-HP-12 | content modules, ContentImage, assets |
| NFR-HP-01 | HomeSection labelling, Field wiring, Carousel semantics, inert gate, 44 px targets |
| NFR-HP-02 | Shared blocks, Chakra built-ins, theme reuse, English comments |
| NFR-HP-03 | Injectable submit, pure helpers, arbitraries |
| NFR-HP-04 | No new third parties, adapter + gate, spam filter, generic errors |
| NFR-HP-05 | Lazy images with dimensions |
| NFR-HP-06 | API-shaped content and payload types |
## 7. Extension compliance (Application Design)
- **Security Baseline**: SECURITY-04 compliant (no CSP change, no external resources); SECURITY-05 compliant at design level (client-side validation designed, server-side assigned to the API feature); SECURITY-10 compliant (no new dependencies — Chakra Carousel is part of the installed `@chakra-ui/react`); SECURITY-11 compliant (submission isolated in one adapter; misuse case: form spam — gate, honeypot, time check; captcha and rate limiting assigned to the API feature); SECURITY-13 compliant (no CDN resources); SECURITY-15 compliant (adapter failure → generic message, input kept). SECURITY-01/02/03/06/07/08/09/12/14 N/A (no server, data store, IAM or authentication in this feature).
- **Property-Based Testing**: PBT-01 planned per unit in Functional Design; pure helpers are isolated in `lib/` to make them property-testable; PBT-07 generators to be added to `test/arbitraries.ts`; PBT-08/09 compliant (existing fast-check setup with seed logging).
@@ -0,0 +1,51 @@
# Component Dependencies — homepage-sections
## Dependency matrix
Rows depend on columns (✓).
| Component | HomeSection | SectionHeading | Reveal | FramedImage | LinkButton | ContactForm(+Gate) | lib/ helpers | content types | Chakra built-ins |
|---|---|---|---|---|---|---|---|---|---|
| IntroGallery | ✓ | ✓ | ✓ | | | | | ✓ | Grid, Image |
| AboutBlock | ✓ | ✓ | ✓ | ✓ | | | | ✓ | Grid, Text, Link |
| Pricing / PriceCard | ✓ | ✓ | ✓ | | ✓ | | formatPrice | ✓ | SimpleGrid, List |
| Testimonials | ✓ | ✓ | ✓ | ✓ | | | slideLabel | ✓ | Carousel, Blockquote |
| ContactSection | ✓ | ✓ | ✓ | | | ✓ | shootOptions | ✓ | — |
| ContactForm | | | | | linkButton recipe | | validateContact, toContactPayload, isLikelySpam | ✓ | Field, Input, Textarea, NativeSelect |
| ContactFormGate | | | | | ✓ (mail button) | | emailAddress (exists) | ✓ | — |
| InstagramGrid | ✓ | ✓ | ✓ | | | | | ✓ | Grid, Link, VisuallyHidden |
| routes/index.tsx | | | | | | | packageFromSearch, visibleSocials (exists) | content modules | — |
No section depends on another section; the only cross-section link (Prijzen → Contact) goes through the URL.
## Data flow
```mermaid
graph LR
Content["content/ homeContent, packages, testimonials, siteContent"] --> Route["routes/index.tsx"]
URL["URL search pakket"] --> Route
Route -->|"props"| Sections["Six home sections"]
Route -->|"preselected id"| Contact["ContactSection / ContactForm"]
Sections -->|"Link with pakket + #contact"| URL
Contact -->|"ContactPayload"| Adapter["submitContactForm"]
Adapter -.->|"later"| API["POST /api/contact"]
classDef data fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef comp fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef ext fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,stroke-dasharray:5 5,color:#000;
class Content,URL data;
class Route,Sections,Contact,Adapter comp;
class API ext;
```
Text alternative: static content and the URL's pakket parameter flow into the home route, which passes props to the sections and the preselected package to the contact form; price cards write the package back into the URL; the form sends its payload through the single adapter, which will call the API later.
## Communication patterns
- **Props down** from the route; no context or global store.
- **URL as the shared channel** between Prijzen and Contact.
- **Callback-free sections**: sections emit nothing upward.
- **Injectable submit** on ContactForm for tests; default is the real adapter.
## Coupling notes
- `ContactForm` depends on `ShootOption[]`, not on `PricingPackage`, so the `/contact` page can reuse it with the same options.
- `InstagramGrid` receives `profileUrl` from the route (derived from `siteContent.socials` via `visibleSocials`), so the Instagram URL has one source.
- `FramedImage` is the only new shared visual primitive; anything else reuses theme tokens, text styles and recipes.
@@ -0,0 +1,115 @@
# Component Methods — homepage-sections
Signatures and data shapes. Detailed rules (validation messages, limits, carousel behaviour, spam thresholds) follow in Functional Design per unit.
## Content types (`content/types.ts`, additions)
```ts
// An image as the API will deliver it; src is a URL (bundled asset today)
interface ContentImage {
src: string;
alt: string;
width: number;
height: number;
}
interface PricingPackage {
id: string; // stable slug, e.g. 'newborn'; used in ?pakket= and as the shoot value
name: string; // 'Newborn'
price: number; // whole euros, e.g. 185
features: string[]; // '1-2 uur fotografie', ...
}
interface Testimonial {
id: string;
shoot: string; // label, e.g. 'Newbornshoot'
quote: string;
author: string; // 'Demi & Kevin'
image: ContentImage;
}
interface HomeContent {
intro: { title: string; lead: string; photos: ContentImage[] };
about: {
eyebrow: string;
title: string;
paragraphs: string[];
image: ContentImage;
link: { label: string; to: RoutePath };
};
pricing: { title: string; lead: string };
testimonials: { title: string };
contact: { title: string; lead: string };
instagram: { title: string; handle: string; photos: ContentImage[] };
}
// SiteContent gains:
interface SiteContent {
// ...existing fields
contactForm: { enabled: boolean };
}
```
Content modules (design Q2 = A): `content/packages.ts` → `PricingPackage[]`, `content/testimonials.ts` → `Testimonial[]`, `content/homeContent.ts` → `HomeContent`.
## Contact types (`contact/types.ts`)
```ts
interface ContactValues { // what the visitor typed
naam: string;
email: string;
shoot: string; // '' | a package id | 'overig'
bericht: string;
}
type ContactField = keyof ContactValues;
type ContactErrors = Partial<Record<ContactField, string>>;
interface ContactPayload { // what goes to POST /api/contact
naam: string;
email: string;
shoot: string;
bericht: string;
}
interface ShootOption { value: string; label: string }
```
## Components (props)
| Component | Props |
|---|---|
| `HomeSection` | `{ labelledBy: string; id?: string; tone?: 'paper' \| 'alt'; width?: 'default' \| 'narrow'; spacing?: 'default' \| 'tight'; children: ReactNode }` |
| `SectionHeading` | `{ id: string; title: string; eyebrow?: string; lead?: string; align?: 'center' \| 'start' }` |
| `Reveal` | `{ children: ReactNode; delay?: number }` |
| `FramedImage` | `{ image: ContentImage; aspectRatio: string }` |
| `IntroGallery` | `{ content: HomeContent['intro'] }` |
| `AboutBlock` | `{ content: HomeContent['about'] }` |
| `Pricing` | `{ content: HomeContent['pricing']; packages: PricingPackage[] }` |
| `PriceCard` | `{ pkg: PricingPackage }` |
| `Testimonials` | `{ content: HomeContent['testimonials']; testimonials: Testimonial[] }` |
| `ContactSection` | `{ content: HomeContent['contact']; packages: PricingPackage[]; enabled: boolean; email: EmailAddress; preselected?: string }` |
| `ContactFormGate` | `{ enabled: boolean; email: EmailAddress; children: ReactNode }` |
| `ContactForm` | `{ idPrefix: string; options: ShootOption[]; initialShoot?: string; submit?: (payload: ContactPayload) => Promise<void> }` (`submit` defaults to `submitContactForm`; injectable for tests) |
| `InstagramGrid` | `{ content: HomeContent['instagram']; profileUrl: string }` |
## Hooks
- `useReveal<T extends Element>(): { ref: RefObject<T>; visible: boolean }` — `visible` starts `true` when reduced motion is on or IntersectionObserver is missing; otherwise flips to `true` once and stops observing.
## Pure helpers (`lib/`, 100% coverage, property-based tests)
| Function | Purpose |
|---|---|
| `formatPrice(euros: number): string` | `185` → `'€ 185'` (nl-NL, no decimals) |
| `shootOptions(packages: PricingPackage[]): ShootOption[]` | package names in order + `{ value: 'overig', label: 'Overig' }` |
| `packageFromSearch(value: unknown, packages: PricingPackage[]): string \| undefined` | returns the id only if it matches a package |
| `validateContact(values: ContactValues, options: ShootOption[]): ContactErrors` | required fields, e-mail format, max lengths, shoot must be a known option |
| `toContactPayload(values: ContactValues): ContactPayload` | trims fields |
| `isLikelySpam(input: { honeypot: string; shownAt: number; now: number }): boolean` | honeypot filled or submitted too fast |
| `slideLabel(index: number, count: number): string` | `'Review 2 van 3'` for the live region and slide `aria-label` |
## Services / adapters
- `submitContactForm(payload: ContactPayload): Promise<void>` (`contact/submitContactForm.ts`) — today rejects with a generic error (no back-end); later `POST /api/contact`.
- Route search: `validateSearch: (search) => ({ pakket: typeof search.pakket === 'string' ? search.pakket : undefined })` on `/`; the page then resolves it with `packageFromSearch`.
@@ -0,0 +1,86 @@
# Components — homepage-sections
Folder structure per design Q1 = B: the six homepage blocks live under `components/home/`; anything reusable elsewhere stays directly under `components/`.
## Overview
```mermaid
graph TD
Route["routes/index.tsx"] --> Hero["Hero (exists)"]
Route --> Intro["home/IntroGallery"]
Route --> About["home/AboutBlock"]
Route --> Pricing["home/Pricing"]
Route --> Testimonials["home/Testimonials"]
Route --> ContactSection["home/ContactSection"]
Route --> Instagram["home/InstagramGrid"]
Pricing --> PriceCard["home/Pricing/PriceCard"]
ContactSection --> Gate["ContactForm/ContactFormGate"]
Gate --> Form["ContactForm/ContactForm"]
About --> Framed["FramedImage"]
Testimonials --> Framed
Intro --> Shared["HomeSection + SectionHeading + Reveal"]
About --> Shared
Pricing --> Shared
Testimonials --> Shared
ContactSection --> Shared
Instagram --> Shared
classDef route fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef home fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef shared fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef existing fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
class Route route;
class Intro,About,Pricing,PriceCard,Testimonials,ContactSection,Instagram home;
class Gate,Form,Framed,Shared shared;
class Hero existing;
```
Text alternative: the home route renders the existing Hero and six new home sections; Pricing uses PriceCard, ContactSection wraps the reusable ContactForm in a ContactFormGate, AboutBlock and Testimonials share FramedImage, and every section uses HomeSection, SectionHeading and Reveal.
## Shared components (`components/`)
### HomeSection
- **Purpose**: the design's `.section` wrapper for a content block
- **Responsibilities**: vertical padding (`section-y`), optional `paper.alt` background (`tone`), optional tight padding, `Container` width (default or narrow), `aria-labelledby` pointing at its heading, optional `id` (anchor)
- **Interface**: `<HomeSection labelledBy tone? width? spacing? id?>children</HomeSection>`
### SectionHeading
- **Purpose**: the design's `.section__head`
- **Responsibilities**: optional eyebrow (`eyebrow` text style, `accent.deep`), the h2 (with `id` for `aria-labelledby`), optional lead (`ink.soft`); centred or start-aligned
- **Interface**: `<SectionHeading id title eyebrow? lead? align?>`
### Reveal
- **Purpose**: the design's `.reveal` fade-in on scroll
- **Responsibilities**: wraps children; hidden-then-visible transition once the element enters the viewport; immediately visible under reduced motion, without IntersectionObserver, or before JavaScript runs (no content hidden by default in markup)
- **Interface**: `<Reveal delay?>children</Reveal>`; logic in `hooks/useReveal.ts`
### FramedImage
- **Purpose**: the photo with the sand offset block behind it (`.about__media`), shared by AboutBlock and Testimonials (design Q6 = A)
- **Responsibilities**: image with fixed aspect ratio, `loading="lazy"`, explicit width/height; decorative offset block hidden below `sm`
- **Interface**: `<FramedImage image aspectRatio>`
### ContactForm (`components/ContactForm/`)
- **ContactForm** — the form itself: fields Naam, E-mail, shoot select, Bericht; honeypot; per-field errors via Chakra `Field`; submit button; status message. Owns its form state. Reusable on `/contact` later.
- **ContactFormGate** — wraps ContactForm; when `enabled` is false the form is dimmed and `inert` and the coming-soon notice with the mail button is shown over it; when true the form is shown as is.
- **submitContactForm** (`src/contact/submitContactForm.ts`) — the single submission adapter (see services.md).
## Homepage sections (`components/home/`)
| Component | Unit | Purpose | Key responsibilities |
|---|---|---|---|
| `IntroGallery` | 1 Lifestyle fotografie | Heading + four-photo gallery | Staggered 4-column grid (2 on tablet, 1 on mobile), hover zoom, alt texts |
| `AboutBlock` | 2 Over mij | Photo + intro text | FramedImage, eyebrow, h2, paragraphs, "Lees mijn verhaal" link to `/over-mij`, `paper.alt` |
| `Pricing` + `PriceCard` | 3 Prijzen | Package cards | Decorations, card grid (1 column below `lg`), price formatting, "Boek je shoot" link with `pakket` search param + `#contact` |
| `Testimonials` | 4 Lieve woorden | One review at a time | Chakra `Carousel` (no autoplay), FramedImage, quotation mark, shoot label, `Blockquote`, author; prev/next + indicators; live-region status; no controls for a single review; `paper.alt` |
| `ContactSection` | 5 Contact | Contact block | Heading + lead, `id="contact"`, ContactFormGate with ContactForm, passes the preselected package and the e-mail address |
| `InstagramGrid` | 6 Instagram | Heading + photo grid | Handle link, six tiles (6/3/2 columns) linking to the profile, external link attributes; not rendered without a valid Instagram profile URL |
## Modified existing components / modules
| File | Change |
|---|---|
| `routes/index.tsx` | Renders the six sections after the Hero; `validateSearch` for `pakket` |
| `content/types.ts` | New content interfaces (see component-methods.md) |
| `content/siteContent.ts` | `contactForm: { enabled: false }` (design Q5 = A) |
| `recipes/linkButton.ts` | Usable on a `<button>` (submit) — no new variant |
| `theme.ts` | Possibly a `sectionY` spacing token and field styling (Functional Design / code plan decide) |
| `test/arbitraries.ts` | Generators for packages, contact values, testimonials |
@@ -0,0 +1,53 @@
# Services — homepage-sections
The site has no back-end; "services" here are the front-end mechanisms that provide content, connect sections and will later talk to the API.
## 1. Content provisioning
- **Responsibility**: deliver section content to the components.
- **Today**: static modules `content/homeContent.ts`, `content/packages.ts`, `content/testimonials.ts` and the existing `content/siteContent.ts`, imported by `routes/index.tsx` and passed down as props. Images are imported from `web/src/assets` (Vite-hashed URLs, typed as `ContentImage`).
- **Later**: the same shapes come from the .NET API (`/api/pages`, `/api/packages`, testimonials and the Instagram feed server-side) through a route loader; components do not change.
- **Rule**: components never import content modules directly — only the route does. Keeps them testable with generated content.
## 2. Package handover (Prijzen → Contact)
- **Responsibility**: "Boek je shoot" brings the visitor to the form with the package chosen (design Q4 = A).
- **Flow**: `PriceCard` renders a router `Link` to `/` with `search={{ pakket: pkg.id }}` and `hash="contact"`. The `/` route's `validateSearch` keeps `pakket` as an optional string; the page resolves it with `packageFromSearch` against the package list (unknown values are ignored) and passes it to `ContactSection` → `ContactForm` as `initialShoot`. The router scrolls to `#contact`.
- **Properties**: survives a reload, shareable, no shared mutable state between sections.
## 3. Contact submission adapter
- **Responsibility**: the only place that sends a contact request.
- **Today**: `submitContactForm` rejects with a generic error; with `contactForm.enabled = false` it is never reached because the form is inert.
- **Later (API feature)**: `POST /api/contact` with `ContactPayload` plus the Friendly Captcha token; server-side validation, spam checks and rate limiting; CSP additions for Friendly Captcha.
- **Switch**: `siteContent.contactForm.enabled` (design Q5 = A) — can be turned on and off again; later deliverable by the CMS.
## 4. Spam filtering (browser side)
- **Responsibility**: drop obvious bot submissions before they reach the adapter.
- **Flow**: on submit, after validation, `isLikelySpam({ honeypot, shownAt, now })`; spam gets the normal success message and nothing is sent.
## 5. Scroll reveal
- **Responsibility**: fade sections in as they enter the viewport (`useReveal` + `Reveal`), disabled under reduced motion.
## Orchestration
```mermaid
sequenceDiagram
box rgba(246,224,94,0.4) Visitor
participant V as Visitor
end
box rgba(99,179,237,0.4) Homepage
participant P as PriceCard
participant R as Route /
participant C as ContactForm
participant A as submitContactForm
end
V->>P: Click Boek je shoot (Newborn)
P->>R: Navigate to /?pakket=newborn#contact
R->>R: packageFromSearch checks the id
R->>C: initialShoot newborn, scroll to contact
V->>C: Fill in and submit
C->>C: validateContact, isLikelySpam
C->>A: ContactPayload (only when enabled and not spam)
A-->>C: Resolved or generic error
C-->>V: Status message
```
Text alternative: clicking "Boek je shoot" navigates to the homepage with the package in the URL; the route checks it and preselects it in the form; on submit the form validates and filters spam before calling the single submission adapter and showing a status message.
@@ -0,0 +1,44 @@
# Unit Dependencies — homepage-sections
## Dependency matrix
Rows depend on columns (✓ = needs something that unit introduces).
| Unit | 1 Lifestyle | 2 Over mij | 3 Prijzen | 4 Lieve woorden | 5 Contact | 6 Instagram |
|---|---|---|---|---|---|---|
| 1 Lifestyle fotografie | — | | | | | |
| 2 Over mij | ✓ HomeSection, SectionHeading, Reveal, ContentImage | — | | | | |
| 3 Prijzen | ✓ | | — | | | |
| 4 Lieve woorden | ✓ | ✓ FramedImage | | — | | |
| 5 Contact | ✓ | | ✓ packages, packageFromSearch, `pakket` search | | — | |
| 6 Instagram | ✓ | | | | | — |
## Order
```mermaid
graph LR
U1["1 Lifestyle fotografie (shared blocks)"] --> U2["2 Over mij (FramedImage)"]
U2 --> U3["3 Prijzen (packages)"]
U3 --> U4["4 Lieve woorden"]
U4 --> U5["5 Contact"]
U5 --> U6["6 Instagram"]
U6 --> BT["Build and Test + one PR"]
U1 -.-> U3
U1 -.-> U6
U2 -.-> U4
U3 -.-> U5
classDef unit fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef shared fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef final fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
class U2,U4,U5,U6 unit;
class U1,U3 shared;
class BT final;
```
Text alternative: the units run in page order 1 to 6, then Build and Test; dashed arrows show the real dependencies — unit 1's shared blocks are used by all, unit 2's FramedImage by unit 4, and unit 3's packages by unit 5.
## Notes
- The build order equals the page order, so the homepage is always correct up to the last finished unit.
- Units 4 and 6 could be swapped without impact; unit 5 must come after unit 3.
- Integration points checked at Build and Test: section order in `routes/index.tsx`, background alternation, Prijzen → Contact preselection, full-page Lighthouse.
- One branch, commits per unit, one PR at the end; no unit is merged to `master` on its own.
@@ -0,0 +1,26 @@
# Requirement-to-Unit Map — homepage-sections
User Stories were skipped (single visitor persona), so this maps every requirement from [requirements.md](../requirements/requirements.md) to the unit(s) that deliver it.
| Requirement | Unit(s) | Notes |
|---|---|---|
| FR-HP-01 Static design and LAYOUT.md | — | Done in Application Design |
| FR-HP-02 Lifestyle fotografie | 1 | |
| FR-HP-03 Over mij | 2 | |
| FR-HP-04 Prijzen | 3 (cards, link) · 5 (preselection in the form) | |
| FR-HP-05 Lieve woorden | 4 | |
| FR-HP-06 Contact form | 5 | Shoot options from unit 3's packages |
| FR-HP-07 Coming-soon overlay | 5 | |
| FR-HP-08 Anti-spam (browser) | 5 | |
| FR-HP-09 Robot check (slot only) | 5 | Integration in the future API feature |
| FR-HP-10 Instagram | 6 | |
| FR-HP-11 Scroll reveal | 1 (introduced) · 2–6 (used) | |
| FR-HP-12 Content and images | 1–6 | Each unit adds its own content and images |
| NFR-HP-01 Accessibility | 1–6 · Build and Test (Lighthouse full page) | Carousel (4) and form/gate (5) carry the most rules |
| NFR-HP-02 Styling and consistency | 1–6 | Shared blocks in 1 and 2 |
| NFR-HP-03 Testing | 1–6 · Build and Test | PBT for helpers in 3, 4, 5 |
| NFR-HP-04 Security | 5 (form, adapter, spam) · 6 (external links) · all (no third parties) | |
| NFR-HP-05 Performance | 1–6 (per-unit `pnpm check` incl. Lighthouse) · Build and Test | |
| NFR-HP-06 API-shaped content | 1–6 | Payload type in 5 |
All requirements are assigned; none is left without a unit or stage.
@@ -0,0 +1,65 @@
# Units of Work — homepage-sections
Six units, one per homepage block (user request), built in order on one branch, `feature/homepage-sections`, and delivered in **one pull request** at the end (units Q1 = A). After each unit's Code Generation the full **`pnpm check`** runs, Lighthouse included (units Q2 = A). Each unit adds its section to `routes/index.tsx`, so the homepage is complete up to that unit and never broken in between.
All units are modules inside the single deployable `web/` SPA (no separate services).
## Common conventions (apply to every unit)
- **Images**: downloaded from andreaslop.nl (source URLs in `design/andreaslop-static/assets/img/manifest.txt`), resized once to at most ±1600 px on the long side and compressed, stored in `web/src/assets/home/`, typed as `ContentImage` with real width/height, rendered with `loading="lazy"`. The resize tool is picked in unit 1's code plan; it must not become a project dependency.
- **Tests**: example-based component test with axe per section; property-based tests for every new `lib/` helper (PBT extension, full); shared generators in `src/test/arbitraries.ts`.
- **Code comments in English**; visitor-facing text in Dutch (NFR-HP-02).
- **Design reference**: `design/andreaslop-static/index.html` + `style.css` (updated in Application Design).
---
## Unit 1 — Lifestyle fotografie
- **Section**: `components/home/IntroGallery` — heading "Lifestyle fotografie", lead, four photos in the staggered grid (4 / 2 / 1 columns), hover zoom.
- **Shared pieces introduced**: `components/HomeSection`, `components/SectionHeading`, `components/Reveal` + `hooks/useReveal.ts`.
- **Content**: `ContentImage` and `HomeContent` (intro part, extended by later units) in `content/types.ts`; `content/homeContent.ts`.
- **Images**: intro-1 … intro-4 (live photos).
- **Functional Design**: skipped (presentational).
- **Done when**: section renders below the hero with correct heading structure; reveal works and is off under reduced motion; `pnpm check` green.
## Unit 2 — Over mij
- **Section**: `components/home/AboutBlock` — framed photo, eyebrow "Over mij", h2, three paragraphs, "Lees mijn verhaal" → `/over-mij`, on `paper.alt`.
- **Shared pieces introduced**: `components/FramedImage` (sand offset block).
- **Content**: `HomeContent.about`.
- **Images**: andrea-home (live).
- **Functional Design**: skipped (presentational).
- **Done when**: section renders after Lifestyle fotografie; link works; offset block hidden on small screens; `pnpm check` green.
## Unit 3 — Prijzen
- **Section**: `components/home/Pricing` + `PriceCard` — heading "Prijzen", lead "Pakketten", decorations, three cards, "Boek je shoot" → `/?pakket=<id>#contact`.
- **Logic**: `lib/formatPrice`, `lib/packageFromSearch`; `validateSearch` for `pakket` on the `/` route.
- **Content**: `PricingPackage` type, `content/packages.ts` (Zwangerschap, Newborn, Gezin), `HomeContent.pricing`.
- **Images**: deco-1.png, deco-2.png (design decorations).
- **Functional Design**: **executed** — package/price rules, search param handling, properties for PBT-01.
- **Done when**: cards match the live content; the link carries the package; unknown `pakket` values are ignored; `pnpm check` green. (The preselection itself becomes visible in unit 5.)
## Unit 4 — Lieve woorden
- **Section**: `components/home/Testimonials` — heading "Lieve woorden", Chakra `Carousel` without autoplay, FramedImage, quotation mark, shoot label, `Blockquote`, author; prev/next and indicators; live-region status; no controls for one review; on `paper.alt`.
- **Logic**: `lib/slideLabel`.
- **Content**: `Testimonial` type, `content/testimonials.ts` (Trouwshoot – Majella & Mark, Newbornshoot – Demi & Kevin), `HomeContent.testimonials`.
- **Images**: the two live review photos.
- **Functional Design**: **executed** — carousel behaviour, announcements, edge cases (0 / 1 / many reviews), properties for PBT-01.
- **Done when**: keyboard, swipe and indicator navigation work and are announced; axe clean; `pnpm check` green.
## Unit 5 — Contact
- **Section**: `components/home/ContactSection` (`id="contact"`, heading, lead) with `components/ContactForm/ContactFormGate` around `components/ContactForm/ContactForm`.
- **Logic**: `lib/shootOptions`, `lib/validateContact`, `lib/toContactPayload`, `lib/isLikelySpam`; `contact/types.ts`, `contact/submitContactForm.ts` (adapter, rejects generically today).
- **Content**: `siteContent.contactForm = { enabled: false }`, `HomeContent.contact`.
- **Theme**: field styling (square inputs, select chevron, error colour with sufficient contrast); `linkButton` recipe on a `<button>`.
- **Functional Design**: **executed** — validation rules and messages, limits, spam rules, gate behaviour (on/off, invalid e-mail), submit states, preselection from unit 3, properties for PBT-01.
- **Done when**: gate shows the coming-soon notice with mail button and the form is inert; with `enabled: true` (in tests) validation, spam filter and submit states work; preselection from "Boek je shoot" works; `pnpm check` green.
## Unit 6 — Instagram
- **Section**: `components/home/InstagramGrid` — heading "Instagram", handle link, six square tiles (6 / 3 / 2 columns) linking to the profile in a new tab.
- **Content**: `HomeContent.instagram` (title, handle, six photos); profile URL derived from `siteContent.socials` in the route.
- **Images**: six existing site photos, reusing already-bundled assets where possible (Andrea can swap them).
- **Functional Design**: skipped (presentational).
- **Done when**: section renders last; hidden without a valid Instagram URL; external link attributes and screen reader hint present; `pnpm check` green.
---
## After the units
**Build and Test** for the whole homepage (section order, Prijzen → Contact across sections, Lighthouse on the complete page), then one PR from `feature/homepage-sections` to `master`. The Operations decision is asked again there.
@@ -0,0 +1,94 @@
# Application Design Plan — homepage-sections
Depth: **standard**. One front-end package; the design pins down component boundaries, props, content modules, the Prijzen → Contact interaction and what is reused from Chakra and the theme (NFR-HP-02). Detailed behaviour rules (validation, carousel, anti-spam) follow in Functional Design per unit.
## Plan
- [x] 1. Answer the design questions below
- [x] 2. Analyze answers for ambiguities (follow-up questions if needed)
- [x] 3. Static design reference (FR-HP-01)
- [x] 3a. Download the live photos (gallery, Andrea, reviews) into `design/andreaslop-static/assets/img` and add them to `manifest.txt`
- [x] 3b. `index.html`: live content for Lifestyle fotografie (photos), Prijzen (packages), Contact (form fields); new Lieve woorden section between Prijzen and Contact
- [x] 3c. `style.css`: styles for Lieve woorden (and the select field); `main.js`: prev/next/dots for the reviews
- [x] 3d. `LAYOUT.md`: Home diagram with seven blocks, per `.ai/layout-conventions.md`
- [x] 4. Generate `components.md` — component definitions and responsibilities
- [x] 5. Generate `component-methods.md` — props/signatures of components, hooks and helpers
- [x] 6. Generate `services.md` — content provisioning, Prijzen → Contact handover, contact submission adapter
- [x] 7. Generate `component-dependency.md` — dependency matrix, data flow
- [x] 8. Generate `application-design.md` — consolidated design
- [x] 9. Validate completeness and consistency (FR-HP-01…12, NFR-HP-01…06, Security/PBT applicability)
## Already decided (no question needed)
These follow from the requirements and the reuse principle (NFR-HP-02):
- **Shared section heading**: one `SectionHeading` component (optional eyebrow, the h2, optional lead; centred or left), used by all six sections — the design's `.section__head`.
- **Section wrapper**: one `HomeSection` component for the padding (`--section-y`), the optional `paper.alt` background and the accessible name (`aria-labelledby` on its heading).
- **Scroll reveal**: a `Reveal` wrapper component on top of a `useReveal` hook (IntersectionObserver), no-op under reduced motion.
- **Form fields**: Chakra's `Field` (label, error text, `aria-invalid`/`aria-describedby` wiring), `Input`, `Textarea` and `NativeSelect`, styled to the design's square fields via a recipe or theme slot overrides.
- **Buttons**: the existing `LinkButton` (`linkButton` recipe) for "Boek je shoot"; a `button` variant of the same recipe for the submit button.
- **Form state**: plain React state plus pure helpers in `lib/` — no form library (no new dependencies).
- **Contact payload**: `{ naam, email, shoot, bericht }`; `submitContactForm(payload): Promise<void>` in its own module, the single place the API call goes later.
- **Images**: imported from `web/src/assets` (Vite hashes them), with explicit width/height and `loading="lazy"`.
---
## Questions
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**.
## Vraag 1: Mappenstructuur van de componenten
- A) Plat, net als nu: elk component een eigen map onder `components/`, met Engelse namen uit de README van het ontwerp: `IntroGallery/`, `AboutBlock/`, `Pricing/`, `Testimonials/`, `ContactSection/` + `ContactForm/`, `InstagramGrid/`, en de gedeelde `HomeSection/`, `SectionHeading/`, `Reveal/`.
- B) Gegroepeerd: de zes blokken onder `components/home/` (bijv. `components/home/Pricing/`), en wat elders terugkomt (ContactForm, SectionHeading, HomeSection, Reveal) gewoon onder `components/`. Zo zie je in één oogopslag wat bij de homepage hoort, en blijft wat herbruikbaar is apart. (aanbevolen)
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B
## Vraag 2: Contentmodules
Hoe verdelen we de nieuwe vaste data over `content/`?
- A) Per onderwerp: `packages.ts` (pakketten; straks ook nodig op Soorten fotoshoots), `testimonials.ts` (reviews; kunnen later ook op andere pagina's) en `homeContent.ts` (teksten van de blokken, galerij, Over mij-foto, Instagram). Dat sluit aan op de API-endpoints uit het ontwerp (`/api/packages`, `/api/pages`). (aanbevolen)
- B) Alles in één `homeContent.ts`
- C) Eén bestand per blok (zes bestanden)
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 3: De slider van Lieve woorden
- A) **Chakra's ingebouwde `Carousel`** (op Ark UI). Toegankelijkheid zit erin: rol en labels per slide, puntjes, toetsenbord en swipe. Wij voegen alleen de stijl en een melding voor schermlezers toe. Minder eigen code om te onderhouden. (aanbevolen)
- B) Zelf bouwen met een kleine eigen hook, naar het voorbeeld van `useHeroSlider` (zonder autoplay)
- C) Een gedeelde `useCarousel`-hook uit `useHeroSlider` halen, die zowel de hero als de reviews gebruikt. Dat refactort de hero, die net is opgeleverd.
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 4: Hoe geeft "Boek je shoot" het pakket door aan het formulier?
- A) Via de URL: de knop linkt naar `/?pakket=newborn#contact`. De route controleert de waarde (alleen bestaande pakketten), het formulier leest hem en de browser scrollt naar `#contact`. Werkt ook na een refresh, en de link is te delen ("boek een newbornshoot"). (aanbevolen)
- B) Via gedeelde React-state op de homepage (de route geeft een callback aan Prijzen en een waarde aan Contact). Geen zichtbare URL-wijziging; gaat verloren bij een refresh.
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 5: Waar staat de instelling `contactFormEnabled`?
- A) In de content (`siteContent.contactForm.enabled`), naast het e-mailadres. Hoort bij de vorm die de API straks levert, zodat het formulier dan ook vanuit het CMS aan of uit kan. (aanbevolen)
- B) Als constante in de code (bijv. `src/features.ts`), los van de content
- C) Per omgeving via de hostname, net als monitoring: dan kan het formulier eerst alleen op test aan
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 6: Foto in Lieve woorden
Hoe ziet de foto bij een review eruit? (De tekst krijgt in alle gevallen het grote aanhalingsteken in heidegroen.)
- A) Zoals bij Over mij: een rechthoekige foto met de verschoven zandkleurige rand erachter (`.about__media`). Consistent met de rest van de site. (aanbevolen)
- B) Een boogvorm (afgeronde bovenkant), een veelgebruikte, zachte stijl bij fotografen. Nieuw element in het ontwerp.
- C) Een kleine ronde foto boven de tekst, de tekst zelf centraal
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
@@ -0,0 +1,157 @@
# Execution Plan — Homepage Sections
## Detailed Analysis Summary
### Transformation Scope
- **Transformation Type**: Single component (application change inside `web/`), plus the static design reference and LAYOUT.md
- **Primary Changes**: six new homepage section components, a reusable contact form, shared section building blocks (section heading, scroll reveal), new content types and static content, new images
- **Related Components**: `routes/index.tsx`, `content/types.ts`, `content/*`, `lib/*`, `test/arbitraries.ts`, `design/andreaslop-static/index.html` + `style.css`, `LAYOUT.md`
### Change Impact Assessment
- **User-facing changes**: Yes — the homepage gains six sections below the hero
- **Structural changes**: No — the shell, routing and hosting stay the same
- **Data model changes**: Yes (front-end only) — new content interfaces (`PricingPackage`, `Testimonial`, `GalleryPhoto`, `InstagramContent`, section texts) and the contact payload shape
- **API changes**: No live API; the contact payload is designed for the future `POST /api/contact`
- **NFR impact**: Yes, contained — accessibility (carousel, form, overlay), performance (lazy images within the Lighthouse budget), security (no new third parties, CSP unchanged)
### Component Relationships
```mermaid
graph LR
Home["routes/index.tsx"] --> Sections["New section components (6)"]
Sections --> Shared["Shared: SectionHeading, useReveal, LinkButton"]
Sections --> Content["content/ (types + static data)"]
Prices["Prijzen"] -->|"package list + preselect"| Contact["Contact form"]
Contact --> Lib["lib/ (validation, honeypot, time check)"]
Contact --> Site["siteContent.email"]
Design["design/andreaslop-static + LAYOUT.md"] -.->|"reference"| Sections
classDef route fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef comp fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef data fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef ref fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,stroke-dasharray:5 5,color:#000;
class Home route;
class Sections,Shared,Prices,Contact comp;
class Content,Lib,Site data;
class Design ref;
```
Text alternative: the home route renders six new sections that use shared building blocks and content data; Prijzen feeds the package list and preselection into the contact form, which uses pure helpers in lib/ and the site e-mail; the static design is the reference.
| Component | Change Type | Priority |
|---|---|---|
| `routes/index.tsx` | Minor (adds sections) | Critical |
| New section components | Major (new) | Critical |
| `content/types.ts`, new content modules | Minor (additive) | Critical |
| `lib/` new helpers | Minor (additive) | Important |
| `design/andreaslop-static`, `LAYOUT.md` | Minor | Important (gate for React work) |
| `config/securityHeaders.ts` | None (unchanged) | — |
### Risk Assessment
- **Risk Level**: Low — additive changes on one page, no infrastructure or dependency changes
- **Rollback Complexity**: Easy — revert the merge
- **Testing Complexity**: Moderate — carousel and form behaviour, overlay/inert, property-based tests for helpers, Lighthouse budget
## Workflow Visualization
```mermaid
flowchart TD
Start(["User Request"])
subgraph INCEPTION["🔵 INCEPTION PHASE"]
WD["Workspace Detection<br/><b>COMPLETED</b>"]
RE["Reverse Engineering<br/><b>COMPLETED</b>"]
RA["Requirements Analysis<br/><b>COMPLETED</b>"]
US["User Stories<br/><b>SKIP</b>"]
WP["Workflow Planning<br/><b>IN PROGRESS</b>"]
AD["Application Design<br/>+ static design update<br/><b>EXECUTE</b>"]
UG["Units Generation<br/><b>EXECUTE</b>"]
end
subgraph CONSTRUCTION["🟢 CONSTRUCTION PHASE (per unit)"]
FD["Functional Design<br/><b>EXECUTE for Prijzen, Lieve woorden, Contact</b>"]
NFRA["NFR Requirements<br/><b>SKIP</b>"]
NFRD["NFR Design<br/><b>SKIP</b>"]
ID["Infrastructure Design<br/><b>SKIP</b>"]
CG["Code Generation<br/>(Planning + Generation)<br/><b>EXECUTE</b>"]
BT["Build and Test<br/><b>EXECUTE</b>"]
end
Start --> WD
WD --> RE
RE --> RA
RA -.-> US
RA --> WP
WP --> AD
AD --> UG
UG --> FD
FD --> CG
UG --> CG
CG -.->|"next unit"| FD
CG --> BT
BT --> End(["Complete (Operations decided at Build and Test)"])
style WD fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
style RE fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
style RA fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
style WP fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
style CG fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
style BT fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
style US fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
style NFRA fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
style NFRD fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
style ID fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
style AD fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
style UG fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
style FD fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
style INCEPTION fill:#BBDEFB,stroke:#1565C0,stroke-width:3px,color:#000
style CONSTRUCTION fill:#C8E6C9,stroke:#2E7D32,stroke-width:3px,color:#000
style Start fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
style End fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
linkStyle default stroke:#333,stroke-width:2px
```
Text alternative: Inception runs Application Design (including the static design update) and Units Generation, skipping User Stories; Construction loops per unit through Functional Design (only for Prijzen, Lieve woorden and Contact) and Code Generation, skipping the NFR and Infrastructure stages, then Build and Test; Operations is omitted until decided at Build and Test.
## Phases to Execute
### 🔵 INCEPTION PHASE
- [x] Workspace Detection (COMPLETED)
- [x] Reverse Engineering (COMPLETED — refresh)
- [x] Requirements Analysis (COMPLETED)
- [x] User Stories (SKIPPED — single visitor persona, concrete requirements)
- [x] Execution Plan (IN PROGRESS)
- [ ] Application Design — EXECUTE
- **Rationale**: new components (six sections, reusable ContactForm, testimonial carousel, SectionHeading, `useReveal`), new content interfaces and one cross-section interaction (Prijzen → Contact preselection). This stage also delivers **FR-HP-01**: the Lieve woorden design and the live content in `design/andreaslop-static` plus the updated LAYOUT.md, so the design can be reviewed in the browser before any React work.
- [ ] Units Generation — EXECUTE
- **Rationale**: the user asked for one unit per block; this stage fixes the six units, their order and dependencies, and where the shared building blocks land.
### 🟢 CONSTRUCTION PHASE
Proposed unit order: **1 Lifestyle fotografie** (also introduces the shared SectionHeading, `useReveal` and image conventions) → **2 Over mij** → **3 Prijzen** → **4 Lieve woorden** → **5 Contact** (needs the package list from Prijzen) → **6 Instagram**.
- [ ] Functional Design — EXECUTE for **Prijzen**, **Lieve woorden** and **Contact**; SKIP for Lifestyle fotografie, Over mij and Instagram
- **Rationale**: those three contain logic (package → shoot options and preselection; carousel index and announcements; validation, honeypot, time check, overlay/toggle, submit states) and need PBT-01 property identification. The other three are presentational: content + layout already defined by the design and the application design.
- [ ] NFR Requirements — SKIP
- **Rationale**: NFRs are fully set at requirements level (NFR-HP-01…06); the tech stack is fixed and no new dependencies are added.
- [ ] NFR Design — SKIP
- **Rationale**: no new NFR patterns beyond what Functional Design and the code plans cover (inert overlay, lazy images, reduced motion).
- [ ] Infrastructure Design — SKIP
- **Rationale**: no infrastructure changes; the CSP and server configs stay unchanged.
- [ ] Code Generation — EXECUTE (ALWAYS), per unit
- [ ] Build and Test — EXECUTE (ALWAYS)
### 🟡 OPERATIONS PHASE
- [ ] Deployment Setup, Monitoring Setup, Production Readiness Validation — UNDECIDED
- **Rationale**: Operations Configuration = Undecided; asked again at Build and Test. The existing pipeline already deploys to test on merge to master.
## Package Change Sequence
Single package (`web/`). Sequence inside it: static design + LAYOUT.md (Application Design) → shared building blocks (unit 1) → units 2–6 in order. Feature branch `feature/homepage-sections`, created before the first Code Generation.
## Estimated Timeline
- **Total Stages to execute**: Application Design, Units Generation, 3× Functional Design, 6× Code Generation, Build and Test
- **Estimated Duration**: several working sessions; one unit per session is a comfortable pace
## Success Criteria
- **Primary Goal**: the homepage shows all six sections below the hero, matching the (updated) design, with live-site content
- **Key Deliverables**: updated static design + LAYOUT.md; six section components; reusable ContactForm with overlay, validation and browser-side anti-spam; content modules; images; tests
- **Quality Gates**: `pnpm check` green (lint, format, tests incl. PBT and axe, build, audits, Lighthouse: accessibility/best practices 1.0, home mobile performance ≥ 0.8); Security Baseline and PBT compliance per stage; CI green on the PR
- **Integration Testing**: home route renders all sections in order; "Boek je shoot" → contact preselection works across sections
@@ -0,0 +1,52 @@
# Unit of Work Plan — homepage-sections
The decomposition itself is already decided: one unit per homepage block (user request), in the order approved in the execution plan, with the shared building blocks introduced by the first unit that needs them. This plan fixes the boundaries and asks how the units are delivered.
## Plan
- [x] 1. Answer the questions below
- [x] 2. Analyze answers for ambiguities (follow-up questions if needed)
- [x] 3. Generate `unit-of-work.md` — the six units, their scope (components, content, helpers, images, tests) and where shared pieces land
- [x] 4. Generate `unit-of-work-dependency.md` — dependency matrix and order
- [x] 5. Generate `unit-of-work-story-map.md` — no user stories were written, so this maps every requirement (FR-HP / NFR-HP) to its unit(s)
- [x] 6. Validate boundaries and dependencies; check that every requirement is assigned
## Already decided (no question needed)
| # | Unit | Brings in (besides the section itself) |
| --- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1 | Lifestyle fotografie | `HomeSection`, `SectionHeading`, `Reveal` + `useReveal`, `ContentImage` and `HomeContent` types, `homeContent.ts`, image conventions (download, resize, dimensions) |
| 2 | Over mij | `FramedImage` |
| 3 | Prijzen | `PricingPackage`, `packages.ts`, `formatPrice`, `packageFromSearch`, `validateSearch` on `/` |
| 4 | Lieve woorden | `Testimonial`, `testimonials.ts`, `slideLabel`, Chakra Carousel styling |
| 5 | Contact | `ContactForm` + `ContactFormGate`, `contact/` types and adapter, `shootOptions`, `validateContact`, `toContactPayload`, `isLikelySpam`, `siteContent.contactForm`, field styling |
| 6 | Instagram | profile URL derived from `siteContent.socials` |
- Work happens on one branch, `feature/homepage-sections`, created before the first Code Generation.
- Each unit adds its section to `routes/index.tsx`, so the homepage grows unit by unit and is never broken in between.
---
## Questions
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**.
## Vraag 1: Opleveren per unit of per feature
Een merge naar `master` gaat automatisch naar test.andreaslop.nl.
- A) **Eén pull request voor de hele feature.** Per unit één of meer commits op `feature/homepage-sections`; aan het eind één PR naar `master`. Test krijgt de homepage pas als hij af is. Een unit tussendoor op test bekijken kan via de handmatige run "Deploy to Test" op de branch. (aanbevolen)
- B) **Een pull request per unit.** Na elke unit een PR naar `master`, dus de homepage groeit stap voor stap op test. Meer PR's en CI-runs, maar kleinere reviews.
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 2: Controle na elke unit
Elke unit wordt na het genereren automatisch gebouwd en getest. Hoe zwaar is die controle?
- A) **Volledige `pnpm check` per unit**, inclusief Lighthouse. Een unit met grote foto's die het performancebudget van de homepage overschrijdt, valt dan meteen op en niet pas aan het eind. Kost een paar minuten per unit. (aanbevolen)
- B) Lint, opmaak, tests en build per unit; Lighthouse alleen bij Build and Test
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
@@ -0,0 +1,213 @@
# Verificatievragen — Homepage-secties
Al vastgelegd (geen vraag nodig):
- **Zes blokken** onder de hero, elk een eigen unit: Lifestyle fotografie, Over mij, Prijzen, **Lieve woorden** (nieuw, van de live site), Contact en **Instagram**.
- **Contactformulier**: wordt gebouwd, inclusief anti-spam en een robotcheck, maar staat achter een **overlay** met de tekst dat het formulier binnenkort komt en dat je voor nu mailt naar info@andreaslop.nl. Het e-mailadres in de overlay komt uit `siteContent.email` en wordt pas in de browser samengevoegd, net als in de footer (anti-spam).
- **Layout en stijl** komen uit het ontwerp (`design/andreaslop-static`). Teksten en afbeeldingen staan als vaste data in `content/`, in de vorm die de API straks levert.
- **"Lees mijn verhaal"** in het blok Over mij linkt naar `/over-mij` (nu nog een placeholder).
Wat ik op de live site (andreaslop.nl) zag en wat afwijkt van het ontwerp:
| Onderdeel | Ontwerp | Live site |
| ------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Prijzen | Newborn € 185, Zwangerschap € 175, **Loveshoot** € 175 · "1 uur, 15–20 foto's" | Zwangerschap € 175, Newborn € 185, **Gezin** € 175 · "1 uur (newborn 1–2 uur), minstens 30/40 zorgvuldig nabewerkte foto's, persoonlijke online fotogalerij" |
| Galerij | intro-1 t/m 4 | 4 andere, nieuwere foto's (2025/2026) |
| Formulier | Naam, E-mail, Onderwerp (vrije tekst), Bericht | Naam, E-mail, **"In welke shoot heb je interesse?"** (Zwangerschap / Newborn / Familie / Overig), Bericht · knop "(Aan)vraag versturen" |
| Lieve woorden | ontbreekt | slider met per review een foto, de soort shoot als titel, de tekst en de namen (2 reviews: Trouwshoot – Majella & Mark, Newbornshoot – Demi & Kevin) |
| Instagram | raster van 6 vaste foto's met link naar het profiel | WordPress-widget die op dit moment **niet werkt** ("you haven't connected with your Instagram account") |
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe.
---
## Vraag 1: Bron voor de inhoud
Waar komen teksten, prijzen en foto's vandaan als ontwerp en live site verschillen?
- A) De live site voor de inhoud (prijzen, pakketten, galerijfoto's, formuliervelden, reviews) en het ontwerp voor layout en stijl. De live site is het nieuwst. (aanbevolen)
- B) Het ontwerp voor alles; de live inhoud zet Andrea later via de API/CMS goed
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 2: Ontwerp van "Lieve woorden"
Hoe moet het blok eruitzien? In alle varianten: kop "Lieve woorden", de stijl van het ontwerp (Marcellus-koppen, papierkleuren, heidegroen accent) en per review de soort shoot, de tekst en de namen.
- A) **Eén review tegelijk, groot.** Foto links, aan de rechterkant een groot aanhalingsteken als decoratie, de soort shoot als label, de tekst in Marcellus en daaronder de namen. Vorige/volgende-knoppen en puntjes; **geen automatisch doorspelen**. Lijkt het meest op de live site en blijft rustig. (aanbevolen)
- B) **Kaarten naast elkaar.** Twee of drie kaarten in een raster (op mobiel onder elkaar), elk met een kleine ronde foto, de tekst en de namen. Geen slider: alle reviews zijn meteen zichtbaar. Werkt goed tot ongeveer 3–6 reviews.
- C) **Alleen tekst, gecentreerd.** Eén grote quote zonder foto op een `paper.alt`-achtergrond, met vorige/volgende-knoppen. Het meest minimalistisch; de foto's van de live site vervallen.
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 3: Ontwerp eerst in de statische design-map?
Het ontwerp in `design/andreaslop-static` is de bron voor layout ([LAYOUT.md](../../../../../LAYOUT.md)). Lieve woorden staat er nog niet in.
- A) Ja: eerst het gekozen ontwerp toevoegen aan `design/andreaslop-static` (index.html + style.css) en [LAYOUT.md](../../../../../LAYOUT.md) bijwerken. Dan kun je het in de browser bekijken en goedkeuren voordat het in React komt. De inhoud van het ontwerp (prijzen, formuliervelden) zet ik daarbij ook gelijk aan de live site, als je bij vraag 1 voor A kiest. (aanbevolen)
- B) Alleen [LAYOUT.md](../../../../../LAYOUT.md) bijwerken en het ontwerp direct in React bouwen; de statische map blijft zoals hij is
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 4: Positie van "Lieve woorden"
Op de live site staat het blok tussen Prijzen en Contact.
- A) Tussen Prijzen en Contact, zoals op de live site. Volgorde: Hero, Lifestyle fotografie, Over mij, Prijzen, Lieve woorden, Contact, Instagram (aanbevolen)
- B) Tussen Over mij en Prijzen
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 5: Foto's
De foto's van de live site (galerij, Andrea, reviews) moeten in de repo komen. Hoe gaan we daarmee om?
- A) Ik download ze van andreaslop.nl, verklein ze eenmalig (maximaal ±1600 px breed, goed gecomprimeerd) en zet ze in `web/src/assets`. Geen nieuwe dependency, en de homepage blijft binnen het Lighthouse-budget. (aanbevolen)
- B) Zoals A, maar ook automatisch meerdere formaten (srcset/WebP) bij het bouwen, met een Vite-plugin. Dat is een nieuwe dependency; het verhelpt ook de bekende schuld bij de hero-foto's.
- C) Andrea levert de foto's zelf aan; tot die tijd gebruik ik de foto's uit het ontwerp
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 6: Instagram-blok
Een echte live feed kan alleen via de API van Meta met een toegangstoken. Op een statische site staat dat token voor iedereen leesbaar in de browser. Een externe widget laadt scripts en cookies van derden, en daarvoor moet de CSP worden aangepast.
- A) Kop "Instagram", @andreaslopfotografie als link en een raster van 6 vast gekozen foto's die naar het profiel linken, zoals in het ontwerp. De lijst foto's staat in `content/`, zodat de .NET API hem later kan vullen met de echte feed (die haalt hem dan veilig op aan de serverkant). (aanbevolen)
- B) Een externe widget (bijv. Behold of SnapWidget) voor een live feed nu al, inclusief CSP-aanpassing en een vermelding in de privacyverklaring
- C) Alleen de kop, de handle en een knop "Volg mij op Instagram", zonder foto's
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 7: Velden van het contactformulier
- A) Zoals op de live site: Naam, E-mail, "In welke shoot heb je interesse?" (keuzelijst) en Bericht, met de knop "(Aan)vraag versturen" (aanbevolen)
- B) Zoals in het ontwerp: Naam, E-mail, Onderwerp (vrije tekst) en Bericht, met de knop "Verzenden"
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 8: Keuzes in de keuzelijst (alleen bij 7A)
Op de live site heet het pakket **Gezin**, maar in de keuzelijst staat **Familie**.
- A) Dezelfde namen als de pakketten: Zwangerschap, Newborn, Gezin, Overig. De lijst komt dan uit dezelfde data als de prijskaarten en loopt daardoor nooit uit de pas. (aanbevolen)
- B) Precies zoals live: Zwangerschap, Newborn, Familie, Overig
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 9: Knop "Boek je shoot" bij de prijskaarten
- A) Scrollt naar het contactblok op de homepage en kiest het bijbehorende pakket alvast in de keuzelijst. Nu het formulier nog achter de overlay zit, kom je zo direct bij de e-mailtekst uit. (aanbevolen)
- B) Scrollt alleen naar het contactblok, zonder iets voor te kiezen
- C) Gaat naar de pagina `/contact` (nu nog een placeholder)
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 10: De overlay over het formulier
Wat ziet en kan een bezoeker zolang het formulier nog niet werkt?
- A) Het formulier is zichtbaar maar gedempt (vervaagd) en is **niet** te bedienen: de velden zijn `inert`, dus toetsenbord- en schermlezergebruikers komen niet in een formulier terecht dat niets doet. Over het formulier staat een paneel met de tekst "Het contactformulier komt binnenkort. Mail me voor nu op info@andreaslop.nl" en een knop "Stuur een e-mail" (mailto). (aanbevolen)
- B) Zoals A, maar het formulier is wel in te vullen; bij Verzenden opent het e-mailprogramma met de ingevulde gegevens (naam, shoot en bericht al in de mail)
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 11: Hoe zetten we de overlay later uit?
- A) Met één instelling in de code (bijv. `contactFormEnabled: false`), gekoppeld aan de verzendfunctie `submitContactForm`. Als de API er is: de functie invullen en de instelling op `true` zetten (aanbevolen)
- B) Als het formulier aangaat, haal ik de overlay helemaal weg; nu geen instelling
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A, Als we het er dan toch inbouwen dan kan ik het later ook makkelijk uitzetten mocht dat nodig zijn.
## Vraag 12: Anti-spam
Welke maatregelen bouwen we nu al in het formulier? Let op: echte bescherming vraagt altijd ook controle aan de serverkant (de API). Wat hier staat, is de kant van de browser.
- A) Een honeypot (verborgen veld dat alleen bots invullen) en een tijdcheck (minder dan ±3 seconden tussen laden en verzenden = bot). Beide als kleine, geteste functies in `lib/`. Daarnaast een maximale lengte per veld. Rate limiting en de echte controle komen in de API-feature. (aanbevolen)
- B) Alleen een honeypot
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 13: Robotcheck (captcha)
Een captcha geeft een token dat de server moet controleren. Zonder API kan het formulier de check dus nog niet echt gebruiken.
- A) **Nu kiezen, inbouwen in de API-feature.** We kiezen nu de dienst (zie vraag 14) en leggen dat vast. Het formulier krijgt een plek voor de widget, maar het script wordt pas geladen als het formulier aangaat. Zo komt er nu geen script van derden op de site voor een formulier dat nog niets doet. (aanbevolen)
- B) **Nu al inbouwen** achter de overlay, inclusief CSP-aanpassing (script-src, frame-src, connect-src) en een vermelding in de privacyverklaring
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 14: Welke robotcheck?
- A) **Cloudflare Turnstile**: gratis, meestal onzichtbaar (geen puzzels), zonder tracking-cookies. Een goede balans tussen gemak en privacy (aanbevolen)
- B) **Friendly Captcha**: Europees (Duits), volledig AVG-gericht, onzichtbaar (proof-of-work); gratis voor kleine sites
- C) **hCaptcha**: gratis, maar vaker puzzels voor bezoekers
- D) **Google reCAPTCHA**: bekend, maar stuurt gegevens naar Google; minder geschikt onder de AVG
- E) Nog niet kiezen; beslissen in de API-feature
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B
## Vraag 15: Animatie bij het scrollen
Het ontwerp laat blokken zacht invagen bij het scrollen (`.reveal`).
- A) Ja, overnemen als kleine hook (`useReveal` met IntersectionObserver), uitgeschakeld bij `prefers-reduced-motion`. Zonder JavaScript of observer is de inhoud gewoon zichtbaar (aanbevolen)
- B) Nee, geen scroll-animaties
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 16: De pagina /contact
Het contactformulier wordt een herbruikbaar component. Komt het in deze feature ook op `/contact`?
- A) Nee, `/contact` blijft een placeholder. De contactpagina wordt een eigen feature en gebruikt dan hetzelfde component (aanbevolen)
- B) Ja, het formulier (met overlay) komt ook op `/contact`
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag: Beveiligingsextensies
Moeten de beveiligingsregels als harde vereisten worden afgedwongen voor dit project? (Bij de shell stond dit op Ja.)
- A) Ja — dwing alle BEVEILIGINGSREGELS af als blokkerende vereisten (aanbevolen voor productietoepassingen)
- B) Nee — sla alle BEVEILIGINGSREGELS over (geschikt voor PoC's, prototypes en experimentele projecten)
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag: Property-Based Testing Extensie
Moeten de property-based testing (PBT) regels worden afgedwongen voor dit project? (Bij de shell stond dit op Ja, volledig.)
- A) Ja — dwing alle PBT-regels af als blokkerende vereisten (aanbevolen voor projecten met bedrijfslogica, datatransformaties, serialisatie of stateful componenten)
- B) Gedeeltelijk — dwing PBT-regels alleen af voor pure functies en serialisatie round-trips (geschikt voor projecten met beperkte algoritmische complexiteit)
- C) Nee — sla alle PBT-regels over (geschikt voor eenvoudige CRUD-applicaties, UI-only projecten of dunne integratielagen zonder significante bedrijfslogica)
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag: Operations-fase
Moet deze feature na Construction door de Operations-fase (deployment en monitoring)? De pipeline en monitoring bestaan al sinds de shell.
- A) Ja — draai de Operations-fase na Construction (deployment + monitoring)
- B) Nee — stop na Build and Test; de bestaande pipeline deployt naar test bij een merge naar master
- C) Weet ik nog niet — vraag het me opnieuw na de Construction-fase
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: C
@@ -0,0 +1,213 @@
# Requirements — Homepage Sections
## Intent Analysis
- **User Request**: add the homepage blocks below the existing hero with AI-DLC, one feature with one unit per block; suggest a temporary solution for the contact form while there is no back-end. Extended at Reverse Engineering review with the Instagram block and the "Lieve woorden" (testimonials) block from the live site, and with a contact form overlay, anti-spam and a robot check.
- **Request Type**: New Feature (new user-facing sections on an existing page)
- **Scope Estimate**: Multiple components within one package (`web/`), plus the static design reference (`design/andreaslop-static/`) and [LAYOUT.md](../../../../../LAYOUT.md)
- **Complexity Estimate**: Moderate — six mostly presentational sections, one small carousel, one form with validation and anti-spam logic, content and image preparation
- **Requirements Depth**: Standard
## Source of Truth
- **Layout and styling**: `design/andreaslop-static/` (`index.html`, `assets/css/style.css`) and [LAYOUT.md](../../../../../LAYOUT.md). *Source: Q1 = A*
- **Content** (texts, prices, packages, photos, form fields, reviews): the live site https://andreaslop.nl/ as of 2026-10-19, because it is newer than the design. *Source: Q1 = A*
- **Decisions**: [requirement-verification-questions.md](requirement-verification-questions.md)
## Section Order
Hero (exists) → **Lifestyle fotografie** → **Over mij** → **Prijzen** → **Lieve woorden** → **Contact** → **Instagram**. *Source: Q4 = A*
Each of the six new sections is a separate unit of work.
## Out of Scope
- The hero (exists; unchanged)
- A working contact form submission, server-side spam checks, rate limiting and the actual robot check integration — all part of the future API feature
- The `/contact` page (stays a placeholder; it will reuse the contact form component in its own feature). *Source: Q16 = A*
- A live Instagram feed (needs the API). *Source: Q6 = A*
- The decorative banner image between Prices and Lieve woorden on the live site (`landing-img-18.png`) and the decoration next to the live contact form — the design's own pricing decorations are used instead
- Responsive image pipeline (srcset/WebP). *Source: Q5 = A*
- Operations phase: undecided, asked again at Build and Test. *Source: Operations = C*
---
## Functional Requirements
### FR-HP-01 Static design and LAYOUT.md updated first
- Add the **Lieve woorden** section to `design/andreaslop-static/index.html` and its styles to `assets/css/style.css`, following the chosen design (FR-HP-05), so it can be reviewed in the browser before it is built in React.
- Align the static design's homepage **content** with the live site: price cards (FR-HP-04) and contact form fields (FR-HP-06).
- Update the Home diagram in [LAYOUT.md](../../../../../LAYOUT.md) to the seven blocks in the section order above, following [.ai/layout-conventions.md](../../../../../.ai/layout-conventions.md).
- *Source: Q3 = A, user request ("eventueel verwerken in het design in deze workspace")*
### FR-HP-02 Lifestyle fotografie
- Heading **"Lifestyle fotografie"** (h2) with lead text "Jouw favoriete momenten, vastgelegd op een natuurlijke en ongedwongen manier."
- A gallery of **four photos** (the four current live photos), layout as `.intro-gallery` in the design: 4 columns on desktop, 2 on tablet.
- **On phones one photo at a time** in a horizontally swipeable row (scroll snap), with the next photo peeking in so it is clear there is more; the row is keyboard-scrollable. *Source: user change request at unit 1 review*
- Every photo has a descriptive Dutch alt text (to be reviewed by Andrea).
- The live page's stray headings "Foto2" and "Foto" are not carried over.
- *Source: Q1 = A*
### FR-HP-03 Over mij
- Photo of Andrea (live photo) next to the text block, layout as `.about` in the design, on the `paper.alt` background.
- Eyebrow **"Over mij"**, heading **"Lifestyle fotograaf met een passie voor storytelling"** (h2) and the three paragraphs from the live site / design (identical).
- Link **"Lees mijn verhaal"** to `/over-mij`.
### FR-HP-04 Prijzen
- Heading **"Prijzen"** (h2) with lead "Pakketten", and the design's two decorative images (`deco-1.png`, `deco-2.png`, decorative only).
- Three price cards (h3 per package), in the live order and with the live content:
| Package | Price | Included |
|---|---|---|
| Zwangerschap | € 175 | 1 uur fotografie · Minstens 30 zorgvuldig nabewerkte foto's · Persoonlijke online fotogalerij |
| Newborn | € 185 | 1-2 uur fotografie · Minstens 40 zorgvuldig nabewerkte foto's · Persoonlijke online fotogalerij |
| Gezin | € 175 | 1 uur fotografie · Minstens 30 zorgvuldig nabewerkte foto's · Persoonlijke online fotogalerij |
- Each card has a **"Boek je shoot"** button that moves to the contact section on the homepage and preselects that package in the shoot field (FR-HP-06). *Source: Q9 = A*
- The packages are one data list in `content/`; the price cards and the shoot field options are both derived from it. *Source: Q8 = A*
### FR-HP-05 Lieve woorden (testimonials)
- Heading **"Lieve woorden"** (h2).
- **One review at a time, large**: photo on the left; on the right a large decorative quotation mark, the shoot type as a label, the review text in Marcellus and the names below it. Stacked on small screens. *Source: Q2 = A*
- **Previous/next buttons and dots**; **no autoplay**. Keyboard operable; the change of review is announced to screen readers. With only one review the controls are not shown.
- Content (from the live site, each with its live photo):
- **Trouwshoot** — "Super mooie foto's door Andrea gemaakt op onze trouwdag en pré-wedding shoot. Wij zijn er super blij mee! Een aantal hebben wij laten afdrukken en hangen nu ingelijst aan de muur, dus wij genieten er nog elke dag van." — *Majella & Mark*
- **Newbornshoot** — "Heel tevreden met de newbornshoot. De foto's zijn prachtig geworden en we zijn erg blij met het resultaat. Zeker aan te raden!" — *Demi & Kevin*
- The data list supports any number of reviews, so more can be added later without code changes.
- *Source: user request, Q2 = A, Q4 = A*
### FR-HP-06 Contact — form
- Heading **"Contact"** (h2) with lead "Wil je meer informatie ontvangen? Neem gerust contact met mij op." Section anchor `#contact`.
- Fields (live site): **Naam**, **E-mail**, **"In welke shoot heb je interesse?"** (select: the package names + **Overig**, with an empty "Kies een optie..." default), **Bericht** ("Stel hier je vraag"). Submit button **"(Aan)vraag versturen"**. *Source: Q7 = A, Q8 = A*
- Client-side validation with an error message per field and `aria-invalid`, as in the design: required fields, valid e-mail format, maximum lengths.
- Submission goes through **one function `submitContactForm(payload)`**. Until the API exists it is not called (see FR-HP-07); the payload shape is ready for `POST /api/contact`.
- The form is a reusable component so the `/contact` page can use it later. *Source: Q16 = A*
### FR-HP-07 Contact — "coming soon" overlay
- While the form is switched off, it is visible but **dimmed** and **cannot be used**: the fields are `inert`, so keyboard and screen reader users never land in a form that does nothing.
- Over the form is a panel with the text **"Het contactformulier komt binnenkort. Mail me voor nu op info@andreaslop.nl"** and a button **"Stuur een e-mail"** (mailto).
- The e-mail address comes from `siteContent.email` and is assembled only in the browser, as in the footer (anti-spam). If the address is invalid, the panel still shows the coming-soon text without the address and button.
- **One setting** (`contactFormEnabled`) switches between overlay and working form, in both directions, so the form can also be switched off again later if needed. *Source: Q10 = A, Q11 = A (+ user note)*
### FR-HP-08 Contact — anti-spam (browser side)
- A **honeypot** field: hidden from sighted users and assistive technology, not focusable, no autocomplete. A filled honeypot means the submission is treated as spam.
- A **time check**: a submission less than ±3 seconds after the form was shown is treated as spam.
- Spam is rejected silently (the visitor sees the normal success flow; nothing is sent).
- Both checks are small pure functions in `lib/` with tests.
- Server-side checks and rate limiting are required in the API feature; the browser checks are not the only line of defence.
- *Source: Q12 = A*
### FR-HP-09 Contact — robot check (decided, integrated later)
- The chosen service is **Friendly Captcha** (EU, privacy-friendly, invisible proof-of-work). *Source: Q14 = B*
- The form has a place for the widget, but **no Friendly Captcha script is loaded** in this feature; it is integrated, together with server-side token verification and the required CSP changes, in the API feature. *Source: Q13 = A*
### FR-HP-10 Instagram
- Heading **"Instagram"** (h2) with **@andreaslopfotografie** as a link to the profile.
- A grid of **six fixed photos**, each linking to the profile, layout as `.instagram__grid` in the design.
- The photo list lives in `content/`, so the API can later fill it with the real feed (fetched server-side).
- Initial selection: six existing site photos (Andrea can swap them).
- *Source: Q6 = A*
### FR-HP-11 Scroll reveal
- Sections fade in gently when scrolled into view, as `.reveal` in the design, via a small `useReveal` hook (IntersectionObserver).
- Disabled under `prefers-reduced-motion`. Without JavaScript or IntersectionObserver the content is simply visible.
- *Source: Q15 = A*
### FR-HP-12 Content and images
- All section content lives as API-shaped static data in `web/src/content/` with interfaces in `content/types.ts`, passed into the components from the home route.
- Photos are downloaded from andreaslop.nl (and the design for the decorations), resized once to at most ±1600 px wide, compressed, and stored in `web/src/assets`. No new dependency. *Source: Q5 = A*
---
## Non-Functional Requirements
### NFR-HP-01 Accessibility (WCAG 2.1 AA as guideline)
- The hero title remains the page's only h1; sections use h2, cards and reviews h3 where a heading is needed.
- Each section is a `section` with an accessible name (its heading).
- Text contrast ≥ 4.5:1: reuse the shell's choices (`ink.soft` instead of `ink.muted`, `accent.deep` instead of `accent` for small text on light backgrounds). The overlay panel text keeps full contrast; only the form behind it is dimmed.
- Form: visible labels linked to fields, errors linked via `aria-describedby`, error announcement, focus to the first invalid field on submit.
- Carousel: buttons with Dutch labels, current dot marked (`aria-current`), polite live region for manual changes, no autoplay.
- Touch targets ≥ 44×44 px; keyboard operable; visible focus ring (theme).
- `prefers-reduced-motion` respected (reveal, carousel transitions, smooth scrolling to `#contact`).
- Axe checks in the component tests; Lighthouse accessibility stays 1.0.
### NFR-HP-02 Styling and consistency
- Same principles as the shell (frontend-shell NFR-02/02a): reuse theme tokens, text styles, recipes and components first (`LinkButton`, `linkButton` variants, `eyebrow`, `paper.alt`, `Container`); use Chakra primitives where they fit; lift repeated styling (e.g. the section heading block used by five sections) into a shared component or recipe; no hard-coded colours, CSS files or Tailwind.
- Components in their own folders under `components/`, Prettier style.
- **Code comments in English** in all new code, including new comments added to existing files. Existing Dutch comments are not translated as part of this feature. Visitor-facing texts (labels, messages, alt texts, aria labels) stay Dutch. *Source: user change request at Requirements review*
- Responsive from 320 px to ultrawide, mobile-first, no horizontal scroll, works at 200% zoom.
### NFR-HP-03 Testing
- **Example-based tests** per section: rendered content, links and attributes, carousel controls, form validation messages, overlay behaviour (inert form, mailto, toggle), "Boek je shoot" preselection, axe checks.
- **Property-based tests** (fast-check, existing setup and shared arbitraries) for the pure logic, e.g. form validation, honeypot/time check, shoot options derived from packages, carousel index wrapping.
- Coverage: new pure helpers in `src/lib/**` fall under the existing 100% threshold.
- `pnpm check` (lint, format, tests, build, audits, Lighthouse) passes.
- *Source: PBT extension = A (full)*
### NFR-HP-04 Security (Security Baseline extension enabled)
- **No new third parties**: no external scripts, widgets, fonts or form endpoints in this feature. The CSP in `web/config/securityHeaders.ts` stays unchanged (`form-action 'self'`, `connect-src` self/Umami/Sentry).
- **External links** (Instagram) use `target="_blank"` with `rel="noopener noreferrer"` and a "opent in nieuw tabblad" hint for screen readers, as in the footer.
- **E-mail address** never appears literally in HTML, bundle or content (assembled in the browser).
- **Input handling**: client-side length limits and format checks on all fields; user input is rendered only as text by React (no HTML injection). The payload is ready for server-side validation in the API (SECURITY-05 applies there).
- **Defence in depth / misuse**: honeypot + time check now; Friendly Captcha + server-side validation + rate limiting in the API feature (SECURITY-11). The overlay disables the form entirely while there is no server.
- **Fail safe**: a failing `submitContactForm` shows a generic message and leaves the visitor's input intact; no internal details (SECURITY-15).
- **Dependencies**: no new runtime dependencies (SECURITY-10).
- **For the API feature**: Friendly Captcha requires CSP additions (script/worker and connect to its EU endpoint) and a privacy statement entry — recorded here, not done now.
### NFR-HP-05 Performance
- The homepage mobile Lighthouse budget (performance 0.8, see `lighthouserc.cjs`) and desktop 0.9 still pass.
- All new images are below the fold: `loading="lazy"`, explicit width/height (no layout shift), compressed per FR-HP-12.
- No new network requests other than the bundled images.
### NFR-HP-06 Content for the future API
- Content interfaces are plain data (strings, numbers, arrays, image references) so the API can deliver them 1-to-1: `PricingPackage`, `Testimonial`, `GalleryPhoto`, `InstagramContent` and the section texts.
- The contact payload is `{ naam, email, shoot, bericht }` (the design's `onderwerp` becomes the shoot choice).
---
## Extension Compliance — Requirements Level
### Security Baseline
| Rule | Status | Rationale |
|---|---|---|
| SECURITY-01 Encryption | N/A | No data stores |
| SECURITY-02 Access logging | N/A | No intermediaries added; hosting unchanged |
| SECURITY-03 Application logging | N/A | No server-side component; client errors already go to Sentry |
| SECURITY-04 HTTP security headers | Compliant | Existing header set unchanged; no CSP loosening (NFR-HP-04) |
| SECURITY-05 Input validation | Compliant (planned) | No API endpoint in this feature; client-side limits/format checks now, server-side validation required in the API feature |
| SECURITY-06 Least privilege | N/A | No IAM |
| SECURITY-07 Network configuration | N/A | No network infrastructure |
| SECURITY-08 Access control | N/A | Public content, no protected resources |
| SECURITY-09 Hardening | Compliant (planned) | No debug output; generic messages |
| SECURITY-10 Supply chain | Compliant (planned) | No new dependencies |
| SECURITY-11 Secure design | Compliant (planned) | Misuse case (form spam) addressed: overlay, honeypot, time check; captcha + rate limiting assigned to the API feature |
| SECURITY-12 Authentication | N/A | No authentication |
| SECURITY-13 Integrity | Compliant | No external CDN resources; captcha script deferred |
| SECURITY-14 Alerting | N/A | No server-side component; existing monitoring unchanged |
| SECURITY-15 Exception handling | Compliant (planned) | Generic failure message in the form; existing global error handling |
### Property-Based Testing
| Rule | Status | Rationale |
|---|---|---|
| PBT-01 Property identification | Planned | Done per unit in Functional Design |
| PBT-02 … PBT-06 | Planned | Applied to the pure helpers identified in Functional Design (validation invariants, carousel index wrapping, derived shoot options) |
| PBT-07 Generators | Planned | Domain generators added to `src/test/arbitraries.ts` |
| PBT-08 Shrinking/reproducibility | Compliant | Existing seed logging and shrinking (`config/testSeed.ts`) |
| PBT-09 Framework | Compliant | fast-check already configured |
| PBT-10 Complementary testing | Planned | Example-based tests per section alongside PBT |
---
## Summary of Key Decisions
| # | Decision |
|---|---|
| Q1 | Content from the live site, layout/style from the design |
| Q2 | Lieve woorden: one large review at a time, photo + quote, prev/next + dots, no autoplay |
| Q3 | Add Lieve woorden (and live content) to the static design and LAYOUT.md first |
| Q4 | Lieve woorden between Prijzen and Contact |
| Q5 | Download live photos, resize once, no new dependency |
| Q6 | Instagram: fixed grid of 6 photos in `content/`, real feed later via the API |
| Q7 / Q8 | Live form fields; shoot options = package names + Overig |
| Q9 | "Boek je shoot" scrolls to contact and preselects the package |
| Q10 / Q11 | Dimmed, inert form under a coming-soon overlay with mailto; one setting toggles it both ways |
| Q12 | Honeypot + time check + length limits now |
| Q13 / Q14 | Robot check: Friendly Captcha, integrated in the API feature |
| Q15 | Scroll reveal with reduced-motion support |
| Q16 | `/contact` stays a placeholder |
| Ext. | Security Baseline: Yes · PBT: Yes (full) · Operations: undecided |
+166 -9
View File
@@ -804,15 +804,8 @@ p:last-child { margin-bottom: 0; }
border-radius: var(--radius);
background: var(--c-white);
text-align: center;
transition: transform var(--dur) var(--ease),
box-shadow var(--dur) var(--ease),
border-color var(--dur) var(--ease);
}
.price-card:hover {
transform: translateY(-6px);
border-color: var(--c-accent);
box-shadow: var(--shadow-md);
}
/* No hover effect on the card itself (owner's choice); only the button reacts */
.price-card__name {
margin-bottom: .75rem;
@@ -851,6 +844,101 @@ p:last-child { margin-bottom: 0; }
.pricing__deco--2 { bottom: 6%; right: 3%; }
.pricing .container { position: relative; z-index: 1; }
/* ==========================================================================
13b. Lieve woorden (testimonials)
One review at a time: photo with the sand offset block (shared with the
about block), a large quotation mark, shoot type, quote and names.
========================================================================== */
.testimonials__track { display: grid; }
.testimonial {
display: grid;
grid-template-columns: 5fr 11fr;
gap: clamp(2rem, 6vw, 5.5rem);
align-items: center;
animation: testimonial-in var(--dur) var(--ease);
}
.testimonial[hidden] { display: none; }
@keyframes testimonial-in {
from { opacity: 0; }
to { opacity: 1; }
}
.testimonial__media img { aspect-ratio: 4 / 5; }
.testimonial__body { position: relative; margin: 0; }
.testimonial__mark {
display: block;
height: .55em;
color: var(--c-accent);
font-family: var(--font-display);
font-size: clamp(5rem, 9vw, 7.5rem);
line-height: 1;
}
.testimonial__quote {
margin: 0 0 1.75rem;
color: var(--c-ink);
font-family: var(--font-display);
font-size: clamp(1.35rem, 2.2vw, 1.75rem);
line-height: 1.5;
}
.testimonial__author {
color: var(--c-ink-soft);
font-size: var(--fs-eyebrow);
letter-spacing: var(--ls-wide);
text-transform: uppercase;
}
.testimonial__author::before { content: '— '; }
.testimonials__controls {
display: flex;
align-items: center;
justify-content: center;
gap: 1.5rem;
margin-top: clamp(2.5rem, 5vw, 4rem);
}
.testimonials__controls[hidden] { display: none; }
.testimonials__arrow {
display: inline-flex;
align-items: center;
justify-content: center;
width: 48px; height: 48px;
border: 1px solid var(--c-line);
background: transparent;
color: var(--c-ink);
font-size: 1.1rem;
transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.testimonials__arrow:hover,
.testimonials__arrow:focus-visible { border-color: var(--c-ink); background: var(--c-paper); }
.testimonials__dots { display: flex; gap: .25rem; }
/* 44px hit area around a small visible dot */
.testimonials__dot {
position: relative;
width: 44px; height: 44px;
border: 0;
background: transparent;
}
.testimonials__dot::after {
content: '';
position: absolute;
inset: 50% auto auto 50%;
width: 8px; height: 8px;
border: 1px solid var(--c-accent-deep);
border-radius: 50%;
transform: translate(-50%, -50%);
transition: background var(--dur) var(--ease);
}
.testimonials__dot[aria-current='true']::after { background: var(--c-accent-deep); }
/* ==========================================================================
14. Soorten fotoshoots
========================================================================== */
@@ -1051,6 +1139,59 @@ p:last-child { margin-bottom: 0; }
.form__textarea { min-height: 170px; resize: vertical; }
/* Native select in the input style, with a drawn chevron */
.form__select {
appearance: none;
padding-right: 2.75rem;
background-image: linear-gradient(45deg, transparent 50%, var(--c-ink-soft) 50%),
linear-gradient(135deg, var(--c-ink-soft) 50%, transparent 50%);
background-position: calc(100% - 1.4rem) 50%, calc(100% - 1.05rem) 50%;
background-size: .35rem .35rem;
background-repeat: no-repeat;
}
.form__select:focus {
outline: none;
border-color: var(--c-accent);
box-shadow: 0 0 0 3px rgba(127, 139, 118, .18);
}
.form__select[aria-invalid='true'] { border-color: #a4443a; }
/* Honeypot: off-screen for people, still in the DOM for bots */
.form__hp {
position: absolute;
left: -10000px;
width: 1px; height: 1px;
overflow: hidden;
}
/* "Coming soon" gate: the form stays visible but dimmed and inert under a
notice, until there is a back-end. */
.form-gate { position: relative; }
.form-gate[data-form-disabled] .form {
opacity: .35;
filter: blur(1.5px);
user-select: none;
}
.form-gate__notice {
position: absolute;
inset: 50% auto auto 50%;
width: min(100%, 520px);
padding: clamp(2rem, 4vw, 3rem);
border: 1px solid var(--c-line);
background: var(--c-white);
box-shadow: var(--shadow-md);
text-align: center;
transform: translate(-50%, -50%);
}
.form-gate__notice[hidden] { display: none; }
.form-gate__text {
margin-bottom: 1.75rem;
color: var(--c-ink-soft);
}
.form__error {
color: #a4443a;
font-size: var(--fs-small);
@@ -1230,8 +1371,11 @@ p:last-child { margin-bottom: 0; }
.about,
.shoot,
.testimonial,
.contact-layout { grid-template-columns: 1fr; }
.testimonial__media { width: 100%; max-width: 320px; margin-inline: auto; }
.about--reverse .about__media,
.shoot:nth-child(even) .shoot__media { order: 0; }
@@ -1256,7 +1400,19 @@ p:last-child { margin-bottom: 0; }
.hero__socials { bottom: 1.5rem; flex-direction: row; }
.hero__scroll { display: none; }
.intro-gallery { grid-template-columns: 1fr; }
/* Phones: one photo at a time in a swipeable row, the next one peeking in */
.intro-gallery:not(.intro-gallery--duo) {
display: flex;
overflow-x: auto;
scroll-snap-type: x mandatory;
scroll-padding-inline: var(--gutter);
margin-inline: calc(-1 * var(--gutter));
padding-inline: var(--gutter);
scrollbar-width: none;
}
.intro-gallery:not(.intro-gallery--duo)::-webkit-scrollbar { display: none; }
.intro-gallery:not(.intro-gallery--duo) figure { flex: 0 0 85%; scroll-snap-align: center; }
.intro-gallery--duo { grid-template-columns: 1fr; }
.intro-gallery figure { margin-top: 0 !important; }
.portfolio-grid { grid-template-columns: 1fr; }
@@ -1268,6 +1424,7 @@ p:last-child { margin-bottom: 0; }
.footer__bottom { flex-direction: column; text-align: center; }
.about__media::before { display: none; }
.testimonial__media { max-width: 180px; }
}
/* ==========================================================================
Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 KiB

After

Width:  |  Height:  |  Size: 420 KiB

@@ -21,7 +21,7 @@ hero-6.jpg https://andreaslop.nl/wp-content/uploads/2024/09/DSC_0433-1-2048x1362
# --- Home: introgalerij ---
intro-1.jpg https://andreaslop.nl/wp-content/uploads/2026/04/F41A7270_websize.jpg
intro-2.jpg https://andreaslop.nl/wp-content/uploads/2026/04/F41A7176_websize.jpg
intro-3.jpg https://andreaslop.nl/wp-content/uploads/2019/11/F41A8722_websize.jpg
intro-3.jpg https://andreaslop.nl/wp-content/uploads/2019/11/F41A9474_websize.jpg
intro-4.jpg https://andreaslop.nl/wp-content/uploads/2025/09/F41A7883_websize.jpg
# --- Portretten van Andrea ---
@@ -45,6 +45,8 @@ portfolio-6.jpg https://andreaslop.nl/wp-content/uploads/2019/11/5-F41A4650-scal
portfolio-7.jpg https://andreaslop.nl/wp-content/uploads/2026/04/F41A7138_websize.jpg
portfolio-8.jpg https://andreaslop.nl/wp-content/uploads/2026/04/F41A7284_websize.jpg
# --- Lieve woorden: hergebruikt hero-5.jpg (Trouwshoot) en portfolio-6.jpg (Newbornshoot) ---
# --- Decoratie prijzensectie ---
deco-1.png https://andreaslop.nl/wp-content/uploads/2020/01/landing-img-18.png
deco-2.png https://andreaslop.nl/wp-content/uploads/2020/01/h1-img-16.png
+121 -22
View File
@@ -265,15 +265,36 @@
});
}
// Submissions faster than this after the form appeared are treated as bots.
var MIN_FILL_MS = 3000;
function initContactForm() {
var forms = Array.prototype.slice.call(document.querySelectorAll('[data-contact-form]'));
if (!forms.length) return;
var emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
// Required-field messages. The home form asks for a shoot type, the
// contact page still has a free-text subject; validate whichever exists.
var requiredMessages = {
naam: 'Vul je naam in.',
onderwerp: 'Vul een onderwerp in.',
shoot: 'Kies een soort shoot.',
bericht: 'Schrijf hier je vraag.'
};
// "Boek je shoot" links to ?pakket=<id>#contact; preselect that package.
var requestedPackage = new URLSearchParams(window.location.search).get('pakket');
forms.forEach(function (form) {
var status = form.querySelector('[data-form-status]');
var submit = form.querySelector('[type="submit"]');
var shownAt = Date.now();
if (requestedPackage && form.elements.shoot) {
var option = form.elements.shoot.querySelector('option[value="' + CSS.escape(requestedPackage) + '"]');
if (option) form.elements.shoot.value = requestedPackage;
}
function setError(field, message) {
var wrapper = field.closest('.form__field');
@@ -286,8 +307,11 @@
function validate() {
var valid = true;
var naam = form.elements.naam;
valid = setError(naam, naam.value.trim() ? '' : 'Vul je naam in.') && valid;
Object.keys(requiredMessages).forEach(function (name) {
var field = form.elements[name];
if (!field) return;
valid = setError(field, field.value.trim() ? '' : requiredMessages[name]) && valid;
});
var email = form.elements.email;
var emailValue = email.value.trim();
@@ -296,15 +320,21 @@
else if (!emailPattern.test(emailValue)) emailMessage = 'Dit e-mailadres klopt nog niet.';
valid = setError(email, emailMessage) && valid;
var onderwerp = form.elements.onderwerp;
valid = setError(onderwerp, onderwerp.value.trim() ? '' : 'Vul een onderwerp in.') && valid;
var bericht = form.elements.bericht;
valid = setError(bericht, bericht.value.trim() ? '' : 'Schrijf hier je vraag.') && valid;
return valid;
}
// Honeypot filled in, or submitted inhumanly fast.
function looksLikeSpam() {
var honeypot = form.elements.website;
return (honeypot && honeypot.value !== '') || Date.now() - shownAt < MIN_FILL_MS;
}
function showStatus(message) {
if (!status) return;
status.hidden = false;
status.textContent = message;
}
form.addEventListener('submit', function (event) {
event.preventDefault();
@@ -319,28 +349,29 @@
return;
}
var payload = {
naam: form.elements.naam.value.trim(),
email: form.elements.email.value.trim(),
onderwerp: form.elements.onderwerp.value.trim(),
bericht: form.elements.bericht.value.trim()
};
var thanks = 'Bedankt voor je bericht. Andrea reageert binnen 2-3 werkdagen.';
// Spam gets the normal thank-you, so bots learn nothing; nothing is sent.
if (looksLikeSpam()) {
form.reset();
showStatus(thanks);
return;
}
var payload = { naam: form.elements.naam.value.trim(), email: form.elements.email.value.trim() };
if (form.elements.shoot) payload.shoot = form.elements.shoot.value;
if (form.elements.onderwerp) payload.onderwerp = form.elements.onderwerp.value.trim();
payload.bericht = form.elements.bericht.value.trim();
if (submit) submit.disabled = true;
submitContactForm(payload)
.then(function () {
form.reset();
if (status) {
status.hidden = false;
status.textContent = 'Bedankt voor je bericht. Andrea reageert binnen 2-3 werkdagen.';
}
showStatus(thanks);
})
.catch(function () {
if (status) {
status.hidden = false;
status.textContent = 'Versturen lukte niet. Mail gerust rechtstreeks naar info@andreaslop.nl.';
}
showStatus('Versturen lukte niet. Mail gerust rechtstreeks naar info@andreaslop.nl.');
})
.finally(function () {
if (submit) submit.disabled = false;
@@ -349,6 +380,72 @@
});
}
/* ------------------------------------------------------------------ */
/* Contact form gate ("coming soon" overlay) */
/* ------------------------------------------------------------------ */
// While there is no back-end the form stays visible but dimmed and inert
// under a notice with a mail button. Remove data-form-disabled to switch
// the form on.
function initFormGate() {
var gates = Array.prototype.slice.call(document.querySelectorAll('[data-form-gate]'));
gates.forEach(function (gate) {
var form = gate.querySelector('[data-contact-form]');
var notice = gate.querySelector('[data-form-notice]');
var disabled = gate.hasAttribute('data-form-disabled');
if (form) form.inert = disabled;
if (notice) notice.hidden = !disabled;
});
}
/* ------------------------------------------------------------------ */
/* Lieve woorden (testimonials) */
/* ------------------------------------------------------------------ */
// One review at a time; previous/next and dots, no autoplay. Manual
// changes are announced politely to screen readers.
function initTestimonials() {
var root = document.querySelector('[data-testimonials]');
if (!root) return;
var slides = Array.prototype.slice.call(root.querySelectorAll('[data-testimonial]'));
var dots = Array.prototype.slice.call(root.querySelectorAll('[data-testimonials-dot]'));
var controls = root.querySelector('.testimonials__controls');
var status = root.querySelector('[data-testimonials-status]');
var active = 0;
// A single review needs no controls.
if (slides.length < 2) {
if (controls) controls.hidden = true;
return;
}
function show(index) {
active = (index + slides.length) % slides.length;
slides.forEach(function (slide, i) {
var isActive = i === active;
slide.hidden = !isActive;
slide.classList.toggle('is-active', isActive);
});
dots.forEach(function (dot, i) {
if (i === active) dot.setAttribute('aria-current', 'true');
else dot.removeAttribute('aria-current');
});
if (status) status.textContent = 'Review ' + (active + 1) + ' van ' + slides.length;
}
root.querySelector('[data-testimonials-prev]').addEventListener('click', function () { show(active - 1); });
root.querySelector('[data-testimonials-next]').addEventListener('click', function () { show(active + 1); });
dots.forEach(function (dot, i) {
dot.addEventListener('click', function () { show(i); });
});
}
/* ------------------------------------------------------------------ */
/* Scroll-reveal */
/* ------------------------------------------------------------------ */
@@ -414,6 +511,8 @@
initHeroSlider();
initLightbox();
initContactForm();
initFormGate();
initTestimonials();
initReveal();
initToTop();
initYear();
+119 -39
View File
@@ -191,77 +191,157 @@
</div>
<div class="pricing__grid">
<article class="price-card reveal">
<h3 class="price-card__name">Newborn</h3>
<p class="price-card__amount">&euro; 185</p>
<ul class="price-card__features">
<li>1 uur fotografie</li>
<li>20 nabewerkte foto's</li>
</ul>
<a class="btn" href="contact.html">Boek je shoot</a>
</article>
<article class="price-card reveal">
<h3 class="price-card__name">Zwangerschap</h3>
<p class="price-card__amount">&euro; 175</p>
<ul class="price-card__features">
<li>1 uur fotografie</li>
<li>15 nabewerkte foto's</li>
<li>Minstens 30 zorgvuldig nabewerkte foto's</li>
<li>Persoonlijke online fotogalerij</li>
</ul>
<a class="btn" href="contact.html">Boek je shoot</a>
<a class="btn" href="index.html?pakket=zwangerschap#contact">Boek je shoot</a>
</article>
<article class="price-card reveal">
<h3 class="price-card__name">Loveshoot</h3>
<h3 class="price-card__name">Newborn</h3>
<p class="price-card__amount">&euro; 185</p>
<ul class="price-card__features">
<li>1-2 uur fotografie</li>
<li>Minstens 40 zorgvuldig nabewerkte foto's</li>
<li>Persoonlijke online fotogalerij</li>
</ul>
<a class="btn" href="index.html?pakket=newborn#contact">Boek je shoot</a>
</article>
<article class="price-card reveal">
<h3 class="price-card__name">Gezin</h3>
<p class="price-card__amount">&euro; 175</p>
<ul class="price-card__features">
<li>1 uur fotografie</li>
<li>15 nabewerkte foto's</li>
<li>Minstens 30 zorgvuldig nabewerkte foto's</li>
<li>Persoonlijke online fotogalerij</li>
</ul>
<a class="btn" href="contact.html">Boek je shoot</a>
<a class="btn" href="index.html?pakket=gezin#contact">Boek je shoot</a>
</article>
</div>
</div>
</section>
<!-- ================================================= Lieve woorden -->
<!-- One review at a time: photo with the sand offset block (like the
about block), large quotation mark, shoot type, quote and names.
No autoplay; browse with previous/next or the dots. -->
<section class="section section--alt" aria-labelledby="testimonials-title">
<div class="container">
<div class="section__head section__head--center reveal">
<h2 id="testimonials-title">Lieve woorden</h2>
</div>
<div class="testimonials reveal" data-testimonials role="region" aria-roledescription="carrousel" aria-label="Reviews">
<div class="testimonials__track">
<article class="testimonial is-active" data-testimonial aria-roledescription="review" aria-label="1 van 2">
<div class="testimonial__media about__media">
<img src="assets/img/hero-5.jpg" alt="Bruidegom schuift de trouwring om de vinger van de bruid" loading="lazy">
</div>
<figure class="testimonial__body">
<span class="testimonial__mark" aria-hidden="true">&ldquo;</span>
<p class="eyebrow">Trouwshoot</p>
<blockquote class="testimonial__quote">
<p>Super mooie foto&rsquo;s door Andrea gemaakt op onze trouwdag en pr&eacute;-wedding shoot. Wij zijn er super blij mee! Een aantal hebben wij laten afdrukken en hangen nu ingelijst aan de muur, dus wij genieten er nog elke dag van.</p>
</blockquote>
<figcaption class="testimonial__author">Majella &amp; Mark</figcaption>
</figure>
</article>
<article class="testimonial" data-testimonial aria-roledescription="review" aria-label="2 van 2" hidden>
<div class="testimonial__media about__media">
<img src="assets/img/portfolio-6.jpg" alt="Pasgeboren baby tijdens een newbornshoot" loading="lazy">
</div>
<figure class="testimonial__body">
<span class="testimonial__mark" aria-hidden="true">&ldquo;</span>
<p class="eyebrow">Newbornshoot</p>
<blockquote class="testimonial__quote">
<p>Heel tevreden met de newbornshoot. De foto&rsquo;s zijn prachtig geworden en we zijn erg blij met het resultaat. Zeker aan te raden!</p>
</blockquote>
<figcaption class="testimonial__author">Demi &amp; Kevin</figcaption>
</figure>
</article>
</div>
<div class="testimonials__controls">
<button class="testimonials__arrow" type="button" data-testimonials-prev aria-label="Vorige review">&#8592;</button>
<div class="testimonials__dots">
<button class="testimonials__dot" type="button" data-testimonials-dot aria-label="Review 1" aria-current="true"></button>
<button class="testimonials__dot" type="button" data-testimonials-dot aria-label="Review 2"></button>
</div>
<button class="testimonials__arrow" type="button" data-testimonials-next aria-label="Volgende review">&#8594;</button>
</div>
<p class="visually-hidden" data-testimonials-status aria-live="polite"></p>
</div>
</div>
</section>
<!-- ======================================================= Contact -->
<section class="section section--alt" id="contact">
<!-- The form is complete, but there is no back-end yet. Until then it
stays dimmed and inert under a notice with a mail button. Remove
data-form-disabled (and inert) to switch the form on. -->
<section class="section" id="contact">
<div class="container container--narrow">
<div class="section__head section__head--center reveal">
<h2>Contact</h2>
<p class="lead">Wil je meer informatie ontvangen? Neem gerust contact met mij op.</p>
</div>
<form class="form reveal" data-contact-form novalidate>
<div class="form__row">
<div class="form-gate reveal" data-form-gate data-form-disabled>
<form class="form" data-contact-form novalidate inert>
<div class="form__row">
<div class="form__field">
<label class="form__label" for="home-naam">Naam</label>
<input class="form__input" id="home-naam" name="naam" type="text" autocomplete="name" maxlength="100" placeholder="Jouw naam" required>
<span class="form__error" data-form-error role="alert"></span>
</div>
<div class="form__field">
<label class="form__label" for="home-email">E-mail</label>
<input class="form__input" id="home-email" name="email" type="email" autocomplete="email" maxlength="254" placeholder="jouw@email.nl" required>
<span class="form__error" data-form-error role="alert"></span>
</div>
</div>
<div class="form__field">
<label class="form__label" for="home-naam">Naam</label>
<input class="form__input" id="home-naam" name="naam" type="text" autocomplete="name" required>
<label class="form__label" for="home-shoot">In welke shoot heb je interesse?</label>
<select class="form__input form__select" id="home-shoot" name="shoot" required>
<option value="">Kies een optie...</option>
<option value="zwangerschap">Zwangerschap</option>
<option value="newborn">Newborn</option>
<option value="gezin">Gezin</option>
<option value="overig">Overig</option>
</select>
<span class="form__error" data-form-error role="alert"></span>
</div>
<div class="form__field">
<label class="form__label" for="home-email">E-mail</label>
<input class="form__input" id="home-email" name="email" type="email" autocomplete="email" required>
<label class="form__label" for="home-bericht">Stel hier je vraag</label>
<textarea class="form__textarea" id="home-bericht" name="bericht" maxlength="2000" placeholder="Vul hier je bericht in" required></textarea>
<span class="form__error" data-form-error role="alert"></span>
</div>
<!-- Honeypot: only bots fill this in -->
<div class="form__hp" aria-hidden="true">
<label for="home-website">Website</label>
<input id="home-website" name="website" type="text" tabindex="-1" autocomplete="off">
</div>
<p class="form__status" data-form-status hidden></p>
<button class="btn btn--accent form__submit" type="submit">(Aan)vraag versturen</button>
</form>
<div class="form-gate__notice" data-form-notice>
<p class="eyebrow">Binnenkort</p>
<p class="form-gate__text">Het contactformulier komt binnenkort. Mail me voor nu op <a class="link-underline" href="mailto:info@andreaslop.nl">info@andreaslop.nl</a></p>
<a class="btn btn--accent" href="mailto:info@andreaslop.nl">Stuur een e-mail</a>
</div>
<div class="form__field">
<label class="form__label" for="home-onderwerp">Onderwerp</label>
<input class="form__input" id="home-onderwerp" name="onderwerp" type="text" required>
<span class="form__error" data-form-error role="alert"></span>
</div>
<div class="form__field">
<label class="form__label" for="home-bericht">Bericht</label>
<textarea class="form__textarea" id="home-bericht" name="bericht" placeholder="Stel hier je vraag" required></textarea>
<span class="form__error" data-form-error role="alert"></span>
</div>
<p class="form__status" data-form-status hidden></p>
<button class="btn btn--accent form__submit" type="submit">Verzenden</button>
</form>
</div>
</div>
</section>
+143 -2
View File
@@ -4,13 +4,16 @@ import {
createRouter,
RouterProvider,
} from '@tanstack/react-router';
import { render, screen } from '@testing-library/react';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { render, screen, waitFor, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import lighthouseConfig from '../lighthouserc.cjs';
import ErrorPage from './components/StatusPage/ErrorPage';
import { FakeIntersectionObserver } from './test/fakeIntersectionObserver';
import { routeTree } from './routeTree.gen';
import sitePages from './sitePages';
import { axeResults } from './test/axe';
import type { SocialLink } from './content/types';
import system from './theme';
// Laat PageIntro op verzoek crashen, om de foutpagina binnen de shell te testen
@@ -28,8 +31,38 @@ vi.mock('./components/PageIntro/PageIntro', async (importOriginal) => {
};
});
// Lets a test replace the social links, e.g. without a valid Instagram link
const socials = vi.hoisted(() => ({
override: null as SocialLink[] | null,
}));
vi.mock('./content/siteContent', async (importOriginal) => {
const original = (
await importOriginal<typeof import('./content/siteContent')>()
).default;
return {
default: {
...original,
get socials() {
return socials.override ?? original.socials;
},
},
};
});
// The homepage's review carousel (Zag) needs an IntersectionObserver and
// Element.scrollTo, which jsdom lacks
beforeEach(() => {
vi.stubGlobal('IntersectionObserver', FakeIntersectionObserver);
Element.prototype.scrollTo = () => {};
});
afterEach(() => {
crash.enabled = false;
socials.override = null;
vi.unstubAllGlobals();
FakeIntersectionObserver.reset();
// @ts-expect-error -- jsdom has no Element.scrollTo of its own
delete Element.prototype.scrollTo;
});
// De echte app: route tree, router-opties en thema zoals in main.tsx
@@ -121,6 +154,114 @@ describe('app', () => {
});
});
describe('homepage', () => {
it('shows the sections below the hero in page order', async () => {
const { container } = await renderApp('/');
const hero = await screen.findByRole('region', {
name: 'Uitgelicht werk',
});
const sections = [
screen.getByRole('region', { name: 'Lifestyle fotografie' }),
screen.getByRole('region', {
name: 'Lifestyle fotograaf met een passie voor storytelling',
}),
screen.getByRole('region', { name: 'Prijzen' }),
screen.getByRole('region', { name: 'Lieve woorden' }),
screen.getByRole('region', { name: 'Contact' }),
screen.getByRole('region', { name: 'Instagram' }),
];
let previous: Element = hero;
for (const section of sections) {
expect(
previous.compareDocumentPosition(section) &
Node.DOCUMENT_POSITION_FOLLOWING,
).toBeTruthy();
previous = section;
}
expect(screen.getAllByRole('heading', { level: 1 })).toHaveLength(1);
expect(await axeResults(container)).toHaveNoViolations();
});
it.each([
['missing', []],
[
'not https',
[
{
platform: 'instagram',
href: 'http://www.instagram.com/andreaslopfotografie/',
},
],
],
] satisfies [string, SocialLink[]][])(
'leaves out the Instagram section when its link is %s',
async (_, links) => {
socials.override = links;
await renderApp('/');
await screen.findByRole('region', { name: 'Contact' });
expect(
screen.queryByRole('region', { name: 'Instagram' }),
).toBeNull();
},
);
});
describe('homepage ?pakket=', () => {
it('a click on "Boek Newborn" scrolls to Contact and selects Newborn', async () => {
const scrolls = vi.spyOn(Element.prototype, 'scrollIntoView');
const user = userEvent.setup();
await renderApp('/');
await user.click(
await screen.findByRole('link', { name: 'Boek Newborn' }),
);
expect(
await screen.findByTestId('contact-form-shoot', undefined, {
timeout: 10_000,
}),
).toHaveValue('newborn');
await waitFor(() =>
expect(
scrolls.mock.contexts.some(
(element) => (element as Element).id === 'contact',
),
).toBe(true),
);
});
it('a "Boek Newborn" link selects Newborn, tidies the URL and focuses Contact', async () => {
const { router } = await renderApp('/?pakket=newborn#contact');
// The form is lazy; arriving via "Boek" loads it straight away
expect(
await screen.findByTestId('contact-form-shoot', undefined, {
timeout: 10_000,
}),
).toHaveValue('newborn');
await waitFor(() => expect(router.state.location.searchStr).toBe(''));
expect(router.state.location.hash).toBe('contact');
// The form stays once loaded, also now that ?pakket= is gone
expect(screen.getByTestId('contact-form-shoot')).toHaveValue('newborn');
// within the section: the footer has a "Contact" heading too
expect(
within(screen.getByRole('region', { name: 'Contact' })).getByRole(
'heading',
{ level: 2 },
),
).toHaveFocus();
});
it.each(['/?pakket=newborn', '/?pakket=123', '/?pakket=%3Cscript%3E'])(
'%s renders the homepage without errors',
async (path) => {
await renderApp(path);
expect(
await screen.findByRole('region', { name: 'Prijzen' }),
).toBeInTheDocument();
expect(document.body).not.toHaveTextContent('<script>');
},
);
});
describe('pagina-register', () => {
it('bevat precies de routes van de route tree', async () => {
const { router } = await renderApp('/');
Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

+1 -1
View File
@@ -32,7 +32,7 @@ export default function BackToTop() {
data-testid="back-to-top-button"
position="fixed"
bottom={EDGE}
right={`max(${EDGE}, calc((100vw - {sizes.content}) / 2 + {spacing.8}))`}
right={`max(${EDGE}, calc((100vw - {sizes.content}) / 2 + {spacing.gutter}))`}
zIndex="backToTop"
display="inline-flex"
alignItems="center"
@@ -0,0 +1,216 @@
import { useState } from 'react';
import { act, fireEvent, screen, waitFor } from '@testing-library/react';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import packages from '@/content/packages';
import siteContent from '@/content/siteContent';
import { shootOptions } from '@/lib/shootOptions';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import ContactForm from './ContactForm';
const options = shootOptions(packages);
// The time check needs over 3 s between showing and sending (BR-SPAM-01)
let now = 0;
beforeEach(() => {
now = 0;
vi.spyOn(Date, 'now').mockImplementation(() => now);
});
const renderForm = (
props: Partial<React.ComponentProps<typeof ContactForm>> = {},
) =>
renderWithProviders(
<ContactForm
idPrefix="test"
options={options}
mailSubject="Vraag via andreaslop.nl"
email={siteContent.email}
submit={vi.fn().mockResolvedValue(undefined)}
{...props}
/>,
);
const field = (name: string) => screen.getByTestId(`contact-form-${name}`);
const type = (name: string, value: string) =>
fireEvent.change(field(name), { target: { value } });
const fillIn = () => {
type('naam', 'Demi');
type('email', 'demi@example.nl');
type('shoot', 'newborn');
type('bericht', 'Wanneer heb je plek?');
};
const send = () => {
now = 10_000;
fireEvent.click(screen.getByTestId('contact-form-submit'));
};
describe('ContactForm', () => {
it('shows the four labelled fields and the button', async () => {
const { container } = await renderForm();
expect(screen.getByLabelText(/Naam/)).toBe(field('naam'));
expect(screen.getByLabelText(/E-mail/)).toBe(field('email'));
expect(screen.getByLabelText(/In welke shoot/)).toBe(field('shoot'));
expect(screen.getByLabelText(/Stel hier je vraag/)).toBe(
field('bericht'),
);
expect(
screen.getByRole('option', { name: 'Kies een optie...' }),
).toBeInTheDocument();
expect(
screen.getByRole('button', { name: '(Aan)vraag versturen' }),
).toBeInTheDocument();
expect(await axeResults(container)).toHaveNoViolations();
});
it('shows nothing when tabbing through an untouched field', async () => {
await renderForm();
fireEvent.blur(field('naam'));
expect(screen.queryByText('Vul je naam in.')).toBeNull();
});
it('checks a field on leaving once typed in, and clears it once fine', async () => {
await renderForm();
type('email', 'demi@');
fireEvent.blur(field('email'));
expect(
screen.getByText('Dit e-mailadres is ongeldig.'),
).toBeInTheDocument();
expect(field('email')).toHaveAttribute('aria-invalid', 'true');
type('email', 'demi@example.nl');
expect(screen.queryByText('Dit e-mailadres is ongeldig.')).toBeNull();
});
it('stops an incomplete submit and focuses the first invalid field', async () => {
const submit = vi.fn();
await renderForm({ submit });
type('naam', 'Demi');
send();
expect(screen.getByText('Vul je e-mailadres in.')).toBeInTheDocument();
expect(screen.getByText('Kies een soort shoot.')).toBeInTheDocument();
expect(screen.getByText('Schrijf hier je vraag.')).toBeInTheDocument();
expect(field('email')).toHaveFocus();
expect(submit).not.toHaveBeenCalled();
});
it('sends the trimmed form and shows the thank-you with focus', async () => {
const submit = vi.fn().mockResolvedValue(undefined);
await renderForm({ submit });
fillIn();
type('naam', ' Demi ');
send();
expect(screen.getByTestId('contact-form-submit')).toHaveTextContent(
'Versturen…',
);
expect(submit).toHaveBeenCalledWith({
naam: 'Demi',
email: 'demi@example.nl',
shoot: 'newborn',
bericht: 'Wanneer heb je plek?',
});
const thanks = await screen.findByTestId('contact-form-sent');
expect(thanks).toHaveTextContent(
'Bedankt voor je bericht! Ik reageer binnen 1-2 werkdagen.',
);
await waitFor(() => expect(thanks).toHaveFocus());
expect(screen.queryByTestId('contact-form')).toBeNull();
});
it('keeps the input and offers the mail link when sending fails', async () => {
await renderForm({ submit: vi.fn().mockRejectedValue(new Error('x')) });
fillIn();
send();
const status = await screen.findByRole('alert');
expect(status).toHaveTextContent(
'Versturen lukte niet. Probeer het later nog eens of mail naar info@andreaslop.nl',
);
expect(
screen.getByRole('link', { name: 'info@andreaslop.nl' }),
).toHaveAttribute(
'href',
'mailto:info@andreaslop.nl?subject=Vraag%20via%20andreaslop.nl',
);
expect(field('naam')).toHaveValue('Demi');
expect(screen.getByTestId('contact-form-submit')).not.toBeDisabled();
});
it('treats a filled honeypot as spam: thank-you, nothing sent', async () => {
const submit = vi.fn();
const { container } = await renderForm({ submit });
fillIn();
fireEvent.change(
container.querySelector('input[name="website"]') as Element,
{ target: { value: 'https://spam.example' } },
);
send();
expect(screen.getByTestId('contact-form-sent')).toBeInTheDocument();
expect(submit).not.toHaveBeenCalled();
});
it('treats a submit within 3 seconds as spam', async () => {
const submit = vi.fn();
await renderForm({ submit });
fillIn();
now = 1_000;
fireEvent.click(screen.getByTestId('contact-form-submit'));
expect(screen.getByTestId('contact-form-sent')).toBeInTheDocument();
expect(submit).not.toHaveBeenCalled();
});
it('ignores a second submit while sending', async () => {
let finish = () => {};
const submit = vi.fn(
() => new Promise<void>((resolve) => (finish = resolve)),
);
await renderForm({ submit });
fillIn();
send();
fireEvent.click(screen.getByTestId('contact-form-submit'));
expect(submit).toHaveBeenCalledTimes(1);
await act(async () => finish());
});
it('takes over a preselected package, also again after a change', async () => {
// A second "Boek" click for the same package raises the key
function Harness() {
const [preselect, setPreselect] = useState({
shoot: 'newborn',
key: 1,
});
return (
<>
<button
type="button"
onClick={() =>
setPreselect((p) => ({ ...p, key: p.key + 1 }))
}
>
nog eens
</button>
<ContactForm
idPrefix="test"
options={options}
preselect={preselect}
mailSubject="Vraag via andreaslop.nl"
email={siteContent.email}
/>
</>
);
}
await renderWithProviders(<Harness />);
expect(field('shoot')).toHaveValue('newborn');
type('shoot', 'gezin');
expect(field('shoot')).toHaveValue('gezin');
fireEvent.click(screen.getByRole('button', { name: 'nog eens' }));
expect(field('shoot')).toHaveValue('newborn');
});
it('keeps the honeypot away from people and assistive technology', async () => {
const { container } = await renderForm();
const honeypot = container.querySelector('input[name="website"]');
expect(honeypot).toHaveAttribute('tabindex', '-1');
expect(honeypot?.closest('[aria-hidden="true"]')).not.toBeNull();
expect(container.querySelector('[data-robot-check]')).not.toBeNull();
});
});
@@ -0,0 +1,304 @@
import { useEffect, useRef, useState, useReducer } from 'react';
import {
Box,
chakra,
Field,
Input,
Link,
NativeSelect,
SimpleGrid,
Stack,
Text,
Textarea,
useRecipe,
} from '@chakra-ui/react';
import { submitContactForm } from '@/contact/submitContactForm';
import {
CONTACT_LIMITS,
type ContactField,
type ContactPayload,
type ShootOption,
} from '@/contact/types';
import type { EmailAddress } from '@/content/types';
import {
contactFormReducer,
INITIAL_CONTACT_STATE,
type ContactFormEvent,
} from '@/lib/contactFormReducer';
import { emailAddress } from '@/lib/emailAddress';
import { mailtoLink } from '@/lib/mailLink';
import { toContactPayload } from '@/lib/toContactPayload';
import { CONTACT_FIELDS } from '@/lib/validateContact';
type ContactFormProps = {
// Prefix for the field ids, so the form can appear on more than one page
idPrefix: string;
options: ShootOption[];
// A package chosen via "Boek ..."; key changes on every click, so the
// same package can be applied again after the visitor changed it
preselect?: { shoot: string; key: number };
mailSubject: string;
email: EmailAddress;
submit?: (payload: ContactPayload) => Promise<void>;
};
const SENT_MESSAGE =
'Bedankt voor je bericht! Ik reageer binnen 1-2 werkdagen.';
// The contact form (design .form): name and e-mail, the shoot, the question,
// and the browser-side anti-spam. Its behaviour is the pure
// contactFormReducer; this component wires it to the fields.
export default function ContactForm({
idPrefix,
options,
preselect,
mailSubject,
email,
submit = submitContactForm,
}: ContactFormProps) {
const reduce = (
state: typeof INITIAL_CONTACT_STATE,
event: ContactFormEvent,
) => contactFormReducer(state, event, options);
const [state, dispatch] = useReducer(reduce, INITIAL_CONTACT_STATE);
const formControl = useRecipe({ key: 'formControl' });
const linkButton = useRecipe({ key: 'linkButton' });
// When the form became usable, for the time check (BR-SPAM-01)
const [shownAt] = useState(() => Date.now());
const honeypot = useRef<HTMLInputElement>(null);
const sentMessage = useRef<HTMLDivElement>(null);
// Apply a new "Boek ..." choice while rendering (React's pattern for
// reacting to a changed prop), so it never shows a stale value first
const [seenPreselect, setSeenPreselect] = useState(0);
if (preselect && preselect.key !== seenPreselect) {
setSeenPreselect(preselect.key);
dispatch({ type: 'preselect', shoot: preselect.shoot });
}
// After a stopped submit, focus the first field with an error
useEffect(() => {
if (state.invalidSubmits === 0) return;
const first = CONTACT_FIELDS.find((field) => state.errors[field]);
if (first) document.getElementById(`${idPrefix}-${first}`)?.focus();
// Only on a new stopped submit, not on every error change
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state.invalidSubmits]);
// The thank-you replaces the form; move focus there (BR-SEND-02)
useEffect(() => {
if (state.status === 'sent') sentMessage.current?.focus();
}, [state.status]);
const address = emailAddress(email);
const disabled = state.status === 'sending';
if (state.status === 'sent') {
return (
<Box
ref={sentMessage}
role="status"
tabIndex={-1}
data-testid="contact-form-sent"
p={6}
borderStartWidth="2px"
borderStartColor="accent"
bg="paper.alt"
>
{SENT_MESSAGE}
</Box>
);
}
const onSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
const submitEvent: ContactFormEvent = {
type: 'submit',
honeypot: honeypot.current?.value ?? '',
shownAt,
now: Date.now(),
};
// Sending starts here, not in an effect, so it happens exactly once
const next = reduce(state, submitEvent);
dispatch(submitEvent);
if (next.status === 'sending') {
submit(toContactPayload(state.values)).then(
() => dispatch({ type: 'resolved' }),
() => dispatch({ type: 'rejected' }),
);
}
};
// The control's id comes from Field.Root's id (Ark uses it for the
// control and the label's htmlFor), so label and error stay linked
const fieldProps = (field: ContactField) => ({
name: field,
value: state.values[field],
onChange: (
event: React.ChangeEvent<
HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement
>,
) => dispatch({ type: 'edit', field, value: event.target.value }),
onBlur: () => dispatch({ type: 'blur', field }),
css: formControl(),
'data-testid': `contact-form-${field}`,
});
const label = (text: string) => (
// ink.soft instead of the design's muted grey: meets 4.5:1
<Field.Label textStyle="eyebrow" color="ink.soft" fontWeight="400">
{text}
</Field.Label>
);
const error = (field: ContactField) => (
<Field.ErrorText color="error" fontSize="sm">
{state.errors[field]}
</Field.ErrorText>
);
return (
<chakra.form
noValidate
onSubmit={onSubmit}
data-testid="contact-form"
position="relative"
>
<Stack gap={6}>
<SimpleGrid columns={{ base: 1, sm: 2 }} gap={6}>
<Field.Root
invalid={Boolean(state.errors.naam)}
required
id={`${idPrefix}-naam`}
>
{label('Naam')}
<Input
{...fieldProps('naam')}
type="text"
autoComplete="name"
maxLength={CONTACT_LIMITS.naam}
placeholder="Jouw naam"
/>
{error('naam')}
</Field.Root>
<Field.Root
invalid={Boolean(state.errors.email)}
required
id={`${idPrefix}-email`}
>
{label('E-mail')}
<Input
{...fieldProps('email')}
type="email"
autoComplete="email"
maxLength={CONTACT_LIMITS.email}
placeholder="jouw@email.nl"
/>
{error('email')}
</Field.Root>
</SimpleGrid>
<Field.Root
invalid={Boolean(state.errors.shoot)}
required
id={`${idPrefix}-shoot`}
>
{label('In welke shoot heb je interesse?')}
<NativeSelect.Root>
<NativeSelect.Field {...fieldProps('shoot')}>
<option value="">Kies een optie...</option>
{options.map((option) => (
<option key={option.value} value={option.value}>
{option.label}
</option>
))}
</NativeSelect.Field>
<NativeSelect.Indicator />
</NativeSelect.Root>
{error('shoot')}
</Field.Root>
<Field.Root
invalid={Boolean(state.errors.bericht)}
required
id={`${idPrefix}-bericht`}
>
{label('Stel hier je vraag')}
<Textarea
{...fieldProps('bericht')}
maxLength={CONTACT_LIMITS.bericht}
placeholder="Vul hier je bericht in"
minH="170px"
resize="vertical"
/>
{error('bericht')}
</Field.Root>
{/* Honeypot: off-screen and hidden from assistive
technology; only bots fill it in (BR-SPAM-01) */}
<Box
aria-hidden="true"
position="absolute"
left="-10000px"
w="1px"
h="1px"
overflow="hidden"
>
<label htmlFor={`${idPrefix}-website`}>Website</label>
<input
ref={honeypot}
id={`${idPrefix}-website`}
name="website"
type="text"
tabIndex={-1}
autoComplete="off"
/>
</Box>
{/* Place for the robot check (Friendly Captcha), added with
the API (FR-HP-09) */}
<div data-robot-check />
{state.status === 'failed' && (
<Box
role="alert"
data-testid="contact-form-status"
p={4}
borderStartWidth="2px"
borderStartColor="error"
bg="paper.alt"
fontSize="sm"
>
<Text>
Versturen lukte niet. Probeer het later nog eens
{address ? (
<>
{' of mail naar '}
<Link
variant="underline"
href={mailtoLink(address, mailSubject)}
>
{address}
</Link>
</>
) : (
'.'
)}
</Text>
</Box>
)}
<chakra.button
type="submit"
css={linkButton({ variant: 'accent' })}
alignSelf="flex-start"
disabled={disabled}
cursor={disabled ? 'progress' : 'pointer'}
data-testid="contact-form-submit"
>
{disabled ? 'Versturen…' : '(Aan)vraag versturen'}
</chakra.button>
</Stack>
</chakra.form>
);
}
@@ -0,0 +1,59 @@
import { screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import siteContent from '@/content/siteContent';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import ContactFormGate from './ContactFormGate';
const renderGate = (enabled: boolean, email = siteContent.email) =>
renderWithProviders(
<ContactFormGate
enabled={enabled}
email={email}
subject="Aanvraag fotoshoot: Newborn"
>
<form aria-label="Formulier">
<input aria-label="Naam" />
</form>
</ContactFormGate>,
);
describe('ContactFormGate', () => {
it('keeps the form inert under the coming-soon notice with a mail button', async () => {
const { container } = await renderGate(false);
const form = container.querySelector('form');
expect(form?.closest('[inert]')).not.toBeNull();
const notice = screen.getByTestId('contact-gate-notice');
expect(notice).toHaveTextContent(
'Het contactformulier komt binnenkort. Mail me voor nu op info@andreaslop.nl',
);
const mail = screen.getByRole('link', { name: 'Stuur een e-mail' });
expect(mail).toHaveAttribute(
'href',
'mailto:info@andreaslop.nl?subject=Aanvraag%20fotoshoot%3A%20Newborn',
);
expect(
screen.getByRole('link', { name: 'info@andreaslop.nl' }),
).toHaveAttribute('href', mail.getAttribute('href'));
expect(await axeResults(container)).toHaveNoViolations();
});
it('shows only the coming-soon text when the address is invalid', async () => {
await renderGate(false, { user: '', domain: 'andreaslop.nl' });
expect(screen.getByTestId('contact-gate-notice')).toHaveTextContent(
'Het contactformulier komt binnenkort.',
);
expect(screen.queryByRole('link')).toBeNull();
});
it('shows just the form when switched on', async () => {
const { container } = await renderGate(true);
expect(screen.queryByTestId('contact-gate-notice')).toBeNull();
expect(container.querySelector('[inert]')).toBeNull();
expect(
screen.getByRole('textbox', { name: 'Naam' }),
).toBeInTheDocument();
expect(await axeResults(container)).toHaveNoViolations();
});
});
@@ -0,0 +1,76 @@
import type { ReactNode } from 'react';
import { Box, chakra, Link, Text, useRecipe } from '@chakra-ui/react';
import type { EmailAddress } from '@/content/types';
import { emailAddress } from '@/lib/emailAddress';
import { mailtoLink } from '@/lib/mailLink';
type ContactFormGateProps = {
enabled: boolean;
email: EmailAddress;
subject: string;
children: ReactNode;
};
// Until there is a back-end the form stays visible but dimmed and inert
// under a "coming soon" notice with a mail button (FR-HP-07). inert keeps
// keyboard and screen reader users out of a form that does nothing.
export default function ContactFormGate({
enabled,
email,
subject,
children,
}: ContactFormGateProps) {
const linkButton = useRecipe({ key: 'linkButton' });
if (enabled) return <>{children}</>;
// Assembled in the browser, so the address is nowhere in the bundle
const address = emailAddress(email);
const href = address ? mailtoLink(address, subject) : undefined;
return (
<Box position="relative" data-testid="contact-gate">
<Box inert opacity={0.35} filter="blur(1.5px)" userSelect="none">
{children}
</Box>
<Box
position="absolute"
top="50%"
left="50%"
transform="translate(-50%, -50%)"
w="min(100%, 520px)"
p="clamp(2rem, 4vw, 3rem)"
bg="white"
borderWidth="1px"
borderColor="line"
boxShadow="panel"
textAlign="center"
data-testid="contact-gate-notice"
>
{/* accent.deep instead of the design's accent: meets 4.5:1 */}
<Text textStyle="eyebrow" color="accent.deep" mb={4}>
Binnenkort
</Text>
<Text color="ink.soft" mb={address ? 7 : 0}>
Het contactformulier komt binnenkort.
{address && (
<>
{' Mail me voor nu op '}
<Link variant="underline" href={href}>
{address}
</Link>
</>
)}
</Text>
{address && (
<chakra.a
href={href}
css={linkButton({ variant: 'accent' })}
data-testid="contact-gate-mail"
>
Stuur een e-mail
</chakra.a>
)}
</Box>
</Box>
);
}
@@ -0,0 +1,71 @@
import { act, screen } from '@testing-library/react';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { FakeIntersectionObserver } from '@/test/fakeIntersectionObserver';
import { renderWithProviders } from '@/test/renderWithProviders';
import DeferredImage, { DEFERRED_LOAD_MARGIN } from './DeferredImage';
const image = {
src: '/foto.jpg',
alt: 'Een foto',
width: 800,
height: 1200,
};
afterEach(() => {
vi.unstubAllGlobals();
FakeIntersectionObserver.reset();
});
describe('DeferredImage', () => {
it('loads straight away without IntersectionObserver once the page has loaded', async () => {
await renderWithProviders(<DeferredImage image={image} />);
const img = screen.getByRole('img', { name: 'Een foto' });
expect(img).toHaveAttribute('src', '/foto.jpg');
expect(img).toHaveAttribute('width', '800');
expect(img).toHaveAttribute('height', '1200');
expect(img).toHaveAttribute('loading', 'lazy');
});
it('waits until the image comes near the viewport', async () => {
vi.stubGlobal('IntersectionObserver', FakeIntersectionObserver);
await renderWithProviders(<DeferredImage image={image} />);
const img = screen.getByRole('img', { name: 'Een foto' });
const [observer] = FakeIntersectionObserver.instances;
expect(img).not.toHaveAttribute('src');
expect(observer.options?.rootMargin).toBe(DEFERRED_LOAD_MARGIN);
act(() => observer.trigger(true));
expect(img).toHaveAttribute('src', '/foto.jpg');
});
it('waits for the page load event, even when already in view', async () => {
vi.spyOn(document, 'readyState', 'get').mockReturnValue('interactive');
await renderWithProviders(<DeferredImage image={image} />);
const img = screen.getByRole('img', { name: 'Een foto' });
expect(img).not.toHaveAttribute('src');
act(() => {
window.dispatchEvent(new Event('load'));
});
expect(img).toHaveAttribute('src', '/foto.jpg');
});
it('follows the near prop from a parent instead of observing itself', async () => {
vi.stubGlobal('IntersectionObserver', FakeIntersectionObserver);
const { unmount } = await renderWithProviders(
<DeferredImage image={image} near={false} />,
);
expect(
screen.getByRole('img', { name: 'Een foto' }),
).not.toHaveAttribute('src');
unmount();
await renderWithProviders(<DeferredImage image={image} near />);
expect(screen.getByRole('img', { name: 'Een foto' })).toHaveAttribute(
'src',
'/foto.jpg',
);
expect(FakeIntersectionObserver.instances).toHaveLength(0);
});
});
@@ -0,0 +1,50 @@
import { Image, type ImageProps } from '@chakra-ui/react';
import usePageLoaded from '@/hooks/usePageLoaded';
import useInView from '@/hooks/useInView';
import type { ContentImage } from '@/content/types';
// How far outside the viewport an image starts loading. Kept small on
// purpose: everything below the full-height hero must be out of range when
// the page opens, or its photos start before the hero has painted. In
// Lighthouse's throttled simulation that pushed the largest contentful
// paint from 3.8 s to 5.3 s whenever the request won the race.
export const DEFERRED_LOAD_MARGIN = '200px 0px';
type DeferredImageProps = Omit<ImageProps, 'src' | 'alt'> & {
image: ContentImage;
// Set by a parent that knows better, e.g. a horizontal scroller whose
// off-screen items are clipped and would never intersect on their own
near?: boolean;
};
// A below-the-fold image that only starts downloading once the page has
// finished loading and the image is near the viewport. Native
// loading="lazy" is not enough: Chrome fetches lazy images up to ±1250px
// below the screen straight away, so photos right under the hero compete
// with it for bandwidth and delay the largest contentful paint.
// Width and height reserve the space, so nothing shifts when it loads.
export default function DeferredImage({
image,
near,
...rest
}: DeferredImageProps) {
const pageLoaded = usePageLoaded();
const { ref, inView } = useInView<HTMLImageElement>({
rootMargin: DEFERRED_LOAD_MARGIN,
skip: near !== undefined,
});
const load = pageLoaded && (near ?? inView);
return (
<Image
ref={ref}
src={load ? image.src : undefined}
alt={image.alt}
htmlWidth={image.width}
htmlHeight={image.height}
loading="lazy"
decoding="async"
{...rest}
/>
);
}
@@ -0,0 +1,27 @@
import { screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import FramedImage from './FramedImage';
const image = {
src: '/andrea.jpg',
alt: 'Andrea met haar camera',
width: 1200,
height: 800,
};
describe('FramedImage', () => {
it('renders only the photo for assistive technology, with its size', async () => {
const { container } = await renderWithProviders(
<FramedImage image={image} aspectRatio="4 / 3" />,
);
const img = screen.getByRole('img');
expect(img).toHaveAccessibleName('Andrea met haar camera');
expect(img).toHaveAttribute('src', '/andrea.jpg');
expect(img).toHaveAttribute('width', '1200');
expect(img).toHaveAttribute('height', '800');
expect(img).toHaveAttribute('loading', 'lazy');
expect(await axeResults(container)).toHaveNoViolations();
});
});
@@ -0,0 +1,45 @@
import { Box } from '@chakra-ui/react';
import DeferredImage from '@/components/DeferredImage/DeferredImage';
import type { ContentImage } from '@/content/types';
type FramedImageProps = {
image: ContentImage;
// CSS aspect ratio of the visible crop, e.g. '4 / 3'
aspectRatio: string;
};
// A photo with a soft sand-coloured block offset behind its lower left
// corner (design .about__media). The block is pure decoration (a CSS
// pseudo-element), so assistive technology never announces it. On phones it
// is left out, since it would stick out past the page edge.
export default function FramedImage({ image, aspectRatio }: FramedImageProps) {
return (
<Box
position="relative"
// Own stacking context, so the block can sit behind the photo
isolation="isolate"
_before={{
content: '""',
display: { base: 'none', sm: 'block' },
position: 'absolute',
left: '-1.5rem',
bottom: '-1.5rem',
width: '55%',
height: '55%',
bg: 'sand',
zIndex: -1,
}}
>
<DeferredImage
image={image}
display="block"
w="100%"
h="auto"
aspectRatio={aspectRatio}
objectFit="cover"
// Shown until the deferred photo arrives
bg="paper.deep"
/>
</Box>
);
}
@@ -0,0 +1,51 @@
import { screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import HomeSection from './HomeSection';
describe('HomeSection', () => {
it('is a region named by its heading', async () => {
const { container } = await renderWithProviders(
<HomeSection labelledBy="about-title" data-testid="about">
<h2 id="about-title">Over mij</h2>
</HomeSection>,
);
expect(screen.getByRole('region', { name: 'Over mij' })).toBe(
screen.getByTestId('about'),
);
expect(await axeResults(container)).toHaveNoViolations();
});
it('passes the anchor id through for every tone, width and spacing', async () => {
await renderWithProviders(
<HomeSection
labelledBy="contact-title"
id="contact"
tone="alt"
width="narrow"
spacing="tight"
>
<h2 id="contact-title">Contact</h2>
</HomeSection>,
);
expect(screen.getByRole('region', { name: 'Contact' })).toHaveAttribute(
'id',
'contact',
);
});
it('leaves out the content column at full width', async () => {
await renderWithProviders(
<HomeSection labelledBy="insta-title" width="full">
<h2 id="insta-title" data-testid="child">
Instagram
</h2>
</HomeSection>,
);
// The heading is a direct child of the section, not of a Container
expect(screen.getByTestId('child').parentElement).toBe(
screen.getByRole('region', { name: 'Instagram' }),
);
});
});
@@ -0,0 +1,51 @@
import type { ReactNode } from 'react';
import { Box, Container } from '@chakra-ui/react';
type HomeSectionProps = {
// Id of the heading that names this section for assistive technology
labelledBy: string;
id?: string;
tone?: 'paper' | 'alt';
// full: no content column, for edge-to-edge content; the section then
// places its own Container around what should stay in the column
width?: 'default' | 'narrow' | 'full';
spacing?: 'default' | 'tight';
'data-testid'?: string;
children: ReactNode;
};
// Frame of a homepage section (design .section): vertical rhythm, an
// optional alternate background and the content column.
export default function HomeSection({
labelledBy,
id,
tone = 'paper',
width = 'default',
spacing = 'default',
'data-testid': testId,
children,
}: HomeSectionProps) {
return (
<Box
as="section"
id={id}
aria-labelledby={labelledBy}
data-testid={testId}
bg={tone === 'alt' ? 'paper.alt' : 'paper'}
// An anchor target (#contact) lands right below the fixed header,
// which has shrunk to its sticky height by the time it gets there
scrollMarginTop={id ? 'header.sticky' : undefined}
py={spacing === 'tight' ? 'sectionYTight' : 'sectionY'}
>
{width === 'full' ? (
children
) : (
<Container
maxW={width === 'narrow' ? 'contentNarrow' : 'content'}
>
{children}
</Container>
)}
</Box>
);
}
@@ -58,7 +58,6 @@ export default function NavigationBar() {
borderBottomColor={overlay('line', 'transparent')}
// Schaduw alleen na scrollen, zoals .header--sticky in het design
boxShadow={pastHero ? 'sm' : 'none'}
px={{ base: 4, md: 8 }}
transitionProperty="height, background-color, color, border-color, box-shadow"
transitionDuration="interaction"
transitionTimingFunction="smooth"
+28
View File
@@ -0,0 +1,28 @@
import { screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { renderWithProviders } from '@/test/renderWithProviders';
import Reveal from './Reveal';
describe('Reveal', () => {
it('renders its content visibly when IntersectionObserver is missing', async () => {
await renderWithProviders(
<Reveal data-testid="reveal">
<p>Inhoud</p>
</Reveal>,
);
expect(screen.getByText('Inhoud')).toBeVisible();
expect(screen.getByTestId('reveal')).toHaveAttribute(
'data-reveal',
'visible',
);
});
it('passes element props through, e.g. to render a figure', async () => {
await renderWithProviders(
<Reveal as="figure" delay={0.16} data-testid="reveal">
<span>Foto</span>
</Reveal>,
);
expect(screen.getByTestId('reveal').tagName).toBe('FIGURE');
});
});
+30
View File
@@ -0,0 +1,30 @@
import { Box, type BoxProps } from '@chakra-ui/react';
import useReveal from '@/hooks/useReveal';
type RevealProps = BoxProps & {
// Seconds to wait before fading in, to stagger items in a row
delay?: number;
};
// Fades its content in and up once it scrolls into view (design .reveal).
// The content is always in the DOM and readable by assistive technology;
// only its opacity and position change.
export default function Reveal({ delay = 0, children, ...rest }: RevealProps) {
const { ref, visible } = useReveal<HTMLDivElement>();
return (
<Box
ref={ref}
data-reveal={visible ? 'visible' : 'hidden'}
opacity={visible ? 1 : 0}
transform={visible ? 'none' : 'translateY(24px)'}
transitionProperty="opacity, transform"
transitionDuration="reveal"
transitionTimingFunction="smooth"
transitionDelay={`${delay}s`}
{...rest}
>
{children}
</Box>
);
}
@@ -0,0 +1,53 @@
import { screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import SectionHeading from './SectionHeading';
describe('SectionHeading', () => {
it('renders the label, an h2 with its id and the lead', async () => {
const { container } = await renderWithProviders(
<SectionHeading
id="prices-title"
eyebrow="Pakketten"
title="Prijzen"
lead="Kies wat bij je past."
/>,
);
const heading = screen.getByRole('heading', { level: 2 });
expect(heading).toHaveTextContent('Prijzen');
expect(heading).toHaveAttribute('id', 'prices-title');
expect(screen.getByText('Pakketten')).toBeInTheDocument();
expect(screen.getByText('Kies wat bij je past.')).toBeInTheDocument();
expect(await axeResults(container)).toHaveNoViolations();
});
it('works with only a title', async () => {
const { container } = await renderWithProviders(
<SectionHeading id="t" title="Instagram" align="start" />,
);
expect(
screen.getByRole('heading', { level: 2, name: 'Instagram' }),
).toBeInTheDocument();
expect(container.querySelectorAll('p')).toHaveLength(0);
});
it('supports a compact, start-aligned variant above running text', async () => {
await renderWithProviders(
<SectionHeading
id="about-title"
eyebrow="Over mij"
title="Lifestyle fotograaf"
align="start"
spacing="compact"
/>,
);
expect(
screen.getByRole('heading', {
level: 2,
name: 'Lifestyle fotograaf',
}),
).toHaveAttribute('id', 'about-title');
expect(screen.getByText('Over mij')).toBeInTheDocument();
});
});
@@ -0,0 +1,59 @@
import type { ReactNode } from 'react';
import { Box, Heading, Text } from '@chakra-ui/react';
type SectionHeadingProps = {
// Referenced by the section's aria-labelledby
id: string;
title: string;
eyebrow?: string;
// Text, or e.g. a link as in the Instagram section
lead?: ReactNode;
align?: 'center' | 'start';
// compact: little space below, for a heading above running text
spacing?: 'default' | 'compact';
// Lets code move focus to the heading (no visible ring, theme rule)
focusable?: boolean;
};
// Heading block of a homepage section (design .section__head): optional
// small label, the h2 and an optional intro sentence.
export default function SectionHeading({
id,
title,
eyebrow,
lead,
align = 'center',
spacing = 'default',
focusable = false,
}: SectionHeadingProps) {
const centered = align === 'center';
return (
<Box
maxW="620px"
mx={centered ? 'auto' : undefined}
mb={spacing === 'compact' ? 6 : 'sectionHeadGap'}
textAlign={centered ? 'center' : 'start'}
>
{eyebrow && (
// accent.deep instead of the design's accent: meets 4.5:1 (NFR-HP-01)
<Text textStyle="eyebrow" color="accent.deep" mb={4}>
{eyebrow}
</Text>
)}
<Heading
as="h2"
id={id}
textStyle="sectionTitle"
tabIndex={focusable ? -1 : undefined}
>
{title}
</Heading>
{lead && (
<Text textStyle="lead" color="ink.soft" mt={2}>
{lead}
</Text>
)}
</Box>
);
}
@@ -0,0 +1,31 @@
import { screen, within } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import homeContent from '@/content/homeContent';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import AboutBlock from './AboutBlock';
const about = homeContent.about;
describe('AboutBlock', () => {
it('shows the label, heading, text, photo and link', async () => {
const { container } = await renderWithProviders(
<AboutBlock content={about} />,
);
const section = screen.getByRole('region', { name: about.title });
expect(
within(section).getByRole('heading', { level: 2 }),
).toHaveTextContent(about.title);
expect(within(section).getByText(about.eyebrow)).toBeInTheDocument();
about.paragraphs.forEach((paragraph) =>
expect(within(section).getByText(paragraph)).toBeInTheDocument(),
);
expect(within(section).getByRole('img')).toHaveAccessibleName(
about.image.alt,
);
expect(
within(section).getByRole('link', { name: about.link.label }),
).toHaveAttribute('href', '/over-mij');
expect(await axeResults(container)).toHaveNoViolations();
});
});
@@ -0,0 +1,55 @@
import { Grid, Link, Stack, Text } from '@chakra-ui/react';
import FramedImage from '@/components/FramedImage/FramedImage';
import HomeSection from '@/components/HomeSection/HomeSection';
import Reveal from '@/components/Reveal/Reveal';
import RouterLink from '@/components/RouterLink';
import SectionHeading from '@/components/SectionHeading/SectionHeading';
import type { HomeContent } from '@/content/types';
const TITLE_ID = 'about-title';
type AboutBlockProps = {
content: HomeContent['about'];
};
// "Over mij": a framed photo of Andrea next to a short introduction with a
// link to the about page (design .about). Stacked on phones and tablets.
export default function AboutBlock({ content }: AboutBlockProps) {
return (
<HomeSection labelledBy={TITLE_ID} tone="alt" data-testid="about-block">
<Grid
templateColumns={{ base: '1fr', lg: '1fr 1fr' }}
gap="clamp(2rem, 6vw, 5.5rem)"
alignItems="center"
>
<Reveal>
<FramedImage image={content.image} aspectRatio="4 / 3" />
</Reveal>
<Reveal>
<SectionHeading
id={TITLE_ID}
eyebrow={content.eyebrow}
title={content.title}
align="start"
spacing="compact"
/>
<Stack gap={4} color="ink.soft">
{content.paragraphs.map((paragraph) => (
<Text key={paragraph}>{paragraph}</Text>
))}
<Text>
<Link variant="underline" asChild>
<RouterLink
to={content.link.to}
data-testid="about-block-link"
>
{content.link.label}
</RouterLink>
</Link>
</Text>
</Stack>
</Reveal>
</Grid>
</HomeSection>
);
}
@@ -0,0 +1,73 @@
import { screen, waitFor } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import homeContent from '@/content/homeContent';
import packages from '@/content/packages';
import siteContent from '@/content/siteContent';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import ContactSection from './ContactSection';
const renderSection = (pakket?: string, path = '/') =>
renderWithProviders(
<ContactSection
content={homeContent.contact}
packages={packages}
enabled={false}
email={siteContent.email}
pakket={pakket}
/>,
{ path },
);
const heading = () =>
screen.getByRole('heading', { level: 2, name: 'Contact' });
// The form is a lazy chunk; its first import can take over a second under
// the full suite with coverage
const LAZY_LOAD = { timeout: 10_000 };
const shoot = () =>
screen.findByTestId('contact-form-shoot', undefined, LAZY_LOAD);
describe('ContactSection', () => {
it('is the contact anchor with heading, lead and the gated form', async () => {
const { container } = await renderSection();
const section = screen.getByRole('region', { name: 'Contact' });
await shoot();
expect(section).toHaveAttribute('id', 'contact');
expect(screen.getByText(homeContent.contact.lead)).toBeInTheDocument();
expect(screen.getByTestId('contact-gate-notice')).toBeInTheDocument();
expect(
screen.getByRole('link', { name: 'Stuur een e-mail' }),
).toHaveAttribute(
'href',
'mailto:info@andreaslop.nl?subject=Vraag%20via%20andreaslop.nl',
);
expect(heading()).not.toHaveFocus();
expect(await axeResults(container)).toHaveNoViolations();
});
it('takes over a package from "Boek ...", tidies the URL and moves focus here', async () => {
const { router } = await renderSection(
'newborn',
'/?pakket=newborn#contact',
);
expect(await shoot()).toHaveValue('newborn');
expect(
screen.getByRole('link', { name: 'Stuur een e-mail' }),
).toHaveAttribute(
'href',
'mailto:info@andreaslop.nl?subject=Aanvraag%20fotoshoot%3A%20Newborn',
);
await waitFor(() => expect(router.state.location.searchStr).toBe(''));
expect(router.state.location.hash).toBe('contact');
expect(heading()).toHaveFocus();
});
it('ignores an unknown package but still tidies the URL', async () => {
const { router } = await renderSection(
'bruiloft',
'/?pakket=bruiloft#contact',
);
expect(await shoot()).toHaveValue('');
await waitFor(() => expect(router.state.location.searchStr).toBe(''));
});
});
@@ -0,0 +1,151 @@
import { lazy, Suspense, useEffect, useMemo, useState } from 'react';
import { Box, useMediaQuery } from '@chakra-ui/react';
import { useNavigate } from '@tanstack/react-router';
import { DEFERRED_LOAD_MARGIN } from '@/components/DeferredImage/DeferredImage';
import ContactFormGate from '@/components/ContactForm/ContactFormGate';
import HomeSection from '@/components/HomeSection/HomeSection';
import Reveal from '@/components/Reveal/Reveal';
import SectionHeading from '@/components/SectionHeading/SectionHeading';
import type {
EmailAddress,
HomeContent,
PricingPackage,
} from '@/content/types';
import useInView from '@/hooks/useInView';
import { mailSubject } from '@/lib/mailLink';
import { packageFromSearch } from '@/lib/packageFromSearch';
import { shootOptions } from '@/lib/shootOptions';
import { visiblePackages } from '@/lib/visiblePackages';
// The form (Chakra fields, validation, reducer) sits far below the hero.
// Loading it with the page cost ±0.03 Lighthouse performance on mobile, so
// it loads when the section comes near the screen, or straight away when
// the visitor arrives via "Boek ...".
const ContactForm = lazy(() => import('@/components/ContactForm/ContactForm'));
const TITLE_ID = 'contact-title';
// Keeps the form's space while it loads, so the notice sits where it will
// stay and the page below does not jump (measured: 604px on phones, where
// name and e-mail are stacked, 502px from sm)
const FORM_PLACEHOLDER_HEIGHT = { base: '604px', sm: '502px' };
type ContactSectionProps = {
content: HomeContent['contact'];
packages: PricingPackage[];
enabled: boolean;
email: EmailAddress;
// ?pakket= from a "Boek ..." link on a price card
pakket?: string;
};
// "Contact" on the homepage (design #contact): heading and lead, and the
// contact form behind the coming-soon gate. Takes over a package chosen via
// "Boek ...", then tidies the URL and moves focus here (BR-PARAM-02,
// BR-FOCUS-01).
export default function ContactSection({
content,
packages,
enabled,
email,
pakket,
}: ContactSectionProps) {
const navigate = useNavigate();
const shown = useMemo(() => visiblePackages(packages), [packages]);
const options = useMemo(() => shootOptions(packages), [packages]);
// Take over a new ?pakket= while rendering (React's pattern for a
// changed prop); the last "Boek" click wins (BR-PARAM-03)
const [seenPakket, setSeenPakket] = useState<string | undefined>();
const [preselect, setPreselect] = useState<{
shoot: string;
key: number;
}>();
const [chosenName, setChosenName] = useState<string>();
if (pakket !== seenPakket) {
setSeenPakket(pakket);
const id =
pakket === undefined ? undefined : packageFromSearch(pakket, shown);
if (id) {
setPreselect({ shoot: id, key: (preselect?.key ?? 0) + 1 });
setChosenName(shown.find((pkg) => pkg.id === id)?.name);
}
}
// Then remove ?pakket= from the address bar (no extra history entry) and
// continue keyboard and screen reader users here. This navigation
// replaces the "Boek" click's before the router has scrolled for it, so
// it must ask the router to scroll to #contact itself.
const [reducedMotion] = useMediaQuery(
['(prefers-reduced-motion: reduce)'],
{ ssr: false },
);
useEffect(() => {
if (pakket === undefined) return;
void navigate({
to: '/',
search: {},
hash: 'contact',
replace: true,
resetScroll: false,
hashScrollIntoView: {
behavior: reducedMotion ? 'auto' : 'smooth',
block: 'start',
},
});
document.getElementById(TITLE_ID)?.focus({ preventScroll: true });
// Only when a new ?pakket= arrives, not when the motion setting changes
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [pakket, navigate]);
const subject = mailSubject(chosenName);
const { ref, inView } = useInView<HTMLDivElement>({
rootMargin: DEFERRED_LOAD_MARGIN,
});
// Once loaded the form stays, also after ?pakket= is removed from the
// URL; otherwise it would be recreated and lose what was typed
const [formLoaded, setFormLoaded] = useState(false);
if (!formLoaded && (inView || pakket !== undefined)) setFormLoaded(true);
const placeholder = <Box minH={FORM_PLACEHOLDER_HEIGHT} />;
return (
<HomeSection
labelledBy={TITLE_ID}
id="contact"
width="narrow"
data-testid="contact-section"
>
<Reveal>
<SectionHeading
id={TITLE_ID}
title={content.title}
lead={content.lead}
focusable
/>
</Reveal>
<Reveal>
<ContactFormGate
enabled={enabled}
email={email}
subject={subject}
>
<Box ref={ref}>
{formLoaded ? (
<Suspense fallback={placeholder}>
<ContactForm
idPrefix="home-contact"
options={options}
preselect={preselect}
mailSubject={subject}
email={email}
/>
</Suspense>
) : (
placeholder
)}
</Box>
</ContactFormGate>
</Reveal>
</HomeSection>
);
}
@@ -0,0 +1,66 @@
import { screen, within } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import homeContent from '@/content/homeContent';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import InstagramGrid from './InstagramGrid';
const instagram = homeContent.instagram;
const PROFILE = 'https://www.instagram.com/andreaslopfotografie/';
function expectExternal(link: HTMLElement) {
expect(link).toHaveAttribute('href', PROFILE);
expect(link).toHaveAttribute('target', '_blank');
expect(link).toHaveAttribute('rel', 'noopener noreferrer');
}
describe('InstagramGrid', () => {
it('shows the heading and the handle as a link to the profile', async () => {
const { container } = await renderWithProviders(
<InstagramGrid content={instagram} profileUrl={PROFILE} />,
);
const section = screen.getByRole('region', { name: 'Instagram' });
expect(
within(section).getByRole('heading', { level: 2 }),
).toHaveTextContent('Instagram');
const handle = screen.getByTestId('instagram-handle-link');
expect(handle).toHaveAccessibleName(
'@andreaslopfotografie (opent in nieuw tabblad)',
);
expectExternal(handle);
expect(await axeResults(container)).toHaveNoViolations();
});
it('shows six photo tiles in order, each linking to the profile', async () => {
await renderWithProviders(
<InstagramGrid content={instagram} profileUrl={PROFILE} />,
);
const items = within(screen.getByRole('list')).getAllByRole('listitem');
expect(items).toHaveLength(6);
instagram.photos.forEach((photo, index) => {
const tile = screen.getByTestId(`instagram-tile-${index + 1}`);
expect(items[index]).toContainElement(tile);
expectExternal(tile);
expect(tile).toHaveAccessibleName(
`${photo.alt} (Instagram, opent in nieuw tabblad)`,
);
const image = within(tile).getByRole('img');
expect(image).toHaveAttribute('loading', 'lazy');
expect(image).toHaveAttribute('width', String(photo.width));
});
});
it('still renders the heading and handle when there are no photos', async () => {
await renderWithProviders(
<InstagramGrid
content={{ ...instagram, photos: [] }}
profileUrl={PROFILE}
/>,
);
expect(
screen.getByRole('heading', { name: 'Instagram' }),
).toBeInTheDocument();
expect(screen.getByTestId('instagram-handle-link')).toBeInTheDocument();
expect(screen.queryAllByRole('img')).toHaveLength(0);
});
});
@@ -0,0 +1,117 @@
import { Box, chakra, Container, Link, VisuallyHidden } from '@chakra-ui/react';
import DeferredImage from '@/components/DeferredImage/DeferredImage';
import HomeSection from '@/components/HomeSection/HomeSection';
import Reveal from '@/components/Reveal/Reveal';
import SectionHeading from '@/components/SectionHeading/SectionHeading';
import type { HomeContent } from '@/content/types';
const TITLE_ID = 'instagram-title';
type InstagramGridProps = {
content: HomeContent['instagram'];
// A checked https link (visibleSocials); without one the route leaves
// the section out
profileUrl: string;
};
// "Instagram" (design .instagram): the handle as a link to the profile and
// a row of square photos running from edge to edge, each linking to the
// profile too. A fixed selection until the API delivers the real feed.
export default function InstagramGrid({
content,
profileUrl,
}: InstagramGridProps) {
return (
<HomeSection
labelledBy={TITLE_ID}
spacing="tight"
width="full"
data-testid="instagram-grid"
>
<Container maxW="content">
<Reveal>
<SectionHeading
id={TITLE_ID}
title={content.title}
lead={
<Link
variant="underline"
href={profileUrl}
target="_blank"
rel="noopener noreferrer"
data-testid="instagram-handle-link"
>
{/* Space outside the hidden text, or it drops
out of the announced name */}
{content.handle}{' '}
<VisuallyHidden>
(opent in nieuw tabblad)
</VisuallyHidden>
</Link>
}
/>
</Reveal>
</Container>
<Reveal>
{/* The design's 680px and 1100px steps on the theme breakpoints */}
<chakra.ul
listStyleType="none"
display="grid"
gridTemplateColumns={{
base: 'repeat(2, 1fr)',
md: 'repeat(3, 1fr)',
xl: 'repeat(6, 1fr)',
}}
gap="2px"
>
{content.photos.map((photo, i) => (
// The same photo may appear twice in a feed
<chakra.li key={`${i}-${photo.src}`}>
<chakra.a
href={profileUrl}
target="_blank"
rel="noopener noreferrer"
data-testid={`instagram-tile-${i + 1}`}
display="block"
position="relative"
// Keeps the focus ring above the neighbouring
// tiles, which sit only 2px away
_focusVisible={{ zIndex: 1 }}
className="group"
>
<Box overflow="hidden" bg="paper.deep">
<DeferredImage
image={photo}
w="100%"
aspectRatio="1 / 1"
objectFit="cover"
transitionProperty="transform, opacity"
transitionDuration="interaction"
transitionTimingFunction="smooth"
_groupHover={{
transform: 'scale(1.06)',
opacity: 0.85,
}}
_groupFocusVisible={{
transform: 'scale(1.06)',
opacity: 0.85,
}}
// Only the fade, no zoom
_motionReduce={{
transform: 'none !important',
}}
/>
</Box>
{/* The photo's alt names the link; this says
where it goes */}{' '}
<VisuallyHidden>
(Instagram, opent in nieuw tabblad)
</VisuallyHidden>
</chakra.a>
</chakra.li>
))}
</chakra.ul>
</Reveal>
</HomeSection>
);
}

Some files were not shown because too many files have changed in this diff Show More