npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2024 – Pkg Stats / Ryan Hefner

astro-vtbot

v1.7.18

Published

The πŸ‘œ Bag of Tricks ✨ for Astro's View Transitions

Downloads

3,949

Readme

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

The Bag of Tricks for Astro's View Transitions

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

Build Status npm version

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

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

πŸ—ƒοΈ Do you love Lorenzo's Multi Sidebar for Starlight?

... then you'll appreciate that The Bag's Starlight support got you covered from day one: View transition support starting with the first npm release of @lorenzo_lewis/starlight-multi-sidebar!

Improved Support for swap()-related Topics!!

VtBotDebug now shows the changes that are made to the DOM during swap.

Support for swap() replacements is now automatically synced with Astro's main development. Astro extents the semantics of the swap() functions? All extensions are supported by The Bag and are available for your individual swaps!

More Starlight Improvements:

The selection of optional Starlight components keeps growing:

Ever wished clicking on Starlight's previous page and next page links would slide content from the left respectively from the right? Now you can enable <PageOrder /> on Starlight sites. This automatically alters the direction of the view transition. Visit a page further down the sidebar and get a forward navigation, visit a page further up, and you get a back navigation.

Eliminate the Pseudo-Scrolling of the Main Section: With <PageOffset />, The Bag offers a simple to use component that eliminates pseudo scrolling effects induced by morph transitions on elements that are larger than the viewport. Especially useful to get a smooth and neat transition animation for your main content.

Recently learned tricks

Improved Sidebar Handling: When you navigate to a page that has its entry within a collapsed category, the category is now automatically turned open. If the current page marker is outside the visible part of the sidebar, it is automatically scrolled into view. New: Support for your own customizations!

If you want to use transition:persist inside the main content area, you can do that now! As of v1.7.8 the <ReplacementSwap /> component handles data-astro-transition-persist attributes within the replaced DOM trees in the same way as Astro's built-in swap() function does.

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 🧩

  • In need for extensions for view transitions because you have issues with iframes on your pages?
  • Wanting support in understanding and debugging view transitions or simply want a second pair of eyes πŸ‘€ on your view transition settings?
  • Looking for reusable animations or special transition effects?
  • Want to use view transitions on your Starlight site?

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 BrakePad πŸ¦₯ | ~0.2k Linter 🧹 | ~1.9k LoadingIndicator ⏳ | ~0.4k Move 🚟 | ~0.2k NoScroll πŸ“œ | ~0.1k PageOffset πŸ“„β‡ž | ~0.1k Portal πŸšͺ | ~0.2k ReplacementSwap β†Ή | ~0.5k Starlight … 🌟 | ~3.0k Swing 🎷 | ~0.1k VtBotDebug πŸ› | ~2.8k Zoom πŸ”Ž | ~0.1k

Visit the documentation of the reusable components for detailed information.

  • <Linter/>: A linter component that helps you identify problems when setting up transitions.

  • <VtBotDebug/>: A Debugging component that logs the events and their data as they occur.

  • <ReplacementSwap/>: An alterantive DOM swap(), which preserves elements in the original DOM to avoid reinitialization of iframes or CSS animations.

  • <LoadIndicator>: Have you ever missed the visual feedback on sites with view transitions as to whether the app has noticed the click? You need a loading indicator! Here you go!

  • Zoom, <Move> and Swing animations and the <AnimationsStyle/> component allows for extended styling options.

  • <Portal/> component that forces all view transitions through a portal/loading page.

  • <NoScroll/> keep the current vertical and horizontal scroll position when transitioning to the next page.

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.