let tl = gsap.timeline({
scrollTrigger: {
trigger: “.gallery”,
start: “0% 0%”,
end: “400% 0%”,
pin: “.gallery”,
scrub: 6,
markers: true,
}
});
tl.set(“.block”, {
scale: “random(0.1, 0.2)”,
opacity: 0,
})
.to(“.block”, {
scale: “random(1, 2)”,
y: “random([-60vh, 60vh])”,
x: “random([-60vw, 60vw])”,
keyframes: {
opacity: [0, 1, 0]
},
duration: 5,
stagger: {
each: 1,
amount: 6
}
});
this is the code i am using for animation but the problem is:
tl.set(“.block”, {
scale: “random(0.1, 0.2)”,
opacity: 0,
})
.to(“.block”, {
scale: “random(1, 2)”,
y: “random([-60vh, 60vh])”,
x: “random([-60vw, 60vw])”,
keyframes: {
opacity: [0, 1, 0]
},
duration: 5,
stagger: {
each: 1,
amount: 6
}
});
this particular part of code is not working but pining of the code is working
can you please help me with this