change animation playback function

pull/1/head
hikariatama 2022-09-22 10:52:51 +00:00
parent c5e9b4ce5f
commit e6d7e203e7
1 changed files with 4 additions and 9 deletions

View File

@ -117,7 +117,7 @@ function tg_code() {
if (response.status == 401) {
$(".auth-code-form").hide().fadeIn(300, () => {
$("#monkey-close").html();
anim = bodymovin.loadAnimation({
bodymovin.loadAnimation({
container: document.getElementById("monkey-close"),
renderer: "canvas",
loop: false,
@ -127,11 +127,6 @@ function tg_code() {
clearCanvas: true,
}
});
anim.addEventListener("complete", function () {
setTimeout(function () {
anim.goToAndPlay(0);
}, 2000);
})
});
$(".code-input").removeAttr("disabled");
$(".code-caption").html("Enter your Telegram 2FA password, then press <span style='color: #dc137b;'>Enter</span>");
@ -272,7 +267,7 @@ function process_next() {
} else {
$(".auth-code-form").hide().fadeIn(300, () => {
$("#monkey").html();
anim2 = bodymovin.loadAnimation({
anim = bodymovin.loadAnimation({
container: document.getElementById("monkey"),
renderer: "canvas",
loop: false,
@ -282,9 +277,9 @@ function process_next() {
clearCanvas: true,
}
});
anim2.addEventListener("complete", function () {
anim.addEventListener("complete", function () {
setTimeout(function () {
anim2.goToAndPlay(0);
anim.goToAndPlay(0);
}, 2000);
})
});