Hey! Thanks @alig01
I was playing with your code, but seems bit hard to inject also scrolltrigger and have each function working together.
btw.. thanks for your time
gsap.registerPlugin(MotionPathPlugin, ScrollTrigger);
MorphSVGPlugin.convertToPath("circle, line");
let roundtext = document.querySelector("#textPath");
let masterTl = gsap.timeline({
scrollTrigger: {
trigger: "body", // or whichever element you want to listen for scroll events on
start: "top top+=20", // animation starts when top of your trigger hits the top of the viewport
end: "bottom bottom", // animation ends when bottom of your trigger hits the bottom of the viewport
scrub: true, // enables scrubbing
markers: true // Optional, shows markers where animation starts and ends
}
});
let tl = gsap.timeline({ defaults: { ease: "none", duration: 5 } })
.to(roundtext, {
attr: { startOffset: "50%" }
});
masterTl.add(tl);
let tl2 = gsap.timeline({ repeat: -1 })
.to("#text", {
rotate: -360,
transformOrigin: "50% 55%",
ease: "none",
duration: 20
});
masterTl.add(tl2);