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)`
|
||||
|
||||
Reference in New Issue
Block a user