0.2.1 • Published 5 years ago

jsanimation v0.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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

Commands

# install dependencies
npm install
# serve with hot reload at localhost:8080
npm start
# build for production with minification
npm run build