GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - drawcall/RAFManager: 🌒🌓🌔🌕🌖🌗🌘 Only 1kb simple requestAnimationFrame animation manager

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
build
build
 
 
logo
logo
 
 
src
src
 
 
.babelrc
.babelrc
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
eslintrc.json
eslintrc.json
 
 
index.d.ts
index.d.ts
 
 
package.json
package.json
 
 
rollup.config.js
rollup.config.js
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

RAFManager

logo

Overview

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.

Key Features

  • 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

Installation

Browser

Include the script directly in your HTML file:

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

npm

Install using npm:

npm install raf-manager --save

Then import it in your project:

import RAFManager from 'raf-manager';

API

Add an Animation Function - Auto Start

RAFManager.add(func, fps, param);

Remove an 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.js is a dependency. Use the terminal to install it with npm:

npm install
npm run build

ES6 Lint

npm run lint

License

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

About

🌒🌓🌔🌕🌖🌗🌘 Only 1kb simple requestAnimationFrame animation manager

Topics

1k1kbrafrequestanimationframe

Resources

Readme
MIT license
Activity

Stars

19 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.