Skip to content

Paradigm of 'central application processor' with requestAnimationFrame technique for AngularJS

License

Notifications You must be signed in to change notification settings

vasiliy0s/ngAnimator

Repository files navigation

ngAnimator

Paradigm of central application processor for animations with requestAnimationFrame API technique for AngularJS framework.

Current module provides ngAnimator service with API (see description below) for manage tasks in animation loop.

Install

Install this package via bower in your node.js-based project:

bower i ng-animator --save

It automatic installs angular.js bower package as dependency (currently based angular version is ~1).

If you want to use custom version of module type:

bower i ng-animator#1.0.3 --save

Where is #1.0.3 is your needing version.

Update

Update current project via (available stable releases placing in 'master' branch, if not defined custom tag):

bower update

Build

Build package via typing (generates module JavaScript files):

grunt build

ngAnimator (service)

Service have wide tasks pool and run its inside requested browser animation frames loop.

All of the methods provides chaining style (returns current ngAnimator instance).

ngAnimator.add(task)

Adding task callback to processing pool. Every task will be called (without context) on every from requested animation frame. Do not add any hard tasks for not getting performance issues in browsers.

ngAnimator.remove(task)

Remove all task instances from processing pool.

ngAnimator.isRunned()

Get runned state. Processing is automatically stopping when pool is empty for best performance.

ngAnimator.start()

Starts pool processing loop if it not started. Note than every ngAnimator.add() calling is autmatically starts processing if it not starter already and not need to start manually (if it not be stopped manually).

ngAnimator.stop()

Ends started pool processing loop.

ngAnimator.flush()

Flush pool from all tasks and stop loop.

Author:

Module initiator and main developer Vasiliy Os.

TODO:

  • Adding tests.
  • Adding demo.

About

Paradigm of 'central application processor' with requestAnimationFrame technique for AngularJS

Resources

License

Stars

Watchers

Forks

Packages

No packages published