Adds the shared gallery building blocks
A masonry photo grid that keeps the reading order (pure CSS, no measuring in the browser), an accessible lightbox on Chakra's Dialog with wrap-around browsing, keys, swipe and preloading, and a filter bar of toggle buttons. They work on generic gallery items, so other pages can use them. The swipe logic moves out of the hero into a shared hook; the hero behaves as before. The rules behind them live in pure helpers with property-based tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,13 +42,15 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
|
||||
- `IntroGallery({ content })`, `AboutBlock({ content })`, `Pricing({ content, packages })`, `PriceCard(...)`, `Testimonials({ content, testimonials })`, `ContactSection({ content, packages, enabled, email, pakket? })`, `InstagramGrid({ content: InstagramContent, profileUrl })` (shared, `components/InstagramGrid/`)
|
||||
- `ContactForm(...)`, `ContactFormGate({ enabled, email, ... })`
|
||||
- `PhotoDuo({ photos: [ContentImage, ContentImage], label, 'data-testid'? })`
|
||||
- `PortfolioGrid({ items: GalleryItem[], eagerCount = 3, onOpen(index), onIntent?(), 'data-testid'? })`, `Lightbox({ items, index: number | null, onIndexChange, onClose, label?, finalFocusEl? })` (default export, lazy-loadable), `FilterBar({ options: FilterOption[], value, onChange, label })`
|
||||
- `about/AboutIntro({ content })`, `about/StorySection({ content, titleId, tone?, spacing?, children? })`, `shoots/ShootList({ shoots, packages, portfolioLive })`, `shoots/ShootBlock({ shoot, packages, reverse, priority, portfolioLive })`
|
||||
- `StatusPage({ title, children, actions? })`, `ErrorPage({ error, reset })`
|
||||
- `LinkButton(RouterLink props & { variant?: 'outline' | 'accent' | 'light' })`
|
||||
- `UmamiAnalytics({ hostname? })`
|
||||
|
||||
### Hooks
|
||||
- `useHeroSlider(count)` → slider state, controls, handlers, `HeroAnnouncement`
|
||||
- `useHeroSlider(count)` → slider state, controls, handlers, `HeroAnnouncement` (swipe via `useSwipe`, wrap via `wrapIndex`)
|
||||
- `useSwipe({ onPrev, onNext, enabled? })` → `{ onTouchStart, onTouchEnd }` (threshold and direction from `lib/swipeDirection`)
|
||||
- `useScrolledPast(getThreshold)` → boolean (stable `getThreshold` required)
|
||||
- `useRouteFocus()` — focuses `<main>` after navigation
|
||||
- `useInView({ rootMargin, skip })` → `{ ref, inView }`; `usePageLoaded()` → boolean; `useReveal()` → `{ ref, visible }`
|
||||
@@ -60,6 +62,7 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
|
||||
- `slidesToLoad(active, count): number[]`
|
||||
- `backToTopThreshold(viewportHeight): number`
|
||||
- `slideLabel`, `formatPrice`, `bookLabel`, `visiblePackages`, `visibleTestimonials`, `packageFromSearch`, `shootOptions`, `mailSubject`/`mailtoLink`, `validateField`/`validateContact`, `isLikelySpam`, `toContactPayload`, `contactFormReducer`
|
||||
- Gallery (portfolio-page): `wrapIndex(index, count)`, `swipeDirection(start, end, threshold = 50)`, `masonryRowSpan({ width, height }, K = 40, gapRows = 2)`, `neighbourIndexes(index, count, radius = 2)`, `lightboxReducer(state, event)` (+ `LightboxState`, `LightboxEvent`)
|
||||
|
||||
### Monitoring
|
||||
- `monitoringFor(hostname): Monitoring | null`, `startSentry(hostname?)`, `reportError(error)`
|
||||
|
||||
@@ -20,7 +20,7 @@ graph TD
|
||||
Outlet --> Placeholders["portfolio, contact, privacyverklaring: PageIntro"]
|
||||
Home --> Hero["Hero (HeroArrows, HeroPauseButton, HeroSocials, useHeroSlider)"]
|
||||
Home --> Sections["components/home/: IntroGallery, AboutBlock, Pricing, Testimonials, ContactSection; shared InstagramGrid"]
|
||||
Sections --> Blocks["Shared blocks: PageSection, MediaText, CallToAction, RichParagraph, Eyebrow, SectionHeading, FramedImage, DeferredImage, Reveal"]
|
||||
Sections --> Blocks["Shared blocks: PageSection, MediaText, CallToAction, RichParagraph, Eyebrow, SectionHeading, FramedImage, DeferredImage, Reveal; gallery: PortfolioGrid, Lightbox, FilterBar"]
|
||||
Sections --> Form["ContactForm + ContactFormGate (lazy), contact/"]
|
||||
Content["content/: siteContent, heroContent, homeContent, packages, testimonials, types"] -.-> Shell
|
||||
Content -.-> Home
|
||||
@@ -79,7 +79,7 @@ Text alternative: main.tsx starts Sentry and mounts the router; the root route r
|
||||
|
||||
### Shared section building blocks
|
||||
- **Purpose**: Reusable pieces extracted during homepage-sections; `HomeSection` was renamed to `PageSection` and `MediaText`/`Eyebrow` were extracted in over-mij-page
|
||||
- **Responsibilities**: `PageSection` (section frame: `aria-labelledby`, tone `paper`/`alt`, width `default`/`narrow`/`full`, spacing `default`/`tight`/`flushTop`, anchor offset), `MediaText` (framed photo next to a text column, design `.about`), `Eyebrow` (accent label, optionally a heading), `SectionHeading` (eyebrow + h2 + lead, align start/center, compact spacing), `FramedImage` (photo with a coloured offset block, sand by default, design `.about__media`), `CallToAction` (closing block: h2, lead, action; added in soorten-fotoshoots-page), `RichParagraph` (paragraph with inline links), `DeferredImage` (loads after page load and near the viewport, reserves space), `Reveal` (fade-in on scroll, content always in the DOM, reduced motion respected)
|
||||
- **Responsibilities**: `PageSection` (section frame: `aria-labelledby`, tone `paper`/`alt`, width `default`/`narrow`/`full`, spacing `default`/`tight`/`flushTop`, anchor offset), `MediaText` (framed photo next to a text column, design `.about`), `Eyebrow` (accent label, optionally a heading), `SectionHeading` (eyebrow + h2 + lead, align start/center, compact spacing), `FramedImage` (photo with a coloured offset block, sand by default, design `.about__media`), `CallToAction` (closing block: h2, lead, action; added in soorten-fotoshoots-page), `RichParagraph` (paragraph with inline links), `DeferredImage` (loads after page load and near the viewport, reserves space), `Reveal` (fade-in on scroll, content always in the DOM, reduced motion respected); gallery blocks from portfolio-page: `PortfolioGrid` (CSS-only masonry in reading order, first 3 photos eager), `Lightbox` (Chakra `Dialog`, wrap-around browsing, keys, swipe, preloading, load-error note), `FilterBar` (toggle buttons, `filterControl` recipe)
|
||||
- **Type**: Application (shared UI)
|
||||
|
||||
### components/PageIntro/, StatusPage/
|
||||
|
||||
@@ -85,7 +85,8 @@ Candidates for modification are marked with ★ for the over-mij-page feature.
|
||||
- ★ `web/src/content/types.ts` — content interfaces (API shape)
|
||||
- ★ `web/src/content/*.ts` — static content (`siteContent`, `heroContent`, `homeContent` (exports `introPhotos`), `instagramContent`, `packages`, `testimonials`, `socialPlatforms`)
|
||||
- `web/src/contact/*` — contact form types and placeholder submit
|
||||
- `web/src/hooks/*` — `useRouteFocus`, `useScrolledPast`, `useInView`, `usePageLoaded`, `useReveal`
|
||||
- `web/src/hooks/*` — `useRouteFocus`, `useScrolledPast`, `useInView`, `usePageLoaded`, `useReveal`, `useSwipe` (shared by the hero and the lightbox)
|
||||
- `web/src/components/{PortfolioGrid,Lightbox,FilterBar}/` — gallery building blocks (portfolio-page unit 2): masonry grid in reading order (CSS only), lightbox on Chakra `Dialog` (lazy-loadable default export), single-choice toggle buttons; generic over `GalleryItem` / `FilterOption`
|
||||
- `web/src/lib/*.ts` — pure helpers with tests
|
||||
- `web/src/monitoring/*` — Sentry/Umami config and loader
|
||||
- `web/src/navigation.ts` — `RoutePath`, `mainNav`, `footerNav`
|
||||
|
||||
Reference in New Issue
Block a user