Skip to content

A tiny requestAnimationFrame wrapper to improve usability.

Notifications You must be signed in to change notification settings

DuYongLee/stepperjs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StepperJS

Build Status codecov

A tiny requestAnimationFrame wrapper to improve usability. - Demo

Installation

npm

$ npm install --save stepperjs

Usage

for Babel

import Stepper from 'stepperjs';
import linear from 'stepperjs/dist/easings/linear';

const stepper = new Stepper({
    duration: 300, // default: 0
    easing: linear, // default: linear
    loop: true, // default: false
    reverse: true // default: false
}).on({
    start: () => ... ,
    update: (n) => ... ,
    paused: () => ... ,
    ended: () => ... ,
    stopped: () => ...
});

stepper.start();

for Browser

<script type="text/javascript" src="stepperjs.browser-0.1.2.min.js"></script>
var Stepper = stepperjs.Stepper();
var easings = stepperjs.easings;
var stepper = new Stepper({
    duration: 300,
    easing: easings.linear,
    loop: true,
    reverse: true
}).on({
    start: function () { ... },
    update: function (n) { ... },
    paused: function () { ... },
    ended: function () { ... },
    stopped: function () { ... }
});

stepper.start();

Supported browsers

  • Latest Firefox
  • Latest Chrome
  • Latest Safari
  • IE8 through latest

License

MIT

About

A tiny requestAnimationFrame wrapper to improve usability.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • JavaScript 83.3%
  • HTML 16.7%