Turn
Turn is a library for animating page transitions in Turbo Drive apps. It applies various class names to the HTML element during the lifecycle of a navigation. Targeted elements can then use these classes to apply animations. It supports View Transitions and can be used with a combination of the two approches.
Examples
- Basic: immediate exit animations, followed by enter animations (without View Transitions)
- View Transitions: transitions common elements between pages (where supported, without a fallback)
- Fallback: animate with View Transitions, with a fallback to custom exit/enter animations
- Hybrid Basic: combines custom CSS exit and enter animations with View Transitions for common elements between pages
- Hybrid Advanced: similar to the basic example but only uses a custom CSS exit animation; the enter animations are achieved with a View Transition
- Animate Restore: animating restoration visits from native controls is generally discouraged, but if your app has Back links, this approach provides a nice user experience