Skip to content

WebReflection/simple-kinetic

Repository files navigation

SimpleKinetic build status

A basic utility to add kinetics effect.

Basic Example

var sk = new SimpleKinetic({
  onstart: function (
    currentX, currentY,
    diffX, diffY,
    endX, endY
  ) {
    console.log('start', arguments);
  },
  onmove: function (cx, cy, dx, dy, ex, ey) {
    console.log('move', arguments);
  },
  onend: function (cx, cy, dx, dy, ex, ey) {
    console.log('end', arguments);
  },
  oncancel: function (cx, cy, dx, dy, ex, ey) {
    console.log('cancel', arguments);
  }
});

// check the log
sk.init(0, 0, 10, 10, true, false);

About

a reusable straight-forward class with some kinetic calculation

Resources

License

Stars

Watchers

Forks

Packages

No packages published