RAFManager is a lightweight and efficient animation manager built on top of the requestAnimationFrame
API. It provides precise global control over the addition and removal of animations.
- Minimalistic: Implemented in just a few dozen lines of code
- Easy Integration: Use as a foundation for animation projects or integrate where needed
- Global Control: Effortlessly manage animations across your entire application
Include the script directly in your HTML file:
<script src="js/RAFManager.min.js"></script>
Install using npm:
npm install raf-manager --save
Then import it in your project:
import RAFManager from 'raf-manager';
RAFManager.add(func, fps, param);
RAFManager.remove(func);
RAFManager.start();
RAFManager.stop();
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);
Node.js is a dependency. Use the terminal to install it with npm:
npm install
npm run build
npm run lint
RAFManager is released under the MIT License. http://www.opensource.org/licenses/mit-license