martrapp / astro-vtbot

The πŸ‘œ Bag of Tricks ✨ for Astro's View Transitions. ⭐️ Please star to support this work!
https://events-3bg.pages.dev/
ISC License
209 stars 5 forks source link
astro components view-transitions

No, its NOT a roBOT πŸ€–, its a πŸ‘œ Bag of Tricks!✨

⭐️Please star to support this work⭐️

The Bag of Tricks for Astro's View Transitions

The bag of tricks provides extensions & support around Astro's view transitions.

npm version Socket Badge Build Status NPM Downloads

A current deployment of tech demos and the documentation can be found at https://events-3bg.pages.dev/

!!! NEW TRICKS ✨ IN THE BAG πŸ‘œ !!!

Brings you the latest version of @vtbag/element-crossing, which now supports animated SVGs, thanks to Lukas!

For details, see the CHANGELOG of the ElementCrossing.

Recently Learned Tricks

The Inspection Chamber DevTools now als work for pnpm projects! \ Big shout out and "Thank You!" to Lukas for providing this fix!

New component for browser-native cross-document view transitions: The <CamShaft> component prevents the pseudo-smooth-scroll effect caused by view transition groups that exceed the height of the viewport when navigating to a different vertical scroll position.

The <TurnSignal> enables Astro's forward/backward animations provided by transition:animate to work with native cross-document @view-transition{}. Optionally you can configure the component with a total order of your site's pages, allowing it to automatically detect the transition direction.

The <ElementCrossing /> is a component for those of you who experiment with CSS-only cross-document view transitions and miss a way to preserve state of HTML elements across navigation: Transfer selected element state to the other side!

Inspection Chamber: See your view transitions like never before: examine every detail, reveal, debug, and optimize! Now, drill down into the effects of each pseudo-element introduced by the view transition API and even selectively toggle individual animations to better understand what’s happening! Summon the Inspection Chamber as a component (<InspectionChamber />) or install The Bag as an integration! and access the Chamber from the devToolbar!

Starlight Support: Ever wanted to see what your Starlight site looks like with view transitions enabled? Follow these steps to get rid of full page loads and make your Starlight site look like a SPA!

Reusable Components 🧩

The astro-vtbotpackage isn't a monolithic library. Use the components you need and only pay bandwidth for those. Component Brotli bytes added
Animation Style ✨ ~0.1k
AutoNameSelected πŸ“› ~0.3k
BorderControl πŸ›‚ ~0.1k
BrakePad πŸ¦₯ ~0.2k
CamShaft 🐫 ~0.6k
ElementCrossing 🚸 ~1.2K
InspectionChamber πŸ”¬ ~27k
Linter 🧹 ~1.9k
LoadingIndicator ⏳ ~0.4k
Move 🚟 ~0.2k
NoScroll πŸ“œ ~0.1k
PageOffset πŸ“„β‡ž ~0.1k
PointerOnNavigation πŸ‘† ~0.1k
Portal πŸšͺ ~0.2k
ReplacementSwap β†Ή ~0.5k
Starlight … 🌟 ~3.0k
SwapSound πŸ”Š -0.3k
Swing 🎷 ~0.1k
TurnSignal πŸ”™ ~0.5k
VtBotDebug πŸ› ~2.8k
Zoom πŸ”Ž ~0.1k

Visit the documentation of the reusable components for detailed information.

Tech Demos πŸ”₯

The bag of tricks currently contains several technical demos that show examples of the implementation of various effects using the view transition events.

The sources are in this repository.

The Jotter πŸ““

Last but not least, the deployment also includes the β–Ά Jotter β—€ with a wealth of information on transition events as well as background information and valuable tips & tricks on view transitions in Astro.

Some of the contents are technical demos, some are useful tools, and some are reusable components that you can use in your own project to handle edge cases that go beyond Astro's standard features.

Troubleshooting

For help, check out the Discussions tab on the GitHub repo.

Contributing

This package is maintained by martrapp independently from Astro. You're welcome to contribute by submitting an issue or opening a PR!

Changelog

See CHANGELOG.md for a history of changes to this package.