this.animateContent()
},
- animateContent: function() {
+ animateContent: function () {
let slidesNext = this.swiperBottomEl.find(".swiper-slide-active").nextAll()
let slidesPrev = this.swiperBottomEl.find(".swiper-slide-active").prevAll()
let slideActive = this.swiperBottomEl.find(".swiper-slide-active")
const rules = {
- opacity: function(index) {
+ opacity: function (index) {
let opacity = 0
- if(index === 0) {
+ if (index === 0) {
opacity = 0.8
- }else if(index === 1) {
+ } else if (index === 1) {
opacity = 0.6
- }else if(index === 2) {
+ } else if (index === 2) {
opacity = 0.4
}
return opacity
},
ease: "power1.inOut",
stagger: .15,
- onComplete: function() {
+ onComplete: function () {
$(this.target).removeClass("not-visible")
}
}
this.timeline.to(".active-screen .top-slider-container", {
opacity: 1
})
- .to(".active-screen .bottom-slider", {
- opacity: 1
- })
- .to(slideActive, {
- opacity: 1
- })
- .to(slidesNext, {
- ...rules
- }, ">-0.5")
- .to(slidesPrev, {
- ...rules
- }, "<")
+ .to(".active-screen .bottom-slider", {
+ opacity: 1
+ })
+ .to(slideActive, {
+ opacity: 1
+ })
+ .to(slidesNext, {
+ ...rules
+ }, ">-0.5")
+ .to(slidesPrev, {
+ ...rules
+ }, "<")
},
$(slide).css({transform: 'rotate(' + angle + 'deg) translateY(' + top + 'px)'});
if (this.timeline) {
if (this.timeline.progress() > 0) {
- $(slide).css('opacity',opacity)
+ $(slide).css('opacity', opacity)
}
}
},
this.swiperBottom.update()
if (this.swiperTop.activeIndex === lastIndex) {
- this.switchMatchValidateButton()
+ this.validateAnswers()
return false;
}
- this.swiperTop.slideNext()
+ this.swiperTop.slideNext();
},
- switchMatchValidateButton: function () {
- let btn = $(".active-screen").find(".confirmMatch"), text = this.quiz.l10n.__('Validate answer');
- btn.removeClass("confirmMatch").addClass("action validate").find('.text').text(text)
+ validateAnswers: function () {
+ let btn = $(".active-screen").find(".confirmMatch");
+ btn.removeClass("confirmMatch").addClass("action validate");
+ setTimeout(function () {
+ $(".active-screen").find(".validate").get(0).click();
+ }, 100);
+
},
reset: function () {