Cross-Document
Navigation between pages can use a transition when both pages opt in. This project uses the @view-transition rule with navigation: auto.
The browser can animate between an old visual state and a new one, giving developers a new way to create transitions without manually animating every change.
This project demonstrates both navigation between pages and a content change within one page.
Navigation between pages can use a transition when both pages opt in. This project uses the @view-transition rule with navigation: auto.
JavaScript can call document.startViewTransition() before changing content or the DOM.
view-transition-name can identify an element so the browser can create a transition for that specific visual element.
@view-transition {
navigation: auto;
}
h1 {
view-transition-name: page-title;
}
document.startViewTransition(() => {
// Update the page content here
});