AB#477 ยท Motion Design for the Web, 1:19:52 โ†’ 1:31:00

Click-triggered transitions

Motion doesn't have to come from hover. The course's examples, rebuilt with what browsers support today (our cutoff: Baseline Widely available), with a fallback wherever a newer feature isn't there yet. Turn on Reduce motion in your phone's settings: everything still works, instantly.

1. Hover reveal card (checkpoint 1:19:52)

Hover, or Tab to the link: the image zooms out a little and the caption slides up. On a phone (no hover) the caption is shown at rest.

2. The same card, on click (checkpoint 1:31:00)

Click, or press Enter or Space on the button. The course toggles a class on a div with JavaScript; here a real button carries aria-expanded and CSS reacts to it with :has(), so no extra class and keyboards work for free.

Bookings without the back-and-forth

Clients pick a time, pay the deposit and get a reminder the day before. You see one list of who's coming.

3. Generalized: a collapsible that opens from the header down

The first place we use it on the Agency website. A is our pick (Widely available today); B is where it goes once ::details-content is Widely available (about March 2028).

A. Button + grid-template-rows: 0fr โ†’ 1fr (the Agency website pick)

We map how orders, bookings and questions reach you today, then set up the first one to answer itself. The panel opens from this header down; press again to close it.

B. Native <details> + ::details-content (newer; animates only where supported)

How do I pay?

Card or bank transfer, monthly. Browsers with ::details-content and interpolate-size slide this open; others open it instantly, which is the fallback.

4. Same-document view transition (newer; instant fallback)

One click moves the card from the grid into the detail spot. document.startViewTransition() animates it where supported; elsewhere, and under Reduce motion, it just swaps.

Pick one to see it here.

5. What replaced what, and its Baseline status

Statuses from the web-features data set 3.48.0 (the source of Baseline), read Dec 1, 2026. Widely available = 30 months after the last core browser shipped it.

The course's way (2024)Today's wayBaselineUsed here
div + click listener + classList.toggle()<button aria-expanded>, CSS reads the state with :has():has() Widely (since Jun 19, 2026)Yes (2)
Animate max-height to a guessed big numbergrid-template-rows: 0fr โ†’ 1frGrid animation Widely (since Apr 27, 2025)Yes (2, 3A, site)
Measure scrollHeight in JS, set heightinterpolate-size: allow-keywords / calc-size()Limited (Chromium only)Progressive (3B)
Hand-built accordion markup<details> + ::details-contentdetails Widely; ::details-content Newly (Sep 16, 2025)Progressive (3B)
display: none toggled after a timeout@starting-style + transition-behavior: allow-discreteNewly (Aug 6, 2024)Progressive (3B)
FLIP by hand (measure, invert, play)Same-document View TransitionsNewly (Oct 14, 2025)Progressive (4)
transform: scale() mixed into one transformscale / translate propertiesWidely (since Feb 5, 2025)Yes (1, 2)
Hidden text unreachable by findhidden="until-found" + beforematchLimited (no Safari)Progressive (site)
Reduced motion often skippedprefers-reduced-motion around every transitionWidelyYes (all)