From 2a0354551ae6760919941cb1c87fa3be6425db77 Mon Sep 17 00:00:00 2001 From: soufiane Date: Fri, 25 Aug 2023 18:35:35 +0200 Subject: [PATCH] wip #6194 @2:00 animation outro, score --- js/quiz.animations.js | 2 +- js/quiz.screen.intro.js | 3 --- js/quiz.screen.outro.js | 15 ++++++++++++--- js/quiz.screens.js | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/js/quiz.animations.js b/js/quiz.animations.js index 4a5a66c..ee4915e 100644 --- a/js/quiz.animations.js +++ b/js/quiz.animations.js @@ -68,7 +68,7 @@ QuizAnimations.prototype = { this.quiz.animations.load("RUNNINGMAN_BTN", ".active-screen .runningman", '', true); }, - footer: function(activeScreen) { + switchValidateContinueButton: function(activeScreen) { const $this = this gsap.timeline().to(".active-screen .footer-question", { opacity: 0, diff --git a/js/quiz.screen.intro.js b/js/quiz.screen.intro.js index 623b42c..a6677ee 100644 --- a/js/quiz.screen.intro.js +++ b/js/quiz.screen.intro.js @@ -28,9 +28,6 @@ QuizScreenIntro.prototype = { .to(".active-screen .title-header", { y: 0 }) - .from("#Ellipse_33_00000130640493289073085310000003655705460857783465_", { - drawSVG: 0 - }) .to("#start", { y: 0, },.2) diff --git a/js/quiz.screen.outro.js b/js/quiz.screen.outro.js index 79eb432..6cd50e5 100644 --- a/js/quiz.screen.outro.js +++ b/js/quiz.screen.outro.js @@ -17,7 +17,7 @@ QuizScreenOutro.prototype = { }) }, - animate: function (percent) { + animate: function (score, percent) { console.log("percent",percent) gsap.to(".active-screen #progress-circle", {drawSVG: 0, duration: 0}) gsap.timeline({delay: .4}) @@ -32,6 +32,14 @@ QuizScreenOutro.prototype = { duration: 2, ease: "power4.easeIn" }) + .from("#score-counter", { + innerText: 0, + duration: 2, + ease: "power4.easeIn", + snap : { + innerText: 1 + } + }, "<") }, show: function () { @@ -50,7 +58,8 @@ QuizScreenOutro.prototype = { const percent = (score/maxScore) * 100 - this.animate(percent) + $("[id^=score-]").text(score) + this.animate(score,percent) reviewList = reviewList.map((c, i) => { return { @@ -63,7 +72,7 @@ QuizScreenOutro.prototype = { }) let $ul = $("#answers-list") - $("[id^=score-]").text(score) + //$("[id^=score-]").text(score) $("[id^=maxScore-]").text(maxScore) // diff --git a/js/quiz.screens.js b/js/quiz.screens.js index 338041b..2747d67 100644 --- a/js/quiz.screens.js +++ b/js/quiz.screens.js @@ -69,7 +69,7 @@ QuizScreens.prototype = { // Disable form, we don't want the user be able to click on items $(form).addClass('disabled'); - this.quiz.animations.footer(activeScreen) + this.quiz.animations.switchValidateContinueButton(activeScreen) let results = review.answersStatus; -- 2.39.5