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

@quietui/scurry

v5.0.0

Published

Unique animations and easings designed for the Web Animations API.

Downloads

240

Readme

Scurry Animations

Scurry provides unique animations designed for use with the Web Animations API.

Transitional animations are ideal for adding and removing objects, as they feature custom keyframes and easings for entering and exiting. Also included are several emphasis animations that are great for drawing attention to in-place objects.

Built for Quiet UI.

Installation

npm install @quietui/scurry

Importing animations

To import an animation using a bundler:

import { bounce, tornado } from '@quietui/scurry';

To import an animation using a browser, use the full path for each animation. Importing index.js will force the browser to load every animation in the library. Make sure to adjust the path to wherever the library is being hosted.

import { bounce } from '/dist/emphasis/drift.js';
import { tornado } from '/dist/transitions/drift.js';

To see a complete list of animations, refer to src/animations. If you want to use the public CDN, you can browse the animations here.

Using animations

To get the keyframes and easings for each emphasis animation, call the imported function. An optional argument lets you choose the animation's directionality. To apply the animation, use the Element.animate() method.

Emphasis

Emphasis animations return a QuietAnimation object with keyframes and easing properties.

import { bounce } from '@quietui/scurry';

const box = document.getElementById('box');
const { keyframes, easing } = bounce({ dir: 'ltr' });

// Animate it
await box.animate(keyframes, {
  easing,
  duration: 1500
}).finished;

// The animations have finished!

Transitions

Transition animations return a QuietTransitionAnimation object that has an enter and exit property, both of which contain keyframes and easing properties.

import { tornado } from '@quietui/scurry';

const box = document.getElementById('box');
const { enter, exit } = tornado({ dir: 'ltr' });

// Animate in
await box.animate(enter.keyframes, {
  easing: enter.easing,
  duration: 1500
}).finished;

// Animate out
await box.animate(exit.keyframes, {
  easing: exit.easing,
  duration: 1500
}).finished;

// The animations have finished!

The animation manifest

In some cases, it might be useful to get a list of all animations provided by the library without importing them all. You can use the manifest to get a list of all animations, grouped by category.

import { animations } from '@quietui/scurry/dist/manifest.js';

// List all animations
animations.forEach(animation => {
  console.log(
    // The name of the animation
    animation.name,
    // A description of the animation
    animation.description,
    // The type of animation
    animation.type,
    // The path to the animation, relative to the library's root
    animation.path
  );
});

// List only emphasis animations
animations
  .filter(animation => animation.type === 'emphasis')
  .forEach(animation => {
    console.log(animation.name);
  });

Do you accept PRs?

Yes! This library is designed to be expanded so pull requests are welcome. All submissions will be vetted for quality to make sure the animations are a good fit for the library. Even the best animations may require a few iteration cycles. Unfortunately, not all animations will be accepted.

If you're not sure if an animation makes sense for this library, open an issue and ask!

Developing

The developer sandbox will automatically run the project in watch mode, spin up an HTTP server, and open a browser to help you test animations more easily.

To spin up the sandbox for development, run:

npm start

To build the project, run:

npm run build

To update dependencies, run:

npm run check-updates

To create a new animation, add it to src/emphasis or src/transition and restart the dev server. The index and manifest are updated automatically at build time.