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

liquid-route

v1.1.0

Published

``` npm i -D liquid-route ``` This is a collection of route element and animation objects based on [`element.animate`](https://developer.mozilla.org/en-US/docs/Web/API/Element/animate). Which will make it super easy for you to do animated routing.

Downloads

11

Readme

Liquid-route

  npm i -D liquid-route

This is a collection of route element and animation objects based on element.animate. Which will make it super easy for you to do animated routing.

This mainly consist of the following animation objects

  1. FadeAnimation: Next route will fade in and current will fade out.
  2. PopAnimation: Next route will pop from center and current route will implode.
  3. SlideLeftAnimation: Next route will slide from right while current one slides to left.
  4. PushNSlideAnimation: Routes will scale down and slide.
  5. AppearFromBottomAnimation: Next route will fade and appear from bottom and sit on top of current route.
  6. AppearFromRightAnimation: Next route will fade and appear from right and sit on top of current route.

Sample

sample usage of liquid-route

Route element

liquid-route is the route component which you would need to use in order animate between routes. It takes a prop named animator which is a animation object

  import Router from 'preact-router';
  import LiquidRoute, {FadeAnimation, PopAnimation} from 'liquid-route';
  import 'liquid-route/style.css';
  import Home from './Components/Home/Home.jsx';
  .
  .
  .
  return (
    <Router>
      <LiquidRoute animator={FadeAnimation} path="/" component={Home}/>
      <LiquidRoute animator={PopAnimation} path="/profile" getComponent={()=>{
        return System.import('./Components/Profile/Profile.jsx').then(module => module.default);
      }}/>
      <LiquidRoute animator={PopAnimation} path="/profile/:pid" getComponent={()=>{
        return System.import('./Components/Profile/Profile.jsx').then(module => module.default);
      }}/>
    </Router>
  );

Animator object

Animator object is a javascript object which exposes two methods

  1. getEntryAnimation - returns animation object used to play entry animation of a route
  2. getExitAnimation - returns animation object used to playexitentry animation of a route

Both of the above ☝ methods return an object having the following properties a. animation: array of animation object used to play the entry/exit effect b. options: an object of options taken by element.animate api.

Browser Compatability

According to MDN Web Animation is still in working draft status and only a few browsers support it, however there's a polyfill might come in handy.

Inspiration

While some basic animator objects come with the bundle, here is where the most of the transition inspiriation is drawn from.

You creative?

Send PR if you wanna add new animators in the repo, happy to include 😊.

Note

In order for the transitions to work, please declare all routes as liquid-route.

P.S. Tried and tested most of the animations are easily doable with this route element.