Skip to content

πŸŒ’πŸŒ“πŸŒ”πŸŒ•πŸŒ–πŸŒ—πŸŒ˜ Only 1kb simple requestAnimationFrame animation manager

License

Notifications You must be signed in to change notification settings

drawcall/RAFManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RAFManager

logo

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

<script src="js/RAFManager.min.js"></script>

Or install using npm

npm install raf-manager --save 
...

import RAFManager from 'raf-manager';

API

πŸŒ–add a animation function - auto start
RAFManager.add(func, fps, param); 
πŸŒ–remove a animation function - auto stop
RAFManager.remove(func);
πŸŒ–force start and stop
RAFManager.start();
RAFManager.stop();

Usage demo

RAFManager.add((title)=>{
    top++;
    const node = this.inputRef.current;
    node.innerHTML = title;
    node.style.top = top + 'px';
}, 25, 'hello world!');
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:

npm install
npm run build

es6 lint

npm run lint

License

LicenseFinder is released under the MIT License. http://www.opensource.org/licenses/mit-license

About

πŸŒ’πŸŒ“πŸŒ”πŸŒ•πŸŒ–πŸŒ—πŸŒ˜ Only 1kb simple requestAnimationFrame animation manager

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published