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")
var don = this.assets.don this.assets.fireworks.sort((a, b) => a.zIndex - b.zIndex);
don.setAnimation("gogostart")
var length = don.getAnimationLength("gogo") this.assets.fire.setAnimation("normal");
don.setUpdateSpeed(4 / length) var don = this.assets.don;
var start = startMS - (startMS % this.beatInterval) don.setAnimation("gogostart");
don.setAnimationStart(start) var length = don.getAnimationLength("gogo");
var length = don.getAnimationLength("gogostart") don.setUpdateSpeed(4 / length);
don.setAnimationEnd(length, don.normalAnimation) var start = startMS - (startMS % this.beatInterval);
} don.setAnimationStart(start);
var length = don.getAnimationLength("gogostart");
don.setAnimationEnd(length, don.normalAnimation);
} }
}
drawGogoTime(){ drawGogoTime(){
var ms = this.getMS() var ms = this.getMS()