tween-functions
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/tween-functions package

1.2.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.0
    898,328
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.0
    898,328
  • 1.1.0
    1
  • 1.0.2
    3
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i tween-functions

Weekly Downloads

898,334

Version

1.2.0

License

BSD

Last publish

Collaborators

  • chenglou