Code Monkey home page Code Monkey logo

rafmanager's Introduction

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

rafmanager's People

Contributors

drawcall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rafmanager's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.