viktortween
Lightweight tween util with 0 dependencies
Last updated 9 months ago by hesselbom .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install viktortween 
SYNC missed versions from official npm registry.

Lightweight tween util with 0 dependencies (677bytes gzipped)

Usage

tween(obj, prop, from, to, duration, ease = defaultEasing)

import { tween, easing } from 'viktortween'

let obj = {
  pos: { x: 0, y: 0 }
}

// Tween single property
tween(obj.pos, 'x', 0, 10, 1000)
.onUpdate((percentage) => {})
.onComplete(() => {})
.stop()

// Tween multiple props
tween(obj, 'pos', { x: 0, y: 0 }, { x: 10, y: 10 }, 1000)
.onUpdate((percentage) => {})
.onComplete(() => {})
.stop()

// Tween with other easing effect (default is easing.easeOutQuad)
tween(obj.pos, 'x', 0, 10, 1000, easing.easeInOutQuint)

Current Tags

  • 1.0.4                                ...           latest (9 months ago)

5 Versions

  • 1.0.4                                ...           9 months ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 6
Dependencies (0)
None
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |