@jkroso/animation

1.0.5 • Public • Published

animation

A base class for animations. Used by move and timeline

Installation

npm install @jkroso/animation

then in your app:

import Animation from 'animation'

API

Animation#duration(n:Number|String)

set duration to n milliseconds. You can also pass a natural language string

animation.duration('1.2s')

Animation#ease(fn:String|Function)

Set easing function to fn.

animation.ease('in-out-sine')

Animation#run([n]:Number|String)

run the animation with an optional duration

animation.run()

Expected extensions

Animation#render(n:Number)

render the animation at point n between its endpoints where n is a number from 0 to 1. Subclasses may also choose to apply the ._ease() function to n within render.

Mover.prototype.render = function(n){
  // apply changes here
}

Readme

Keywords

Package Sidebar

Install

npm i @jkroso/animation

Weekly Downloads

6

Version

1.0.5

License

MIT

Last publish

Collaborators

  • jkroso