clearTimeout(this.instantReviewAnimationTimeout);
},
- fadeOut: function (el, remove) {
+ fadeOut: function (el, remove, timeout = true) {
$(el).addClass('animateOpacity disabled').css('opacity', 0);
if (remove === true) {
- setTimeout(function () {
+ if(timeout) {
+ setTimeout(function () {
+ $(el).remove();
+ }, 500);
+ }else {
$(el).remove();
- }, 500);
+ }
}
},
$(activeScreen).find('.btn.continue').removeClass('none')
$(activeScreen).find('.btn.validate').addClass('none')
// Hide reset button
- $this.quiz.animations.fadeOut($(activeScreen).find('.btn.reset'), true);
+ $this.quiz.animations.fadeOut($(activeScreen).find('.btn.reset'), true, false);
}
}).to(".active-screen .footer-question", {
y: 0,
import $ from "cash-dom";
import gsap from "gsap";
-import {MotionPathPlugin} from "gsap/MotionPathPlugin.js";
import {CubeSCORM} from '/application/resources/scorm/scorm';
import QuizResize from "./quiz.resize";
import gsap from "gsap";
import SplitType from 'split-type';
-import { DrawSVGPlugin } from "gsap/DrawSVGPlugin.js";
function QuizScreenIntro(screens) {
this.quiz = screens.quiz;
},
animate: function () {
- gsap.registerPlugin(DrawSVGPlugin);
//animer le texte d'intro
let title = new SplitType("#welcome h2", {types: 'words, chars'})
let text = new SplitType("#welcome p", {types: 'words, chars'})
})
.to("#start", {
y: 0,
+
},.2)
.from(title.words, {
opacity: 0, y: 20, duration: .2, stagger: 0.05
import SimpleBar from 'simplebar'
import 'simplebar/dist/simplebar.css'
import Handlebars from "handlebars";
+import SplitType from 'split-type';
+import { DrawSVGPlugin } from "gsap/DrawSVGPlugin.js";
function QuizScreenOutro(screens) {
this.quiz = screens.quiz;
},
animate: function (score, percent) {
- console.log("percent",percent)
+ //animer le texte d'intro
+ gsap.registerPlugin(DrawSVGPlugin);
+ let subtitle = new SplitType(".score-text .subtitle", {types: 'words, chars'})
+
gsap.to(".active-screen #progress-circle", {drawSVG: 0, duration: 0})
gsap.timeline({delay: .4})
.to(".active-screen .title-header", {
.to(".active-screen footer", {
y: 0
})
+ .to("#progress-counter", {
+ scale: 1,
+ })
.to(".active-screen #progress-circle", {
drawSVG: percent+"%",
- duration: 2,
- ease: "power4.easeIn"
- })
+ duration: 1.5,
+ ease: "power4.easeOut"
+ }, ">-0.5")
+ .to(".score-text", {
+ scale: 1,
+ },1.3)
.from("#score-counter", {
innerText: 0,
- duration: 2,
- ease: "power4.easeIn",
+ duration: 1.85,
+ ease: "power4.easeOut",
snap : {
innerText: 1
}
- }, "<")
+ }, ">-.8")
+ .to("#score h1", {
+ opacity: 1,
+ y: 0
+ },">-1")
+ .to(".score-text .subtitle .word", {
+ opacity: 1,
+ y: 0,
+ stagger: {
+ amount: 0.1
+ }
+ })
+ .to("#score .restart-sentence-mobile", {
+ opacity: 1,
+ y: 0
+ })
+ .to("#score .restart-mobile", {
+ opacity: 1,
+ y: 0
+ })
},
show: function () {
.m
#welcome
top: 138px
+ #start
+ left: 50%
.subtitle
+opacity(.8,color,$texts-color)
+ h1,
+ .score-text .subtitle .word,
+ .restart-sentence-mobile,
+ .btn.restart-mobile
+ transform: translateY(35px)
+ opacity: 0
+
&-content
flex: 1
padding: 24px
#overlay-circle
display: none
+ #progress-counter,
+ .score-text
+ transform: scale(0)
+
&-answers-review_container
width: 36.11111%
height: 600px //680(hauteur de base) - 80(hauteur du header)
position: static
border-radius: 0
+ background: none
&:after
content: ""
width: 100%
&-counter
margin: 0 0 24px
font-size: 56px
+ padding-bottom: 41%
+ width: 100%
+ max-width: 140px
#overlay-circle
display: initial
&-answers-review_container
align-items: flex-end
visibility: hidden
//+opacity(0,background-color,$ok-color)
- backdrop-filter: blur(4px)
+ transition: all .8s
&.active
//+opacity(1,background-color,$ok-color)
+ backdrop-filter: blur(4px)
visibility: visible
+ .score-answers-review
+ transform: none
+
&-answers-review
width: 100%
height: calc(100% - 78px)
padding: 8px 16px 0
border-top-left-radius: 20px
border-top-right-radius: 20px
+ transform: translateY(100%)
+ transition: all .8s ease-out
h2
margin-bottom: 12px
text-align: center
height: 90%
padding-right: 5px
.toggle-answers-review
- display: none
+ display: flex
footer
width: 100%
bottom: 0
<div class="score-content-wrapper">
<div class="score-counter">
<div id="progress-counter">
- <span id="score-counter">0</span><span>/</span><span id="maxScore-counter">0</span>
- <svg xmlns:x="http://ns.adobe.com/Extensibility/1.0/" xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/" xmlns:graph="http://ns.adobe.com/Graphs/1.0/" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="SCORE" x="0px" y="0px" viewBox="0 0 194 194" style="enable-background:new 0 0 194 194;" xml:space="preserve">
+ <span class="score-text" id="score-counter">0</span>
+ <span class="score-text">/</span>
+ <span class="score-text" id="maxScore-counter">8</span>
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="SCORE" x="0px" y="0px" viewBox="0 0 148 148" style="enable-background:new 0 0 148 148;" xml:space="preserve">
<style type="text/css">
- .st0{opacity:8.000000e-02;fill:#250C66;enable-background:new ;}
- .st1{opacity:0.16;fill:none;stroke:#FFFFFF;stroke-miterlimit:10;enable-background:new ;}
- .st2{fill:none;stroke-linecap:round;stroke-miterlimit:10;}
+ .st0{opacity:0.16;fill:none;stroke:#FFFFFF;stroke-miterlimit:10;enable-background:new ;}
+ .st1{fill:none;stroke-linecap:round;stroke-miterlimit:10;}
</style>
- <circle id="overlay-circle" class="st0" cx="97" cy="97" r="97"/>
- <circle id="circle" class="st1" cx="97" cy="97" r="70"/>
- <circle id="progress-circle" class="st2" cx="97" cy="97" r="70" stroke="currentColor"/>
+ <circle id="circle" class="st0" cx="74" cy="74" r="70"/>
+ <circle id="progress-circle" class="st1" cx="74" cy="74" r="70" stroke="currentColor"/>
</svg>
</div>
</div>
<div class="score-text">
<h1>Congratulation!</h1>
- <p class="subtitle">You have completed the quiz<br/> with <span id="score-text"></span>
- correct answers out of <span id="maxScore-text"></span>
- </p>
+ <div class="subtitle">
+ <p class="word">You have completed the quiz</p><br/>
+ <p class="word">with <span id="score-text"></span>
+ correct answers out of <span id="maxScore-text"></span>
+ </p>
+ </div>
@if($data->restart_button)
<div class="restart-sentence-mobile">Want to improve your score?</div>
<a class="btn secondary restart restart-mobile">