@alloc/easing
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@alloc/easing

This is an ESM-only fork of the @gamestdio/easing package. It's a grab-bag of Robert Penner's easing equations, most of the code from glsl-easings. Pull requests for optimizations are welcome.

Usage

NPM

Full list of eases:

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

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.

Package Sidebar

Install

npm i @alloc/easing

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

10.2 kB

Total Files

5

Last publish

Collaborators

  • aleclarson