https://github.com/bcherny/penner
A library for Penner's easing equations.
https://github.com/bcherny/penner
Last synced: 6 months ago
JSON representation
A library for Penner's easing equations.
- Host: GitHub
- URL: https://github.com/bcherny/penner
- Owner: bcherny
- License: mit
- Created: 2013-09-15T01:51:20.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-10-09T19:04:40.000Z (about 10 years ago)
- Last Synced: 2024-12-17T03:03:25.809Z (10 months ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 16
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# penner
A library for Penner's easing equations
## what?
See http://upshots.org/actionscript/jsas-understanding-easing
## usage
```js
var t = 0, // current time (ms, s, frames, ...)
b = 10, // initial value
c = 100, // change in value (final value - initial value)
d = 2 // duration (same units as t)
value = penner.easeOutQuad(t, b, c, d);
```## included easing 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`
## size
| | |
|-----------------------|---------------|
| Raw | 7880 bytes |
| Uglified | 3200 bytes |
| Uglified + gzipped | 865 bytes |## environment support
Any browser (as `window.penner`), AMD, CommonJS, NodeJS