0.2.8 • Published 3 years ago

drain-js v0.2.8

Weekly downloads
13
License
MIT
Repository
github
Last release
3 years ago

drain-js

npm License

Preview

A callback based utility for making fluent number changes.

Install

npm install drain-js
yarn add drain-js

Usage

import drain from 'drain-js';

drain({ start: 3000, end: 2750, onInterval: console.log });

// Output
2906
2812
2803
...
2752
2751
2750

Preview

Parameters

drain({
  start: Number,
  end: Number,
  speed: Number,
  onInterval: Function,
  onComplete: Function,
});
NameDefaultDescription
speed100An animation can be completed in about 10 to 20 steps. The speed (ms) value is the time set for each step.
startundefinedThe value at which the animation will start
endundefinedThe value at which the animation will end.
onIntervalundefinedThe function that will run at each step until the animation is complete.
onCompleteundefinedThe function to run when the animation is complete.

Demo List

NameStatusTypeURL
Demo Simple✔️Number TransitionLink
Demo✔️CSS Animation & Number TransitionLink
Demo with React✔️CSS Animation & Number TransitionLink
Demo with Vue✔️CSS Animation & Number TransitionLink
Demo with Svelte✔️CSS Animation & Number TransitionLink
0.2.1

3 years ago

0.2.0

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.8

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago