@bitty/animate
Version:
Create and manage animation functions with AnimationFrame API.
3 lines (2 loc) • 566 B
JavaScript
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).animate={})}(this,(function(e){"use strict";e.default=function(e){var n=null,t=!1,i=function(){t&&(e(),n=window.requestAnimationFrame(i))};return{get running(){return t},stop:function(){t&&(n&&(window.cancelAnimationFrame(n),n=null),t=!1)},start:function(){t||(t=!0,i())}}},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=animate.umd.min.js.map