jsanimation
v0.2.1
Published
Simplest Javascript Animation
Downloads
2,096
Readme
animation.js
Simple Javascript Animation
- Super light( less than 100 lines of code, less than 2KB gzipped)
- Super fast
- Expansion in mind
USAGE
Install it
$ npm install jsanimation -D
Simply import the module into your code and run:
import {slideInRight} from 'jsanimation';
slideInRight(el);
Or, more
import {Animation, slideInRight} from 'jsanimation';
Animation.DURATION = 2000;
Animation.TIMING = 'Animation.timingFunctions.inOutExpo';
slideInRight(el);
Or, to fully control your animation
mport {animate} from 'animations.js';
animate(
1000, // DURATION
function(t) { return Math.pow(t, 1.675) } // timing function
function(pct) { el.style.opacity = pct } // draw function
).then(function() {
el.removeAttribute('style')
});
For Developer
Directories
- docs: github pages files
- To set github pages with this directory, follow github instruction
Commands
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm start
# build for production with minification
npm run build