})
this.initSwiperBottom()
-
},
initSwiperBottom: function() {
}
}
})
+ this.animateContent()
+ },
+
+ animateContent: function() {
+ gsap.timeline({delay: .5}).to(".active-screen .top-slider-container", {
+ opacity: 1
+ })
+ .to(".active-screen .bottom-slider", {
+ opacity: 1
+ })
+ .to(".active-screen .bottom-slider .swiper-slide", {
+ opacity: function(index) {
+ let opacity = 1
+ if(index === 1) {
+ opacity = 0.48
+ }else if(index === 2) {
+ opacity = 0.24
+ }else if(index === 3) {
+ opacity = 0
+ }
+ return opacity
+ },
+ ease: "power1.inOut",
+ stagger: .15,
+ onComplete: function() {
+ $(this.target).removeClass("not-visible")
+ }
+ })
},
setRotation: function(swiper) {
$(el).css({
'transform':'rotate('+(angle)+'deg)',
'top': $this.rules[index] ? $this.rules[index].top+'px' : 0,
- 'opacity': $this.rules[index] ? $this.rules[index].opacity : 0
})
+ if(!$(el).hasClass("not-visible")) {
+ $(el).css({
+ 'opacity': $this.rules[index] ? $this.rules[index].opacity : 0
+ })
+ }
if(direction === "next") {
angle += 4
} else {
})
.to("#start", {
y: 0,
-
}, .2)
.from(title.words, {
opacity: 0, y: 20, duration: .2, stagger: 0.05
} else {
$("#welcome p").html(this.quiz.utils.nl2br(intro_text))
}
+ this.animate();
},
}
.top-slider-container
margin: 75px 0 40px
+ opacity: 0
+flex-config(center, '','', flex-end)
.controls
margin: 0 24px
text-align: center
.bottom-slider
+ opacity: 0
.swiper-slide
width: 252px !important
height: 158px
padding: 15px
transition: all .3s
border: 2px solid transparent
+ opacity: 0
&-active
background-color: $neutral-color
border: 2px solid $texts-color
transform: rotate(0) !important
top: 0 !important
- opacity: 1 !important
+ &:not(.not-visible)
+ opacity: 1 !important
+
&-prev,
&-next
+opacity(.24,background-color,$neutral-color)
<div class="swiper-container bottom-slider">
<div class="swiper-wrapper">
@foreach($propositions as $prop)
- <div class="swiper-slide">
+ <div class="swiper-slide not-visible">
{{ $prop }}
</div>
@endforeach