# Requirements: testimonials-redesign ## Intent analysis | Item | Value | |---|---| | User request | Make the "Lieve woorden" testimonials more elegant and closer to the style of the live site, keep the controls, no autoplay. Built on a design canvas (desktop and mobile) that the owner reviewed in several rounds. | | Request type | Enhancement (new look and new behaviour of an existing component) | | Scope | Multiple components: the Testimonials section, the shared `SectionHeading`, the content model and the theme | | Complexity | Moderate: the carousel logic and a lazy-load placeholder exist and must keep working; the heading change reaches every page that uses `SectionHeading` | | Depth | Standard | | Design source | Design canvas (private). It is the visual reference; the numbers below are taken from it. | | Questions | `requirement-verification-questions.md` (6 questions, all answered) | ## Decisions from the questions | Q | Decision | |---|---| | 1 | The new heading style applies everywhere `SectionHeading` is used (homepage sections, over-mij intro, shoot pages, Instagram section): 8 usages in 8 components | | 2 | The Testimonials section stays on `tone="alt"`; the card colour is constant | | 3 | Optional `imagePosition` field per review sets the crop of the landscape photo | | 4 | Security Baseline extension: enforced | | 5 | Property-Based Testing extension: enforced (full) | | 6 | No Operations phase | ## Functional requirements Replaces and extends the homepage-sections spec for the testimonials (BR-REV-01..11). Rules that are not mentioned stay as they are. | ID | Requirement | |---|---| | FR-TR-01 | **Desktop layout (from `lg`)**: a landscape photo (3:2) on the left, about 57% of the content width, overlaps a card on the right (about 56% of the width, 400 px high). The photo starts 40 px below the top of the card. The card runs to the right edge of the content area. | | FR-TR-02 | **Phone and tablet layout (below `lg`)**: heading, then the photo at full width (4:3), then the card overlapping the bottom of the photo by 36 px, with the controls centred below it. | | FR-TR-03 | **Card**: always `paper.deep` (`#e8e0d5`), on both `paper` and `paper.alt` sections. The text in it is centred: shoot type, quote, names. | | FR-TR-04 | **Typography**: shoot type in the heading font, uppercase, letter-spacing 0.2em, 21 px (19 px on phones); quote in the body font, weight 300, 17 px (16.5 px on phones), line-height 1.75, colour `ink.soft`; names uppercase, small, letter-spaced, colour `accent.deeper`. The large decorative quotation mark is removed (BR-REV-11 changes: the quote stays a `blockquote` with the names as its `figcaption`, without a decorative mark). | | FR-TR-05 | **Section heading**: a new text style used by `SectionHeading`: heading font, uppercase, letter-spacing 0.22em, 30 px from `md` and 26 px below (as on the canvas), centred. The hairline of the canvas is not part of it. The eyebrow and lead of `SectionHeading` keep their style. The accessible text of the heading does not change (the case is only CSS). | | FR-TR-06 | **Controls**: previous and next as icon-only buttons without a circle or border, each with a 44 px target, with the visible counter "X / Y" between them (X is the current review, Y the number of reviews, both counted from 1). Hover lightens the icon. The buttons keep their names "Vorige review" and "Volgende review". The arrow keys still work while focus is in the control bar (BR-REV-04). | | FR-TR-07 | **Navigation**: only the buttons, the arrow keys, swiping and dragging with the mouse change the review. No autoplay, no pause control and no dots. BR-REV-04 and BR-REV-09 (the dots and their labels) no longer apply. | | FR-TR-08 | **Animation**: a change slides the whole slide (card, photo and text) horizontally; a swipe follows the finger. Under `prefers-reduced-motion` the change is immediate (BR-REV-06 stays). | | FR-TR-09 | **Kept**: the loop at both ends (BR-REV-05), equal height of all slides (BR-REV-07), one polite announcement "Review n van m" for each manual change and nothing on load (BR-REV-08), hidden slides not focusable or readable (BR-REV-10), a single review without controls, and the section left out when no review is valid (BR-REV-01/02). | | FR-TR-10 | **Section tone**: `Testimonials` stays on `tone="alt"`. Only the block background alternates; the card does not change with it. | | FR-TR-11 | **Crop**: `Testimonial` gets an optional `imagePosition` (a CSS `object-position` of two percentages, e.g. `"50% 42%"`). Missing or invalid values fall back to the centre (`"50% 50%"`). The content sets `"50% 42%"` for the trouwshoot photo and the centre for the newborn photo. A review without the field stays valid (`isValidTestimonial` does not change). | | FR-TR-12 | **Counter and position helpers**: two small pure functions in `web/src/lib`: one returns the text "X / Y" for an index and a count, one normalises an `imagePosition` value to a safe `"N% N%"` string. | | FR-TR-13 | **Lazy-load placeholder**: until the carousel has loaded (and in the prerendered HTML) the placeholder shows the longest review laid out exactly like a slide plus the height of the controls, so nothing below moves when the carousel takes its place. The other reviews stay in the page, visually hidden, aria-hidden and inert (BR-LZY-02). | | FR-TR-14 | **Documentation**: `LAYOUT.md` (the Testimonials block) is updated following `.ai/layout-conventions.md`, and the lines of the reverse-engineering artifacts about the testimonials and the heading are updated. | ## Non-functional requirements | ID | Requirement | |---|---| | NFR-TR-01 | **Accessibility**: no axe violations in the prerendered HTML and in the hydrated page. Text contrast at least 4.5:1: names `accent.deeper` on `paper.deep`, quote `ink.soft` on `paper.deep`. Targets at least 44 px. The counter is not read out twice (it is visible text; the live region carries the announcement). | | NFR-TR-02 | **Performance**: the carousel code stays lazy-loaded, away from the hero. The Lighthouse targets in `web/lighthouserc.cjs` (for example `/` at 0.85) do not go down. Photos are not made larger: the existing 880 x 1100 files are used. | | NFR-TR-03 | **Motion**: no animation under `prefers-reduced-motion`; no motion that starts by itself (no autoplay). | | NFR-TR-04 | **Compatibility**: the hydrated page must match the prerendered HTML (no hydration mismatch) and must work without a visible jump in the placeholder swap. | | NFR-TR-05 | **Dependencies**: no new runtime dependencies. | | NFR-TR-06 | **Quality**: `pnpm check` (lint, types, tests, build, Lighthouse) is green. Tests: the tests and test ids of the dots are replaced; new example tests for the counter, the crop position and the controls; property tests for the pure helpers (see below). | ## Extension rules: applicability **Security Baseline (enforced).** The change is front-end only: no new inputs, endpoints, storage or dependencies. | Rule | Status | Note | |---|---|---| | SECURITY-01, 02, 03, 05, 06, 07, 08, 11, 12, 14 | N/A | No data store, network intermediary, API, identity or authentication in this change | | SECURITY-04 | Compliant (to verify) | Headers and CSP are untouched; the new styles must not need `unsafe-inline`; `imagePosition` is normalised before it reaches a style (FR-TR-12) | | SECURITY-09 | N/A | No deployment change | | SECURITY-10 | Compliant (to verify) | No new dependencies; the lock file stays committed | | SECURITY-13 | N/A | No external scripts or deserialisation | | SECURITY-15 | Compliant (to verify) | Invalid `imagePosition` and invalid reviews fail safe (fallback or skipped), never thrown | **Property-Based Testing (enforced, full).** Framework: `fast-check` (already a dependency, with shared arbitraries in `web/src/test`). Candidate properties, to be detailed in Functional Design (PBT-01): | Function | Category | Property | |---|---|---| | `slideCounter(index, count)` | Invariant | Always reads "X / Y" with 1 <= X <= Y | | `normalizeImagePosition(value)` | Invariant, idempotence | The result is always two percentages between 0 and 100; normalising twice gives the same result as once; any invalid input gives the centre | | `visibleTestimonials` (unchanged) | Invariant | Existing properties keep passing | | `slideLabel` (unchanged) | Invariant | Existing properties keep passing | Example tests keep pinning the key scenarios (PBT-10): "1 / 2", "2 / 2", the ring photo at `50% 42%`. ## Assumptions to check at review | ID | Assumption | |---|---| | A1 | `SectionHeading` has 8 usages; five more h2 elements use the `sectionTitle` text style directly (`CallToAction`, `PackageBlock`, `ShootBlock`, `ShootPage` x2, `StoryBlocks`). The new heading style is a separate text style used by `SectionHeading` only, so these five keep the current style. If you want them to match, say so and the style is applied there too. | | A2 | Uppercase and letter-spacing are applied in CSS, so long titles may wrap. The longest is "Lifestyle fotograaf met een passie voor storytelling" (52 characters, `AboutBlock`, maximum width 620 px): estimated at about three lines on desktop and four on a phone. This is checked during Build and Test on every page that uses `SectionHeading`; no text is shortened in unit 1. | | A3 | The pixel values from the canvas become relative units in the theme (the card's 56% and the photo's 57% of the content width). The overlap and offsets stay as in the canvas. | | A4 | Chakra's carousel stays the base (paging, snapping, looping, swiping, hidden slides); only the slide content, the controls and the animation change. | ## Out of scope - Autoplay, a pause control and the dots (removed on purpose). - New or landscape photos, and any change to the review texts. - The CMS that will deliver the reviews later (the new field is optional so it fits). - Other text styles that are not `SectionHeading` (see A1). - Deployment and monitoring (no Operations phase).