Experiment: Automatically triggered View Transitions with MutationObserver
December 9, 2024
Instead of adding document.startViewTransition at various places in your JS, use a MutationObserver to watch for DOM mutations. In the Observer’s callback undo the original mutation and reapply it, but this time wrapped in a View Transition.
Source: Experiment: Automatically triggered View Transitions with MutationObserver – Bram.us
We’re big fans here at Conffab of View Transitions, and while it’s still early days you can already start taking advantage of them. Here’s an interesting experiment from Bramus van Damme, triggering view transitions simply with MutationObserver.