UNPKG

@drozdik.m/lerp

Version:
9 lines (8 loc) 348 B
exports.__esModule = true; exports.EaseInOutExpo = function (from, to, currentFrame, totalFrames) { currentFrame /= totalFrames / 2; if (currentFrame < 1) return (to - from) / 2 * Math.pow(2, 10 * (currentFrame - 1)) + from; currentFrame--; return (to - from) / 2 * (-Math.pow(2, -10 * currentFrame) + 2) + from; };