Skip to content
💫 Tiny tweening library that sparkles.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
index.js
package-lock.json
package.json

README.md

tinkerbell

Tiny tweening library that sparkles. 200 bytes gzipped.

Install

npm i tinkerbell --save

Usage

import tink from 'tinkerbell'

function easeInOut (t, b, c, d) {
  if ((t /= d / 2) < 1) return c / 2 * t * t + b
  return -c / 2 * ((--t) * (t - 2) - 1) + b
}

const tween = tink(0, 500, 1000, easeInOut)

/** on each tick */
function tick (val) {}

/** on complete */
function done () {}

const stop = tween(tick, done)

/** stop animation in progress */
stop()

License

MIT License © Eric Bailey

You can’t perform that action at this time.