eas

easiness

Single argument easing functions

Showing:

Popularity

Downloads/wk

1

GitHub Stars

3

Maintenance

Last Commit

6yrs ago

Contributors

0

Package

Dependencies

1

Size (min+gzip)

0.4KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

easiness

...another easing equation library! Why!?

Most easing libraries export functions which take a bunch of arguments, capturing all sorts of wonderful details of an animation, such as start and end values, start and end times, plus the current time. This is a rather complicated way of representing what essentially boils down to a simple interpolation between the values of 0 and 1; anything extra is just noise that distracts from the essence of the calculation. For further information, take a look at Jari Komppa's article Interpolation Tricks where he explains matters much better than I am able.

easiness is a collection of 'pure' easing functions designed to work with domain and range 0..1 - single number in, single number out. Easy-peasy. If you find yourself in a situation where you need to interpolate between other values, each of easiness's functions offers a .mapped() method to derive another single argument function that can map any domain/range you desire.

Installation

$ npm install easiness

Require

var easiness = require('easiness');

API

easiness.$easeFn(x)

Replace $easeFn with one of:

  • linear
  • smooth
  • easeInQuad
  • easeOutQuad
  • easeInOutQuad
  • easeInSine
  • easeOutSine
  • easeInOutSine

easiness.$easeFn.mapped(inStart, inEnd, outStart, outEnd)

Derives a new easing function based on $easeFn that expects an argument in the range inStart..inEnd and interpolates it between outStart..outEnd.

A 2-argument form of mapped() is also available in which inStart and inEnd are assumed to be 0 and 1, respectively. The resulting derived function will interpolate the values in the range 0..1 between outStart and outEnd.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial