On phones the review photo is smaller and centred, the content sits at the top of each slide so a short review no longer floats in the middle, and the gap between photo and text is tighter. On desktop the photo column is about three quarters of its earlier width. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3.7 KiB
3.7 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 11frfromlg(photo column ±75% of the design's5fr 7fr) with gapclamp(2rem, 6vw, 5.5rem), centred vertically; stacked belowlgwith the photo centred, max 180 px wide on phones and 320 px on tablets, content aligned to the top (slides share the tallest height) and a 1.25 rem gap between photo and text (owner's choices after review). - 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.