Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/dauber
Pooled requestAnimationFrame wrapper, designed for short bursts of animation as opposed to a constant loop.
https://github.com/hughsk/dauber
Last synced: 12 days ago
JSON representation
Pooled requestAnimationFrame wrapper, designed for short bursts of animation as opposed to a constant loop.
- Host: GitHub
- URL: https://github.com/hughsk/dauber
- Owner: hughsk
- License: other
- Created: 2014-09-30T14:59:15.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-20T08:38:42.000Z (about 7 years ago)
- Last Synced: 2024-10-17T16:36:12.391Z (22 days ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# dauber [![deprecated](http://badges.github.io/stability-badges/dist/deprecated.svg)](http://github.com/badges/stability-badges)
**Deprecated**
Pooled requestAnimationFrame wrapper, designed for short bursts of animation as
opposed to a constant loop. Useful for DOM/SVG-based animations where CSS
transitions aren't applicable.## Usage
[![NPM](https://nodei.co/npm/dauber.png)](https://nodei.co/npm/dauber/)
### `dauber(loopfn)`
Calls `loopfn` each frame, until the function returns `false`.
For example, to run an animation for five frames:
``` js
var dauber = require('dauber')
var el = document.getElementById('el')
var n = 0dauber(function() {
el.setAttribute('d', 'some SVG path value')
return ++n < 5
})
```## License
MIT. See [LICENSE.md](http://github.com/hughsk/dauber/blob/master/LICENSE.md) for details.