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

react-shake-it

v1.0.13

Published

A component for generating CSS animations at runtime.

Downloads

28

Readme

react-shake-it

A component for generating CSS animations at runtime.

Table of contents

  1. Demo
  2. Props rundown
  3. Props details

Demo

Demo and playground are available here

Props rundown

| prop | required? | type | default | |-----------------|-----------|--------------------|---------| | children | + | ReactElement | | | active | | boolean |true | | horizontal | | number \| string |0 | | vertical | | number \| string |0 | | rotation | | number \| string |0 | | scale | | string |"1.0 1.0"| | opacity | | string |"1.0 1.0"| | duration | | number \| string |"400ms" | | delay | | number | | | iteratons | | string |"infinite"| | precision | | number |0.2 | | interpolator | | IInterpolateFn \|IIndividualInterpolators |interpolateRandom| | fillMode | | IInterpolateFn |"none" | | direction | | IInterpolateFn |"normal" | | timingFunction| | IInterpolateFn |"linear" |

Props details

active

Defines, whether the animation should be played. Setting this to false will return a simple <div>.

horizontal

Defines min and max horizontal translation of the animated component. Can be either:

  • An integer. This defaults to pixels, and positive and negative values as boundaries.
  • A string consisting of an integer and a unit (i.e. 20rem). As above, negative value is used as a lower boundary.
  • A string consisting of both boundaries (i.e. -20px 30px).

vertical

Defines min and max vertical translation of the animated component. Can be either:

  • An integer. This defaults to pixels, and positive and negative values as boundaries.
  • A string consisting of an integer and a unit (i.e. 10rem). As above, negative value is used as a lower boundary.
  • A string consisting of both boundaries (i.e. -10px 150px).

rotation

Defines min and max rotation of the animated component. Can be either:

  • An integer. This defaults to degrees, and positive and negative values as boundaries.
  • A string consisting of an integer and a unit (i.e. 0.1turn). As above, negative value is used as a lower boundary.
  • A string consisting of both boundaries (i.e. -5deg 3deg).

scale

Defines min and max scale of the animated component. Consisits of a string of 2 numbers (i.e. 0.9 1.1) being respectively min and max value.

opacity

Defines min and max opacity of the animated component. Consisits of a string of 2 numbers (i.e. 0.9 1.1) being respectively min and max value.

duration

Defines time of the animation. Can be either:

  • An integer. Defaults to ms.
  • A string consisting of an integer and a unit (i.e. 1s).

delay

Time between activating the animaiton, and animation actually playing.

iterations

Number of iterations to play on activation.

precision

Length of 1 keyframe (for example 0.2 means keyframes every 20%).

interpolator

Defines way of generating new values for the animation. Can be either:

  • IInterpolateFn - A function ((progress: number) => number). Input and output values are between 0.0 and 1.0.
  • IIndividualInterpolators - An object, with keys h, v, s, r, o and functions described above as values. All keys are optional - unfilled values will default to interpolateRandom()

❕ Results generated by this function aren't actual animation values, they only describe the ratio between lower and higher bounds. (0 results in using lower bound, 1 results in using the higher bound). In general: keyframeValue = highBound * x + (1 - x) * lowBound, where x is the output of above mentioned function.

fillMode, direction, timingFunction

Direct CSS animation properties.

❕ Unlike regular CSS animation, the value function is linear. This is because interpolator prop provides similar, yet more extensive function.