Hello GSAP people !
I recently created my first GSAP animation, for my portfolio. It consist in a horizontal scrolling, with a paper plane staying in the middle of the screen. Here is the link for you to understand better: actual version
I am pretty with the result sor far, but it's lagging a lot on mobile.
For the plane to follow the scroll, I did this
//create the animation timeline
let tl = gsap.timeline({
defaults: {
ease: "none",
},
scrollTrigger: {
trigger: slider,
pin: true,
scrub: true,
end: () => "+=" + scrollLength,
},
});
//create the horizontal scroll
tl.to(slider, {
xPercent: -1905.5
});
//make paperPlane stay in scroll
tl.to("#landing__paper_plane_transform", {
x: paperPlaneScrolling,
scrub: true,
}, 0);
I noticed it is especially lagging when other elements enter the screen. Maybe I should preload all the other svgs ?
Thank you in advance for any help you will provide 😁