UNPKG

vue-danmaku

Version:

基于 Vue 的弹幕交互组件 | A danmaku component for Vue

42 lines (41 loc) 1.41 kB
/** * requestAnimationFrame动画管理器 * 用于弹幕的性能模式动画处理 */ /** * 启动弹幕动画 * @param el 弹幕DOM元素 * @param width 弹幕宽度 * @param containerWidth 容器宽度 * @param speed 弹幕速度(像素/秒) * @param isPaused 是否处于暂停状态 * @param onAnimationEnd 动画结束回调 */ export declare function startAnimation(el: HTMLDivElement, width: number, containerWidth: number, speed: number, isPaused: () => boolean, onAnimationEnd: (el: HTMLDivElement) => void): void; /** * 恢复弹幕动画 * @param el 弹幕DOM元素 * @param width 弹幕宽度 * @param containerWidth 容器宽度 * @param speed 弹幕速度 * @param isPaused 是否处于暂停状态 * @param onAnimationEnd 动画结束回调 */ export declare function resumeAnimation(el: HTMLDivElement, width: number, containerWidth: number, speed: number, isPaused: () => boolean, onAnimationEnd: (el: HTMLDivElement) => void): void; /** * 暂停所有动画 */ export declare function pauseAllAnimations(): void; /** * 取消元素的动画 * @param el 弹幕DOM元素 */ export declare function cancelAnimation(el: HTMLElement): void; /** * 取消所有动画,并清除位置信息 */ export declare function cancelAllAnimations(): void; /** * 取消主循环 */ export declare function cancelMainLoop(): void;