a grab-bag of modular easing equations
Clone or download
Pull request Compare This branch is 10 commits ahead of mattdesl:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
scripts
src
.gitignore
.npmignore
LICENSE.md
README.md
back-in-out.js
back-in.js
back-out.js
bounce-in-out.js
bounce-in.js
bounce-out.js
circ-in-out.js
circ-in.js
circ-out.js
cubic-in-out.js
cubic-in.js
cubic-out.js
elastic-in-out.js
elastic-in.js
elastic-out.js
expo-in-out.js
expo-in.js
expo-out.js
index.js
linear.js
package-lock.json
package.json
quad-in-out.js
quad-in.js
quad-out.js
quart-in-out.js
quart-in.js
quart-out.js
quint-in-out.js
quint-in.js
quint-out.js
sine-in-out.js
sine-in.js
sine-out.js
test.js

README.md

eases-jsnext

This is a fork of mattdesl/eases. It includes tree-shaking-friendly ES6 modules, and a UMD build for use in browser.

It preserves the original individual CommonJS files, and therefore serves as a drop-in replacement.


eases

stable

This is a grab-bag of Robert Penner's easing equations, most of the code from glsl-easings. Pull requests for optimizations are welcome.

//require all eases
import * as eases from 'eases-jsnext';

//require only the single function
import { quadIn } from 'eases-jsnext';

Usage

NPM

Full list of eases:

import {
  backInOut,
  backIn,
  backOut,
  bounceInOut,
  bounceIn,
  bounceOut,
  circInOut,
  circIn,
  circOut,
  cubicInOut,
  cubicIn,
  cubicOut,
  elasticInOut,
  elasticIn,
  elasticOut,
  expoInOut,
  expoIn,
  expoOut,
  linear,
  quadInOut,
  quadIn,
  quadOut,
  quartInOut,
  quartIn,
  quartOut,
  quintInOut,
  quintIn,
  quintOut,
  sineInOut,
  sineIn,
  sineOut
} from 'eases-jsnext';

All easing functions only remap a time value, and all have the same signature.

v = ease(t)

Where t is typically a value between 0 and 1, and it returns a new float that has been eased.

License

MIT, see LICENSE.md for details.