View Transition
Tell the browser you're about to mod the dom.then => do it.
// browser: 📸 (old)
document.startViewTransition(async () => {
// me: does stuff to the page…
// browser: 📸 (new)
})
Browser handles transitioning between those states!
See a demo