I'm using this code for the animation of the paragraphs as I scroll down:
gsap.to("#second-section-content", {
opacity: 1,
y: "500px",
scrollTrigger: {
trigger: ".first-overlay",
start: "+=60%",
end: "+=600",
scrub: true
}
});
And this works fine on computers and phones in portrait, but I realise my y: "500px" pushes the text too far down (outside the container) on phones in landscape orientation, as you can see on the codepen example in the text "Content 2".
How can I do to push those paragraphs down relative to the container, so they always stay inside the parent div regardless of screen orientation?
Thank you!