TweenLite.defaultEase = Linear.easeNone;
var controller = new ScrollMagic.Controller();
var tl = new TimelineMax();
var pannelEffectsMap = {
0: {xPercent: 100},
1: {xPercent: -100},
2: {yPercent: 100},
};
var panels = document.querySelectorAll('.panel');
panels.forEach(function(panel, index){
if(index !== 0){
var mapIndex = index % 3 // Так как в pannelEffectsMap только 3 "эффекта"
tl.from(panel, 1, pannelEffectsMap[mapIndex]);
}
})
new ScrollMagic.Scene({
triggerElement: "#pinMaster",
triggerHook: "onLeave",
duration: "200%"
})
.setPin("#pinMaster")
.setTween(tl)
.addIndicators({
colorTrigger: "white",
colorStart: "white",
colorEnd: "white",
indent: 40
})
.addTo(controller);