eased
Yet another library for creating simple animations with easing functions. Things that make it stand out from alternatives is a pure functional API & type safety via flow static type checker.
Library is a direct port of a wonderful [Easing][Easing Elm] library for an exciting Elm programing language (that is worth checking out). It is designed around the idea of: Easing functions interpolate a value over time. Where value can be a value of any type, including numbers, points and colors. In fact you can easily introduce your own value to the mix!
You can find graphical examples of easing functions on easings.net.
const second = 1000 const sampleAnimation = // Transition from blue to red using custom `Easing` functionconst customAnimation = currentTime = // Animate between 0 and 5 with the easeInOutQuad Easingconst animation1 = // Animation with bezier curveconst bezierAnimation = // Create your own Interpolation functionsconst vec = // Use your Easing and Interpolation functionsconst vec3movement =
If you happen to type check your JS code with flow you can take further advantage of this library:
const second = 1000 type Floatconst sampleAnimation:$sampleAnimation = // Transition from blue to red using custom `Easing` functiontype Colorconst customAnimation:$customAnimation = currentTime = // Animate between 0 and 5 with the easeInOutQuad Easingtype Floatconst animation1:$animation1 = // Animation with bezier curvetype Floatconst bezierAnimation:$bezierAnimation = // Create your own Interpolation functionstype $vec = Interpolation<Vec3>const vec:$vec = // Use your Easing and Interpolation functionstype Vec3const vec3movement =