Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drawcall/RAFManager
πππππππ Only 1kb simple requestAnimationFrame animation manager
https://github.com/drawcall/RAFManager
1k 1kb raf requestanimationframe
Last synced: about 1 month ago
JSON representation
πππππππ Only 1kb simple requestAnimationFrame animation manager
- Host: GitHub
- URL: https://github.com/drawcall/RAFManager
- Owner: drawcall
- License: mit
- Created: 2018-12-03T05:34:44.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-06T13:16:43.000Z (about 4 years ago)
- Last Synced: 2024-07-29T11:35:35.837Z (5 months ago)
- Topics: 1k, 1kb, raf, requestanimationframe
- Language: JavaScript
- Homepage:
- Size: 30.3 KB
- Stars: 17
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
RAFManager
======![logo](https://github.com/drawcall/RAFManager/blob/master/logo/raf.gif)
## Features
__RAFManager__ is a simple __requestAnimationFrame__ animation manager.
With __RAFManager__ you can control the addition/deletion animations globally with precision.#### The important thing is that it has only a few dozen lines of code, and the size is so small that you can ignore it.
You can use it as the base library for your animation project, or wherever you want to use it.
## Usage
#### Use directly in the page```html
```
#### Or install using npm
```javascript
npm install raf-manager --save
...import RAFManager from 'raf-manager';
```### API
##### πadd a animation function - auto start
```javascript
RAFManager.add(func, fps, param);
```##### πremove a animation function - auto stop
```javascript
RAFManager.remove(func);
```##### πforce start and stop
```javascript
RAFManager.start();
RAFManager.stop();
```### Usage demo
```javascript
RAFManager.add((title)=>{
top++;
const node = this.inputRef.current;
node.innerHTML = title;
node.style.top = top + 'px';
}, 25, 'hello world!');
``````javascript
RAFManager.add(func1, 2);
RAFManager.add(func2, 3.5);
RAFManager.add(func3, 10.5);
```## Build
Node is a dependency, use terminal to install it with npm:```javascript
npm install
npm run build
```### es6 lint
```javascript
npm run lint
```## License
LicenseFinder is released under the MIT License. http://www.opensource.org/licenses/mit-license