Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tween-functions

chenglou11.4mBSD1.2.0TypeScript support: definitely-typed

Robert Penner's easing functions, slightly modified

tween, ease, react, animation, easing, penner, bezier, interpolation

readme

Tween-functions

Robert Penner's tweening functions as used in React-tween-state and React-state-stream.

Penner's original functions uses the change in value rather than final value as parameter. I much prefer the latter, so this is what this library will use.

API

tweenFunction.tweenName(currentTime, beginValue, endValue, totalDuration)

Example

var tweenFunctions = require('tween-functions');
tweenFunctions.easeInQuad(1, 0, 50, 5); // => 4

List of available functions:

  • linear
  • easeInQuad
  • easeOutQuad
  • easeInOutQuad
  • easeInCubic
  • easeOutCubic
  • easeInOutCubic
  • easeInQuart
  • easeOutQuart
  • easeInOutQuart
  • easeInQuint
  • easeOutQuint
  • easeInOutQuint
  • easeInSine
  • easeOutSine
  • easeInOutSine
  • easeInExpo
  • easeOutExpo
  • easeInOutExpo
  • easeInCirc
  • easeOutCirc
  • easeInOutCirc
  • easeInElastic
  • easeOutElastic
  • easeInOutElastic
  • easeInBack
  • easeOutBack
  • easeInOutBack
  • easeInBounce
  • easeOutBounce
  • easeInOutBounce

changelog

Legend:

  • [B]: Breaking
  • [F]: Fix
  • [I]: Improvement

1.2.0 (November 20th 2015)

  • [F] Fix return value of easeInOutExpo, easeInElastic, easeOutElastic and easeInOutElastic. 20b7790

1.1.0 (October 16th 2015)

  • [F] Fix easeInExpo and easeOutExpo. #2

1.0.2 (May 25th 2015)

  • Initial release.