INTERACTION_093CSS
Expandable Card
A card grows in place to reveal its detail without a page change.
Cards / LightView
Quotes cross-fade and slide with an auto-advancing rhythm. The first quote visible, the rest offset 24px right at 0 opacity before the trigger; sliding the outgoing quote left while the next enters from the right once a 5 second interval, paused on hover and off-screen.
/* Testimonial Carousel — Quotes cross-fade and slide with an auto-advancing rhythm. */
.testimonial-carousel {
--dur: 520ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.testimonial-carousel > * {
opacity: 0;
transform: translateY(14px);
animation: testimonial-carousel-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* the first quote visible, the rest offset 24px right at 0 opacity -> sliding the outgoing quote left while the next enters from the right */
@keyframes testimonial-carousel-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.testimonial-carousel > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Testimonial Carousel — trigger: a 5 second interval, paused on hover and off-screen */
export function TestimonialCarousel({ children }: { children: React.ReactNode }) {
const ref = useRef<HTMLDivElement>(null);
useEffect(() => {
const el = ref.current;
if (!el) return;
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
el.dataset["state"] = "in";
return;
}
const io = new IntersectionObserver(
([entry]) => {
if (entry?.isIntersecting) {
el.dataset["state"] = "in";
io.unobserve(el);
}
},
{ threshold: 0.2 },
);
io.observe(el);
return () => io.disconnect();
}, []);
return (
<div ref={ref} className="testimonial-carousel" data-state="out">
{children}
</div>
);
}A card grows in place to reveal its detail without a page change.
The card content shifts subtly with pointer position.
Hovering one tile dims and recedes the rest of the grid.