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 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 current project via (available stable releases placing in 'master' branch, if not defined custom tag):
bower update
Build package via typing (generates module JavaScript files):
grunt build
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).
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.
Remove all task
instances from processing pool.
Get runned state. Processing is automatically stopping when pool is empty for best performance.
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).
Ends started pool processing loop.
Flush pool from all tasks and stop loop.
Module initiator and main developer Vasiliy Os.
- Adding tests.
- Adding demo.