@mvaneijgen @Rodrigo i have found the issue i have scrolltrigger js for above div also. it causing the problem. because of the width. can you please tell me the solution for this? https://drive.google.com/file/d/11x1lvsLuCi4kDywRqExW499X3Bz25uch/view
javascript:
// this script for above div
let tl = gsap.timeline({
scrollTrigger:{
trigger: $("#animated-image-text"),
// pin: ".keyur-animation",
start: "center bottom",
end: "+=200 ",
scrub: true,
// pin: true
// markers: true
// scrub: true
}
});
tl.from($("#animated-image-text"),{width:800, opacity:1, duration:1});
// The script for the div with an incorrect start position
const initialPositions = [
{ x: -576, y: 0 },
{ x: -192, y: -384 },
{ x: 480, y: -96 },
{ x: -288, y: 576 },
{ x: 576, y: 288 },
{ x: 0, y: 0 },
{ x: 75, y: 0 },
{ x: -75, y: 75 },
{ x: 0, y: 75 },
{ x: 75, y: 75 }
];
gsap
.timeline({
scrollTrigger: {
trigger: ".grid-container",
start: "top top",
end: () => "+=500",
scrub: 1.5,
pin: true,
anticipatePin: 0,
pinSpacing: true,
markers: {
startColor: "purple",
endColor: "fuchsia",
fontSize: "3rem",
}
},
delay: 0.2
})
.set(".gridBlock", { autoAlpha: 0 })
.to(".gridBlock", { duration: 0.1, autoAlpha: 1 }, 0.01)
.to(".grid-container .title-text", { opacity: 0, duration: 1 }, 0.01)
.from(
".gridLayer",
{
x: (index) => initialPositions[index].x,
y: (index) => initialPositions[index].y,
ease: "none"
},
"<"
)
.to({}, {}, "+=0.2");