function QuizScreenOutro(screens) {
this.quiz = screens.quiz;
this.screens = screens;
-
- this.initEvents();
}
QuizScreenOutro.prototype = {
initEvents: function () {
const $this = this;
- let popup = $("#resume")
- let quiz = $("#quiz").get(0)
+ this.popup = $("#resume")
+ this.quizEL = $("#quiz").get(0)
$(document).on("click", ".toggle-answers-review", function () {
$(".score-answers-review_container").toggleClass("active")
});
$(document).on("mousemove", function(e) {
- let x = e.clientX - quiz.getBoundingClientRect().left
- let y = e.clientY - quiz.getBoundingClientRect().top
+ let x = e.clientX - $this.quizEL.getBoundingClientRect().left
+ let y = e.clientY - $this.quizEL.getBoundingClientRect().top
- popup.css({
+ $this.popup.css({
left: x,
top: y,
})
});
$(document).on("mouseover", ".area-item, .match-item, .multiple-item", function (e) {
- let content = $(this).find(".content").html()
+ let content = $(this).find(".content").text()
if(content) {
- popup.html(content)
- gsap.to(popup, {autoAlpha: 1})
+ $this.popup.html(content)
+ gsap.to($this.popup, {autoAlpha: 1})
}
}).on("mouseout", function () {
- gsap.to(popup, {autoAlpha: 0})
+ gsap.to($this.popup, {autoAlpha: 0})
})
+
+ this.show();
},
animate: function (score, percent) {
$this.quiz.progressbar.update();
if (screen === 'outro') {
- $this.outro.show();
+ $this.outro.initEvents();
}
$this.quiz.resize.resize();
validateEmail: function (email) {
let re = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
return re.test(email);
- }, reset: function () {
+ },
+
+ reset: function () {
$("#screens").html(this.screensHTML);
}
};