From: soufiane Date: Thu, 24 Aug 2023 10:41:13 +0000 (+0200) Subject: wip #6194 @0:10 correctif animation runningman X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6688c90d279414d60b2a1ffe59993ad39c5f705b;p=fluidbook-toolbox-quiz.git wip #6194 @0:10 correctif animation runningman --- diff --git a/js/quiz.screens.js b/js/quiz.screens.js index 368ca2c..08090a6 100644 --- a/js/quiz.screens.js +++ b/js/quiz.screens.js @@ -132,6 +132,7 @@ QuizScreens.prototype = { const $this = this; let screenToShow = $('[data-screen="' + screen + '"]'); this.hideCurrentScreen(function () { + $this.resetCountdownBackground() screenToShow.removeClass("none").addClass("next active-screen"); if (callback !== undefined) { callback(); @@ -160,7 +161,7 @@ QuizScreens.prototype = { opacity: 1, ease: "circ.out", onComplete: function () { - // if countdown enable + // if countdown enable we launch it if($this.quiz.question.current() !== undefined) { if (parseInt($this.quiz.question.current().countdown_enable)) { $this.countdown() @@ -232,7 +233,7 @@ QuizScreens.prototype = { this.runningManTimeout = setTimeout(() => { $this.quiz.animations.runningMan() $(".active-screen .runningman").css("opacity", 1) - }, 350) + }, 250) this.intervalCountDown = setInterval(function () { value -= (10 / time) * 100 @@ -256,6 +257,10 @@ QuizScreens.prototype = { } }, 10) }, + + resetCountdownBackground: function() { + document.documentElement.style.setProperty("--width-bg-countdown", "100%") + } }; export default QuizScreens;