0.0.6 • Published 5 years ago

react-easing-animation v0.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

React Easing Animation

Build Status

npm i react-easing-animation

This is a React HOC implementation of Easing Animation Frames library, which offers CPU-friendly easing animations with requestAnimationFrame API and Robert Penner's easing equations. Suggestions and pull requests for optimization are welcome.

Bar Animation

How to use

Pass a component to be wrapped, along with animation options as a prop. The wrapped component receives currentValue prop during set period of time (4,000 milliseconds by default). You can use this changing value to do whatever animation you want to create.

If the value prop changes, it pauses the current animation and immediately resumes animation with new ending value to be used. Please check out the example by npm start (Node v10.15.1+).

Minimum settings

<EasingAnimation
  component={Bar} // Wrapped component
  value={300} // Ending value
/>

With optional settings

<EasingAnimation
  component={Bar} // Wrapped component
  value={300} // Ending value
  start={20} // Starting value
  props={{
    color: 'green' // Passed to the wrapped component as a prop
  }}
  options={{
    easingType: "quadInOut", // Easing function name
    duration: 3000 // Animation duration in milliseconds
  }}
/>

Browser Support

It uses requestAnimationFrame, which should be supported for most of the modern browsers.

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago