Im new with Gsap and i'm tryng to figure out how it works correctly.
I made this function for each .bluebox
$('.bluebox').each(function() {
var bluebox = $(this),
blueboxMiniTitulo = bluebox.find('.mini_titulo'),
blueboxTitulo = bluebox.find('.titulo'),
blueboxIntro = bluebox.find('.intro'),
blueboxBoton = bluebox.find('.botonWrap');
var blueboxTituloSplit= new SplitText(blueboxTitulo, { type: "lines"});
var blueboxTituloLine = blueboxTituloSplit.lines;
var blueboxIntroSplit= new SplitText(blueboxIntro, { type: "lines" });
var blueboxIntroLine = blueboxIntroSplit.lines;
var blueboxAni = gsap.timeline({defaults:{y:100, opacity:0, duration:1, ease: Power3.easeOut}})
.paused(true)
.from(blueboxMiniTitulo,{})
.from(blueboxTituloLine,{ stagger:.1})
.from(blueboxIntroLine,{ stagger:.1})
.from(blueboxBoton,{opacity:0});
ScrollTrigger.create({
trigger:bluebox,
start:"top 95%",
toggleActions:"play none none none",
animation:blueboxAni.play()
})
});
the problem that i'm looking to try to fix is if the window is resize, I want the split element re split, without triggering the scrollText animation again
Any suggestion, please?
Thanks in advance