Refreshes the shared reverse engineering docs, adds the requirements, application design and units for the homepage-sections feature, and updates the static design: live prices and form fields, the new Lieve woorden block and the coming-soon gate over the contact form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
83 lines
7.1 KiB
Markdown
83 lines
7.1 KiB
Markdown
# 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).
|