npm

Join us for the "JavaScript Supply Chain Security" tech talk, presented by VP of Security, Adam Baldwin. 6/20 at 10am PT.Sign up here »

@gamestdio/easing

1.0.0 • Public • Published

@gamestdio/easing

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

Usage

NPM

Each easing has its own file which can be required individually. The entry point also exports all eases with camelCase, so require('eases/expo-in-out') becomes require('eases').expoInOut.

Full list of eases:

import { backInOut } from './back-in-out';
import { backIn } from './back-in';
import { backOut } from './back-out';
import { bounceInOut } from './bounce-in-out';
import { bounceIn } from './bounce-in';
import { bounceOut } from './bounce-out';
import { circInOut } from './circ-in-out';
import { circIn } from './circ-in';
import { circOut } from './circ-out';
import { cubicInOut } from './cubic-in-out';
import { cubicIn } from './cubic-in';
import { cubicOut } from './cubic-out';
import { elasticInOut } from './elastic-in-out';
import { elasticIn } from './elastic-in';
import { elasticOut } from './elastic-out';
import { expoInOut } from './expo-in-out';
import { expoIn } from './expo-in';
import { expoOut } from './expo-out';
import { linear } from './linear';
import { quadInOut } from './quad-in-out';
import { quadIn } from './quad-in';
import { quadOut } from './quad-out';
import { quartInOut } from './quart-in-out';
import { quartIn } from './quart-in';
import { quartOut } from './quart-out';
import { quintInOut } from './quint-in-out';
import { quintIn } from './quint-in';
import { quintOut } from './quint-out';
import { sineInOut } from './sine-in-out';
import { sineIn } from './sine-in';
import { sineOut } from './sine-out';

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.

install

npm i @gamestdio/easing

Downloadsweekly downloads

3

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability