Skip to content

Collection of easing equations for JavaScript / TypeScript

License

Notifications You must be signed in to change notification settings

gamestdio/easing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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

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.

About

Collection of easing equations for JavaScript / TypeScript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published