jsanimation

0.2.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i jsanimation

Weekly Downloads

209

Version

0.2.1

License

MIT

Unpacked Size

1.25 MB

Total Files

35

Last publish

Collaborators

  • allenkim