From e985f1384e9ced9f0417a5ba40139cf61bc303cb Mon Sep 17 00:00:00 2001 From: soufiane Date: Thu, 10 Aug 2023 19:06:40 +0200 Subject: [PATCH] wip #6194 @2:30 animation des boutons --- resources/quizv2/js/quiz.animations.js | 8 ++++++++ resources/quizv2/js/quiz.js | 19 +++++++++++++++++++ resources/quizv2/js/quiz.score.js | 1 - resources/quizv2/style/005-utilities.sass | 4 ++++ resources/quizv2/style/100-global.sass | 1 - resources/quizv2/style/105-outro.sass | 4 ++++ 6 files changed, 35 insertions(+), 2 deletions(-) diff --git a/resources/quizv2/js/quiz.animations.js b/resources/quizv2/js/quiz.animations.js index d20d95669..d43a719cc 100644 --- a/resources/quizv2/js/quiz.animations.js +++ b/resources/quizv2/js/quiz.animations.js @@ -22,6 +22,14 @@ QuizAnimations.prototype = { animationData: JSON.parse(json), }); } + }, + + triggeredBtn: function() { + /*$(document).on("mousedown", ".btn", function() { + gsap.to($(this), { scale: .9, duration: 0.3 }); + }).on("mouseup", ".btn", function() { + gsap.to($(this), { scale: 1, duration: 0.3 }); + })*/ } } diff --git a/resources/quizv2/js/quiz.js b/resources/quizv2/js/quiz.js index f4f358951..96066a6df 100644 --- a/resources/quizv2/js/quiz.js +++ b/resources/quizv2/js/quiz.js @@ -45,6 +45,10 @@ Quiz.prototype = { // ICI tout commence vraiment console.log(this.data.theme) + // + //this.animations.triggeredBtn() + + // $("#quiz").css("background-image","url("+this.data.theme.backgroundImage+")") // La fonction resize est appelée à chaque fois qu'un resize de la fenêtre survient (et à l'init de l'app) @@ -104,9 +108,20 @@ Quiz.prototype = { }) key('r', function (e){ e.preventDefault() + console.log(e) $this.resetForm() }) + if(key.isPressed('R')) { + alert('r') + } + + $(document).on("mousedown", ".btn", function() { + gsap.to($(this), { scale: .95, duration: .2, ease: "back.inOut" }); + }).on("mouseup", ".btn", function() { + gsap.to($(this), { scale: 1, duration: .2 }); + }) + // this.activeNav() }, @@ -295,6 +310,10 @@ Quiz.prototype = { // mise en place de la scrollbar personnalisé // https://github.com/Grsmto/simplebar/tree/master/packages/simplebar const simpleBar = new SimpleBar($ul.get(0)) + }, + + restart: function() { + } } diff --git a/resources/quizv2/js/quiz.score.js b/resources/quizv2/js/quiz.score.js index 9d8d9dcea..b3367885c 100644 --- a/resources/quizv2/js/quiz.score.js +++ b/resources/quizv2/js/quiz.score.js @@ -147,7 +147,6 @@ QuizScore.prototype = { cubeSCORM.setSCORMLocation(state); } }, - }; module.exports = QuizScore; diff --git a/resources/quizv2/style/005-utilities.sass b/resources/quizv2/style/005-utilities.sass index 96177f955..41ac547e6 100644 --- a/resources/quizv2/style/005-utilities.sass +++ b/resources/quizv2/style/005-utilities.sass @@ -6,3 +6,7 @@ .none display: none + +\:root + --space-21-66: clamp(1.31rem, calc(0.29rem + 5.11vw), 4.13rem) + diff --git a/resources/quizv2/style/100-global.sass b/resources/quizv2/style/100-global.sass index 32d616012..b7af25569 100644 --- a/resources/quizv2/style/100-global.sass +++ b/resources/quizv2/style/100-global.sass @@ -66,7 +66,6 @@ body +opacity(.24, background-color, $nok-color) svg color: $nok-color - &.ok, &.nok, &.missed diff --git a/resources/quizv2/style/105-outro.sass b/resources/quizv2/style/105-outro.sass index 97ff0eb44..0b2e9da5f 100644 --- a/resources/quizv2/style/105-outro.sass +++ b/resources/quizv2/style/105-outro.sass @@ -17,8 +17,12 @@ margin-bottom: 9px .subtitle +font-size(16) + &-content-wrapper +flex-config(false,false,false,center) + position: relative + top: var(--space-21-66) + left: var(--space-21-66) &-counter height: 0 -- 2.39.5