0.1.4 • Published 5 years ago

@jarvisniu/transition v0.1.4

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

transition

CSS property transition for JavaScript

Demo

Demo

Usage

import transition from '@jarvisniu/transition'

let coord = { x: 0, y: 0 }

transition(coord, { x: 100, y: 50 }, { duration: 0.5 })

API

transition(targetObject, props, options)

Options:

  • duration: Default is 0.2 second. The last time of the transition.
  • easing: Default is 'quad'. The easing function, can be set to 'linear'.
  • onStart(val): The callback function executed before the first transition frame.
  • onUpdate(val): The callback function executed after each transition frame.
  • onComplete(val): The callback function executed after the last transition frame.
  • interpolate(startVal, endVal, t): Define how to interpolate the non-linear value (e.g. hex color 0xff0000).

Licence

MIT

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago