Adds the Contact section to the homepage
Adds the contact form with the live fields, validation and browser-side anti-spam, behind a coming-soon notice with a mail button until the API exists. A "Boek" link on a price card selects its package, tidies the URL and moves focus to the form. The form loads only when it comes near the screen, so the hero does not wait for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+57
@@ -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**.
|
||||
Reference in New Issue
Block a user