tweenkle
Version:
Lightweight tweening library for all your tweening and animation needs.
28 lines (21 loc) • 756 B
JavaScript
;
exports.__esModule = true;
exports["default"] = exports.InOut = exports.Out = exports.In = void 0;
var In = function In(time, beginningValue, changeValue, duration) {
return -changeValue * Math.cos(time / duration * (Math.PI / 2)) + changeValue + beginningValue;
};
exports.In = In;
var Out = function Out(time, beginningValue, changeValue, duration) {
return changeValue * Math.sin(time / duration * (Math.PI / 2)) + beginningValue;
};
exports.Out = Out;
var InOut = function InOut(time, beginningValue, changeValue, duration) {
return -changeValue / 2 * (Math.cos(Math.PI * time / duration) - 1) + beginningValue;
};
exports.InOut = InOut;
var _default = {
In: In,
Out: Out,
InOut: InOut
};
exports["default"] = _default;