@vtbag/element-crossing
v1.0.4
Published
Sites using cross-document view transitions do full page loads of static content on navigation. The element crossing provides a way to preserve current dynamic state of selected elements across cross-document view transitions for a smoother user experienc
Downloads
15,991
Maintainers
Readme
⭐️Please star to support this work⭐️
🚸 The Element Crossing
Transfer selected element state across cross-document view transitions.
The @vtbag website can be found at https://vtbag.dev/
!!! News !!!
Now also fully supports crossing of data-*
properties.
For details see the CHANGELOG
What happened before?
Now also preserves the animation state of animated SVGs across cross-document view transitions, thanks to Lukas!
Small improvements for smoother animations and handling reloads.
What is it?
Boost the smoothness of your cross-document view transitions with the Element Crossing library! No more resetting to static states! This library preserves the current dynamic state of your DOM and CSS properties, ensuring a seamless user experience.
With Element Crossing, you can automatically retain:
- Current form inputs
- Current scrollbar positions
- Current state of active CSS animations
- Current media playback time
- Current toggle states
- Current values of dynamically added classes and CSS properties
- ...and (current) anything else you'd like to carry over from the previous page to the new one!
Simply annotate your elements in the HTML source or DOM, and let the library handle the rest. Keep your users engaged by preserving the exact state they left off, making transitions across documents smoother than ever!
Address any CSS property or DOM element property, any CSS class, or CSS animation.
View configuration examples and see the Element Crossing in action