@progress/kendo-vue-animation
Version:
Kendo UI for Vue Animation package
25 lines (24 loc) • 851 B
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
const a = (e, n = 0, o = 0) => {
const w = e.duration;
let c, r, u = n && 1 - n;
e.onStart && e.onStart();
const t = (l) => {
c || (c = l), r = l - c + 1;
const d = r / w + u;
d <= 1 ? (e.onUpdate && e.onUpdate(d), o = window.requestAnimationFrame(t), n = d) : (e.onEnd && e.onEnd(1), n = 0);
};
return o = window.requestAnimationFrame(t), o;
}, p = (e) => {
e && window.cancelAnimationFrame(e);
};
export {
a as animate,
p as cancelAnimation
};