]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wip #6194 @0:10 correctif animation runningman
authorsoufiane <soufiane@cubedesigners.com>
Thu, 24 Aug 2023 10:41:13 +0000 (12:41 +0200)
committersoufiane <soufiane@cubedesigners.com>
Thu, 24 Aug 2023 10:41:13 +0000 (12:41 +0200)
js/quiz.screens.js

index 368ca2cabfbe62ec7f7db0dc549b1d3ef82defdf..08090a6b734d2f6937e13ea7a79f4e381398235c 100644 (file)
@@ -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;