spring-array

2.1.0 • Public • Published

spring-array

Micro library for tweening arrays(or array of arrays). Built-in spring easing. Useful for animating svg paths.

Usage

import tween from 'spring-array';

const from = [0, 0, [0, 0]];
const to = [1, 1, [1, 1]];

const stopper = tween({
  from,
  to,
  update: (value) => { // Called on every frame with current value }
  done: () => { // Called upon completetion },
  // Spring config (optional, defaults show below)
  deceleration: 0.8,
  tension: 0.8,
  friction: 1
});

stopper(); // will stop the tween

License

MIT Daniel Lundin 2018

Readme

Keywords

none

Package Sidebar

Install

npm i spring-array

Weekly Downloads

0

Version

2.1.0

License

ISC

Unpacked Size

10.7 kB

Total Files

10

Last publish

Collaborators

  • daniel-lundin