|
@@ -77,7 +77,7 @@ export function initSmoothAnimation() {
|
|
|
smoothAnimationState.aveSpeed = (canvasDomPath / (state.times[state.times.length - 1].time - state.times[0].time) / 1000) * 16.67
|
|
|
// 当前屏幕的宽度
|
|
|
calcClientWidth()
|
|
|
- document.addEventListener("resize", calcClientWidth)
|
|
|
+ window.addEventListener("resize", calcClientWidth)
|
|
|
// 初始化 只有练习模式 才显示
|
|
|
state.modeType === "practise" && (smoothAnimationState.isShow.value = true)
|
|
|
console.log(smoothAnimationState, "一行谱小鸟数据")
|
|
@@ -88,7 +88,7 @@ export function initSmoothAnimation() {
|
|
|
*/
|
|
|
export function destroySmoothAnimation() {
|
|
|
smoothAnimationState.isShow.value = false
|
|
|
- document.removeEventListener("resize", calcClientWidth)
|
|
|
+ window.removeEventListener("resize", calcClientWidth)
|
|
|
smoothAnimationState.smoothAnimationBoxDom?.remove()
|
|
|
Object.assign(smoothAnimationState, {
|
|
|
canvasDom: null,
|