Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/dauber-duration
Pooled requestedAnimationFrame tool for running multiple short bursts of animation
https://github.com/hughsk/dauber-duration
Last synced: 12 days ago
JSON representation
Pooled requestedAnimationFrame tool for running multiple short bursts of animation
- Host: GitHub
- URL: https://github.com/hughsk/dauber-duration
- Owner: hughsk
- License: other
- Created: 2014-09-30T15:19:23.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-20T08:38:17.000Z (about 7 years ago)
- Last Synced: 2024-10-17T16:36:12.358Z (22 days ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# dauber-duration [![deprecated](http://badges.github.io/stability-badges/dist/deprecated.svg)](http://github.com/badges/stability-badges)
**Deprecated**
Pooled requestedAnimationFrame tool for running multiple short bursts of animation
## Usage
[![NPM](https://nodei.co/npm/dauber-duration.png)](https://nodei.co/npm/dauber-duration/)
### `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:
``` js
var animate = require('dauber-duration')animate(500, function(t) {
var a = 10
var b = 50
var r = a + (b - a) * t // (linear interpolation)circle.setAttribute('r', r)
})
```## License
MIT. See [LICENSE.md](http://github.com/hughsk/dauber-duration/blob/master/LICENSE.md) for details.