i found this scroll code ...
and my question is how can i combine demo code with this code below
this code below can control speed of the object
thanks for you times !
let anim = gsap.to("#cat", {
paused: true,
immediateRender: true,
ease: "none",
motionPath: {
path: "#text-curve",
align: "#text-curve",
alignOrigin: [0.5, 0.5],
autoRotate: true,
}
});
let progressTo = gsap.quickTo(anim, "progress", {
duration: 0.5,
ease: "expo"
});
let catTo = gsap.quickTo("#cat", "rotationY")
Observer.create({
type: "wheel,touch,pointer",
wheelSpeed: -1,
onUp() {
progressTo(anim.progress() + 0.1);
},
onDown() {
progressTo(anim.progress() - 0.1);
},
onToggleY(self) {
let rotation = self.deltaY < 0 ? 180 : 0;
catTo(rotation);
}
});