# stepperjs

> A tiny requestAnimationFrame wrapper to improve usability.

Latest version **0.2.1** (published 2018-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install stepperjs
pnpm add stepperjs
yarn add stepperjs
bun add stepperjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2018-01-05 |
| First published | 2016-11-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | UYEONG |
| Maintainers | uyeong |
| Keywords | ref, requestAnimationFrame |

## Links

- npm: https://www.npmjs.com/package/stepperjs
- Repository: https://github.com/UYEONG/stepperjs
- Homepage: https://github.com/UYEONG/stepperjs#readme
- Issues: https://github.com/UYEONG/stepperjs/issues
- npm.io page: https://npm.io/package/stepperjs

## Dependencies (2)

- [raf](https://npm.io/package/raf.md) 3.4.0
- [eventemitter3](https://npm.io/package/eventemitter3.md) 3.0.0

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 0.2.1 (latest) — 2018-01-05
- 0.2.0 — 2018-01-05
- 0.1.5 — 2017-12-19
- 0.1.4 — 2017-02-27
- 0.1.3 — 2017-01-06
- 0.1.2 — 2016-12-27
- 0.1.1 — 2016-12-11
- 0.1.0 — 2016-12-11
- 0.0.3 — 2016-12-01
- 0.0.2 — 2016-11-14
- 0.0.1 — 2016-11-10
- 0.0.0 — 2016-11-09

## README

# StepperJS
[![Build Status](https://travis-ci.org/UYEONG/stepperjs.svg?branch=master)](https://travis-ci.org/UYEONG/stepperjs)
[![codecov](https://codecov.io/gh/UYEONG/stepperjs/graph/badge.svg?token=Eg1MUAW9he)](https://codecov.io/gh/UYEONG/stepperjs)


A tiny requestAnimationFrame wrapper to improve usability.  - [Demo](https://uyeong.github.io/stepperjs/)

## Installation

### npm

```bash
$ npm install --save stepperjs
```

### Usage

#### for Babel

```js
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();
```

If you want to change options after creating the object

```js
const stepper = new Stepper();

stepper.option('duration', 500);
stepper.option('easing', linear);
stepper.option('loop', false);
stepper.option('reverse', false);

// or

stepper.option({
    duration: 500,
    easing: linear,
    loop: false,
    reverse: false
});

```

If you want to use multiple easing function.

```js
import Stepper from 'stepperjs';
import linear from 'stepperjs/dist/easings/linear';
import inBack from 'stepperjs/dist/easings/inBack';

const stepper = new Stepper({
    duration: 300,
    easing: [linear, inBack]
}).on({
    update: (n1, n2) => {
        console.log(n1); // value of linear
        console.log(n2); // value of inBack
    }
});

stepper.start();
```

#### for Browser

```html
<script type="text/javascript" src="stepperjs.browser-0.2.1.min.js"></script>
```

```js
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

---
_Source: https://npm.io/package/stepperjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
