1.0.5 • Published 5 years ago

tweeen v1.0.5

Weekly downloads
102
License
MIT
Repository
-
Last release
5 years ago

Primitive tween function

Allows to «animate» number values with given duration

Usage

import tween from 'nano-tween';

const stop = tween(1, 100, (value) => {
  console.log(value);
}, {
  duration: 1000,
});

Params

Signature of tween function

function tween(
  from: number,
  to: number,
  cb: (value: number) => void,
  params?: TweenParams,
);

List of params

  • duration — duration in ms, defaults to 300
  • easing — simple easing function that takes one argument — time (from 0 to 1). Defaults to linear. You can use functions from eases or similar package
  • fps — defaults to 60
  • end — animation end callback
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago