Shows client reviews one at a time with the framed photo, a large quotation mark, the shoot type and the names. Uses Chakra's carousel for paging, looping and swiping with our own controls, so visitors who prefer reduced motion get instant changes, and loads the carousel only when the section comes near the screen so the hero does not wait for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3.5 KiB
3.5 KiB
Frontend Components — Unit 4: Lieve woorden
Hierarchy
graph TD
Route["routes/index.tsx"] --> T["home/Testimonials"]
T --> Section["HomeSection tone alt"]
T --> Heading["SectionHeading"]
T --> Root["Carousel.Root loop"]
Root --> Group["Carousel.ItemGroup"]
Group --> Item["Carousel.Item x n"]
Item --> Slide["home/Testimonials/TestimonialSlide"]
Slide --> Framed["FramedImage 4 by 5"]
Root --> Control["Carousel.Control: Prev, Indicators, Next"]
T --> Live["Live region"]
Lib["lib: visibleTestimonials, slideLabel"] -.-> T
classDef root fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
classDef ui fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef logic fill:#9C27B0,stroke:#4a148c,stroke-width:1px,color:#000;
class Route root;
class T,Section,Heading,Root,Group,Item,Slide,Framed,Control,Live ui;
class Lib logic;
Text alternative: the home route renders Testimonials, which uses HomeSection, SectionHeading, a looping Chakra Carousel with one item per review (each a TestimonialSlide with a FramedImage) and a control bar with previous, dots and next, plus a live region; pure helpers supply the shown reviews and labels.
Testimonials
- Props:
{ content: HomeContent['testimonials']; testimonials: Testimonial[] } - Behaviour:
visibleTestimonials; none →null; one → theTestimonialSlidedirectly (no carousel); two or more →Carousel.RootwithslideCount,loop,allowMouseDrag, one slide per page. - Layout:
HomeSectionwithtone="alt",data-testid="testimonials", centredSectionHeading. Controls centred below the slides, marginclamp(2.5rem, 5vw, 4rem). - Equal height (BR-REV-07): items stretch in the item group's row, so all slides take the tallest height; content vertically centred within.
- Reduced motion (BR-REV-06): the item group's scrolling is instant (
scroll-behavior: auto). - Announcements (BR-REV-08): a
VisuallyHiddenpolite live region, empty on load, set toslideLabel(page, count)inonPageChange. Any live region Chakra adds itself is checked so only one announcement is made. - Controls:
Carousel.PrevTrigger/NextTriggerwith Dutcharia-labels and arrow icons from the offline icon set (as the hero), 48 px square,lineborder,inkborder on hover/focus;Carousel.Indicatorper page, 44 px hit area around an 8 px dot (accent.deepoutline, filled when current). - Test ids:
testimonials,testimonials-prev,testimonials-next,testimonials-dot-{n},testimonial-{id}.
TestimonialSlide
- Props:
{ testimonial: Testimonial } - Layout: grid
5fr 7frfromlgwith gapclamp(2rem, 6vw, 5.5rem), centred vertically; stacked belowlgwith the photo max 420 px wide. - Photo:
FramedImagewith aspect4 / 5(the source photos are cropped to 4:5 when prepared). - Text: decorative quotation mark (Marcellus,
clamp(5rem, 9vw, 7.5rem),accent,aria-hidden); shoot as eyebrow (accent.deep);figure>Blockquote(Marcellus,clamp(1.35rem, 2.2vw, 1.75rem), line-height 1.5,ink) >figcaptionwith "— " + author in small caps (ink.soft).
Accessibility (NFR-HP-01)
- Region named by the h2 "Lieve woorden"; the carousel has
aria-roledescription"carrousel" and a label "Reviews"; slides "Review n van m" (BR-REV-09). - Hidden slides are inert to keyboard and screen readers (BR-REV-10).
- Focus ring from the theme on all controls; targets ≥ 44 px.
- Axe clean; Lighthouse accessibility stays 1.0.