Files
SluijsensandClaude Opus 5.5 c81dcd3979 Adds the inception docs and design for the homepage sections
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>
2026-10-19 23:46:30 +02:00

87 lines
5.5 KiB
Markdown

# 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 |