Update view.js

This commit is contained in:
u0_ani-nya.com
2024-12-16 23:16:17 +08:00
committed by GitHub
parent 60be4b967e
commit d23e63791d

View File

@@ -1877,35 +1877,37 @@
}) })
} }
} }
toggleGogoTime(circle){ toggleGogoTime(circle) {
var startMS = circle.ms + this.controller.audioLatency var startMS = circle.ms + this.controller.audioLatency;
this.gogoTime = circle.gogoTime this.gogoTime = circle.gogoTime;
if(circle.gogoTime || this.gogoTimeStarted !== -Infinity){ if (circle.gogoTime || this.gogoTimeStarted !== -Infinity) {
this.gogoTimeStarted = startMS this.gogoTimeStarted = startMS;
} }
if(this.gogoTime){ if (this.gogoTime) {
this.assets.fireworks.forEach(fireworksAsset => { this.assets.fireworks.forEach(fireworksAsset => {
fireworksAsset.z-index=1 fireworksAsset.zIndex = 10;
fireworksAsset.position='absolute' fireworksAsset.setAnimation("normal");
fireworksAsset.setAnimation("normal") fireworksAsset.setAnimationStart(startMS);
fireworksAsset.setAnimationStart(startMS) var length = fireworksAsset.getAnimationLength("normal");
var length = fireworksAsset.getAnimationLength("normal") fireworksAsset.setAnimationEnd(length, () => {
fireworksAsset.setAnimationEnd(length, () => { fireworksAsset.setAnimation(false);
fireworksAsset.setAnimation(false) });
}) });
})
this.assets.fire.setAnimation("normal") this.assets.fireworks.sort((a, b) => a.zIndex - b.zIndex);
var don = this.assets.don
don.setAnimation("gogostart") this.assets.fire.setAnimation("normal");
var length = don.getAnimationLength("gogo") var don = this.assets.don;
don.setUpdateSpeed(4 / length) don.setAnimation("gogostart");
var start = startMS - (startMS % this.beatInterval) var length = don.getAnimationLength("gogo");
don.setAnimationStart(start) don.setUpdateSpeed(4 / length);
var length = don.getAnimationLength("gogostart") var start = startMS - (startMS % this.beatInterval);
don.setAnimationEnd(length, don.normalAnimation) don.setAnimationStart(start);
} var length = don.getAnimationLength("gogostart");
} don.setAnimationEnd(length, don.normalAnimation);
}
}
drawGogoTime(){ drawGogoTime(){
var ms = this.getMS() var ms = this.getMS()