Thanks a lot for your suggestions.
I tested @OSUblake your first two examples and, ideed, they are working. Sadly, there are quite a few problems:
Microsoft Edge has a weird problem where if I start scrolling back up from the end to the top, it shows one random image and then suddenly starts the sprite process.
I tested quite a ton of grids for mobile, and the webpage can't properly load up. I'm sure this is because the file is too large or the grid is too big for mobile.
@ZachSaucier I'm afraid I don't understand your code without seeing a CodePen.
@OSUblake Your last Pen is the best solution so far. It works across every browser, the performance of mobile is great and I don't have to play around too much with media queries to optimize this on mobile.
Sadly, I've encountered other problem.
Apple's way of fading in and fading out is pretty neat: immediately after first text element finishes fading out, the second element starts to fade in.
I managed to do that on desktop, but on mobile I can't do it.
I'm using ScrollTrigger.matchMedia to achieve the desired animation on mobile, but it doesn't work.
If I replace end: "bottom top" with end: "bottom -50%" in the all : function() { } , the effect works on mobile, but If I replace it in the "(max-width: 799px)" : function() { } , it doesn't. I think I'm doing something wrong with the media queries.
scrollTrigger: {
trigger: target,
markers: true,
scrub: true,
start: "center 50%",
end: "bottom top",
pin: true
}
Here is a new Pen:
https://codepen.io/make96/pen/LYNRrJY