This package has been deprecated

Author message:

dauber is deprecated

dauber-duration

1.0.0 • Public • Published

dauber-duration experimental

Pooled requestedAnimationFrame tool for running multiple short bursts of animation

Usage

NPM

dauber(duration, loopfn[, done])

Calls loopfn(t) every frame for duration milliseconds, where t is a value between 0 and 1 describing the progress through the animation. When complete, calls done if passed.

For example, to animate between two values over 500 millisconds:

var animate = require('dauber-duration')
 
animate(500, function(t) {
  var a = 10
  var b = 50
  var r = a + (- a) * t // (linear interpolation)
 
  circle.setAttribute('r', r)
})

License

MIT. See LICENSE.md for details.

/dauber-duration/

    Package Sidebar

    Install

    npm i dauber-duration

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • hughsk