Skip to content

jkroso/animation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

A base class for animations

Resources

Stars

Watchers

Forks

Packages

No packages published