@ChromiumDev In this example you see the API transition between the frame with the avatar and the frame with the info modal. The transition โ including "slide up" animation โ is handled by the API/browser.
- reveal-x: old content slides from center in direction x, revealing new content.
- cover-x: new content slides from an edge in direction x, covering old content.
- explode
- implode
See this video for a visual demo:
@ChromiumDev What's pretty cool about this API is that is also supports Shared Element Transitions.
It allows you to mark elements that exist in both frames.
While the Root Transition runs, Shared Elements โ here the avatar โ are transitioned independently.
@ChromiumDev You can pass in as many as you want, as long as they both have the same number of entries. They're matched against each other using their index.
@ChromiumDev For Shared Element Transitions to work though you need to enable CSS Paint Containment on them:
@ChromiumDev ๐จโ๐ฌ To use this API today, enable the `#document-transition` flag in your Chromium-based browser (Chromium 89+), or register your page for the Origin Trial once it's up on developer.chrome.com/origintrials/ (Chromium 92+)