Skip to content

176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.

fix: say when pointer-events helps during a view transition and that Next.js's App Router supports React's ViewTransition

matin59149a4bffb4
diff --git a/animations/03-page-transitions/view-transitions-api/README.md b/animations/03-page-transitions/view-transitions-api/README.md
index de4dbe15..3156376d 100644
--- a/animations/03-page-transitions/view-transitions-api/README.md
+++ b/animations/03-page-transitions/view-transitions-api/README.md
@@ -53,8 +53,8 @@ Switching the `data-vt` attribute swaps in a different keyframe set (slide, zoom
- **Suppress the root animation** (`::view-transition-old(root)`) when you only want a sub-region to animate; otherwise the whole page cross-fades underneath your named region.
- **Every `view-transition-name` must be unique** on the page at capture time. Two elements sharing a name in the same snapshot make the browser skip the transition: the page still changes, with no animation.
- **Honor reduced motion** — the demo drops straight to `showPage()` with no animation when `prefers-reduced-motion: reduce` is set.
-- **Presses wait for the transition.** While a view transition runs, Chrome sends every press on the page to the root element, so buttons do not respond until it ends (`pointer-events` on the transition's pseudo-elements does not change this); keep page transitions short. The demo passes a press over its box on as the visitor taking over, so a click there still stops Show me.
-- **Library equivalents**: Astro's `<ClientRouter />` (named `<ViewTransitions />` before Astro 5) and React's experimental `<ViewTransition>` component, which Next.js can switch on, wrap this API for client-side page changes; between full page loads the CSS rule `@view-transition { navigation: auto; }` does it without JavaScript. Barba.js and Swup predate the API and animate the old and new page content themselves; on supported browsers you often no longer need them.
+- **Presses wait for the transition.** While a view transition runs, Chrome sends every press on the page to the root element, so buttons do not respond until it ends (`pointer-events: none` on the transition's pseudo-elements does not change this while the root is captured, as it is by default); keep page transitions short. The demo passes a press over its box on as the visitor taking over, so a click there still stops Show me.
+- **Library equivalents**: Astro's `<ClientRouter />` (named `<ViewTransitions />` before Astro 5) and React's experimental `<ViewTransition>` component, which Next.js's App Router supports, wrap this API for client-side page changes; between full page loads the CSS rule `@view-transition { navigation: auto; }` does it without JavaScript. Barba.js and Swup predate the API and animate the old and new page content themselves; on supported browsers you often no longer need them.
## See also
- [Crossfade Transition](../crossfade/) — the same fade, built by hand
diff --git a/docs/superpowers/plans/2026-09-29-transitions-content.md b/docs/superpowers/plans/2026-09-29-transitions-content.md
index ceb0b380..7b6e149d 100644
--- a/docs/superpowers/plans/2026-09-29-transitions-content.md
+++ b/docs/superpowers/plans/2026-09-29-transitions-content.md
@@ -89,7 +89,7 @@ Eight demos put an element in its starting state with `transition:none` and star
- `settle()` calls `skipTransition()` on a view transition still running and marks the demo idle at once. The old navigation's `await t.finished` must then not run its end code; a run counter compared after the `await` handles this.
- A view transition skipped while the browser is still taking its first picture still runs its update callback afterwards. With today's `switchPage(prev,next)` that callback could undo a Reset made in the same frame, so the update callback shows the resting state for `current` as it is when the callback runs (`startViewTransition(()=>showPage(current))`), not the pages the navigation started with.
- `hb:input` cancels the way back. A view transition already running finishes.
- - **Presses during a view transition.** While a view transition runs (half a second at Normal), Chrome sends every press on the page to the root element (`<html>`), so the shared script never hears a press on the stage and no `hb:input` is sent. The page therefore listens for `pointerdown` and `click` on the root (capture phase, passive): when the event is trusted, its target is the root, the page's own view transition is running and the point lies inside the stage, it sends the same `hb:input` event, so a click on the stage during a transition still cancels the way back. Presses on the player bar (Show me, Reset, Slow motion) do nothing until the transition ends, and `::view-transition{pointer-events:none}` does not change that (checked in Chrome, on the top pseudo-element and on every view-transition pseudo-element); the README's Production notes say so.
+ - **Presses during a view transition.** While a view transition runs (half a second at Normal), Chrome sends every press on the page to the root element (`<html>`), so the shared script never hears a press on the stage and no `hb:input` is sent. The page therefore listens for `pointerdown` and `click` on the root (capture phase, passive): when the event is trusted, its target is the root, the page's own view transition is running and the point lies inside the stage, it sends the same `hb:input` event, so a click on the stage during a transition still cancels the way back. Presses on the player bar (Show me, Reset, Slow motion) do nothing until the transition ends, and `::view-transition{pointer-events:none}` does not change that while the root is captured, which is the default (checked in Chrome 154, on the top pseudo-element and on every view-transition pseudo-element). Only with `:root{view-transition-name:none}` as well does a press on Reset get through, and then only to content that is not named itself; the page keeps the default capture. The README's Production notes say so.
- **Reset:** yes. Home at once; a running view transition is skipped first, and without the API a fallback fade still running is cancelled.
- **Slow motion:** each navigation sets `--vt-dur` to Speed × 3 before it starts the view transition. The fallback crossfade for browsers without the API is stretched too: its 300ms fade becomes 900ms, and its 350ms wait becomes 950ms.
- **Reduced motion:** the demo's rule (`::view-transition-old(page-content),::view-transition-new(page-content){animation:none}`) and its `motionOk` branch (`switchPage()` at once) stay. Show me swaps to Work and back with no movement.
@@ -149,8 +149,8 @@ Eight demos put an element in its starting state with `transition:none` and star
- **README Production notes:** the support banner is gone, so the first bullet says what browsers without the API see: "the demo does exactly this so unsupported browsers still transition." becomes "the demo does exactly this, so browsers without the API still get a simple 300ms fade, whatever the Transition style and Speed." The rest changes as follows:
- **Browser support** is a new bullet after Feature-detect: "Same-document view transitions — `document.startViewTransition()`, as in this demo — work in Chrome and Edge 111 and later, Safari 18 and Firefox 144. Cross-document ones, turned on for full page loads with `@view-transition { navigation: auto; }`, work in Chrome and Edge 126 and Safari 18.2; check current support for Firefox. Keep the fallback for older browsers." The versions were checked against MDN's compatibility data for `Document.startViewTransition()`, `ViewTransition` and `@view-transition` (Firefox has no cross-document support yet).
- The unique-name bullet now says two elements sharing a name "make the browser skip the transition: the page still changes, with no animation" (it said this "throws and aborts the transition").
- - **Presses wait for the transition** is a new bullet before the library line: "While a view transition runs, Chrome sends every press on the page to the root element, so buttons do not respond until it ends (`pointer-events` on the transition's pseudo-elements does not change this); keep page transitions short. The demo passes a press over its box on as the visitor taking over, so a click there still stops Show me."
- - **Library equivalents** is rewritten: "Astro's `<ClientRouter />` (named `<ViewTransitions />` before Astro 5) and React's experimental `<ViewTransition>` component, which Next.js can switch on, wrap this API for client-side page changes; between full page loads the CSS rule `@view-transition { navigation: auto; }` does it without JavaScript. Barba.js and Swup predate the API and animate the old and new page content themselves; on supported browsers you often no longer need them." (The old line said Astro and Next.js wrapped it for cross-document navigation, and that Barba.js and Swup work by taking snapshots.)
+ - **Presses wait for the transition** is a new bullet before the library line: "While a view transition runs, Chrome sends every press on the page to the root element, so buttons do not respond until it ends (`pointer-events: none` on the transition's pseudo-elements does not change this while the root is captured, as it is by default); keep page transitions short. The demo passes a press over its box on as the visitor taking over, so a click there still stops Show me."
+ - **Library equivalents** is rewritten: "Astro's `<ClientRouter />` (named `<ViewTransitions />` before Astro 5) and React's experimental `<ViewTransition>` component, which Next.js's App Router supports, wrap this API for client-side page changes; between full page loads the CSS rule `@view-transition { navigation: auto; }` does it without JavaScript. Barba.js and Swup predate the API and animate the old and new page content themselves; on supported browsers you often no longer need them." (The old line said Astro and Next.js wrapped it for cross-document navigation, and that Barba.js and Swup work by taking snapshots.)
- **Category line:** `03.01 · Page Transitions`
- **Pager:** Previous: none · Next: Shared Element Transition (`../shared-element-transition/`)
- **Final fix wave:** the page names carry `aria-current` (`"page"` on the shown page's name, `"false"` on the others); `showPage` makes the pages not shown `inert` and cancels any transition or fade still running on them, so Reset also stops the fallback fade; the README's Production notes gain browser support and the presses-wait note, and lose three wrong statements (duplicate names, the Astro and Next.js line, snapshots).