MCPcopy Index your code
hub / github.com/component/ease

github.com/component/ease @1.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.0 ↗ · + Follow
0 symbols 0 edges 1 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ease

Easing functions (for canvas etc)

  • linear
  • inQuad
  • outQuad
  • inOutQuad
  • inCube
  • outCube
  • inOutCube
  • inQuart
  • outQuart
  • inOutQuart
  • inQuint
  • outQuint
  • inOutQuint
  • inSine
  • outSine
  • inOutSine
  • inExpo
  • outExpo
  • inOutExpo
  • inCirc
  • outCirc
  • inOutCirc
  • inBack
  • outBack
  • inOutBack
  • inBounce
  • outBounce
  • inOutBounce

Aliases

  • in-quad
  • out-quad
  • in-out-quad
  • in-cube
  • out-cube
  • in-out-cube
  • in-quart
  • out-quart
  • in-out-quart
  • in-quint
  • out-quint
  • in-out-quint
  • in-sine
  • out-sine
  • in-out-sine
  • in-expo
  • out-expo
  • in-out-expo
  • in-circ
  • out-circ
  • in-out-circ
  • in-back
  • out-back
  • in-out-back
  • in-bounce
  • out-bounce
  • in-out-bounce

Example

var ease = require('ease');
var requestAnimationFrame = require('raf');
var canvas = document.querySelector('canvas');
var ctx = canvas.getContext('2d');

animate();

var stop = false;
function animate() {
  if (stop) return;
  requestAnimationFrame(animate);
  draw();
}

var startx = 20;
var x = startx;
var destx = 700;
var y = 400 / 2;
var duration = 1000;
var start = Date.now();

function draw() {
  var now = Date.now();
  if (now - start >= duration) stop = true;
  x = ease.inOutCirc(now - start, startx, destx - x, duration) | 0;
  canvas.width = canvas.width;
  ctx.fillStyle = 'red';
  ctx.arc(x, y, 10, 0, Math.PI * 2, false);
  ctx.fill();
}

License

MIT

Core symbols most depended-on inside this repo

Shape

For agents

$ claude mcp add ease \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact