Jump to content
Search Community

ScrollTriger reveal text color with splitText

balocreation test
Moderator Tag

Recommended Posts

We love helping with GSAP-related questions, but unfortunately we just don't have the resources to provide free general consulting, logic troubleshooting, or "how do I recreate this cool effect I saw on another site?" tutorials. Of course anyone else is welcome to post an answer if they'd like - we just want to manage expectations.  

 

You can post in the "Jobs & Freelance" forum for paid consulting, or contact us directly. 

 

Otherwise, if you've got a GSAP-specific question just post that here along with a minimal demo and we'd be happy to take a look. 

Link to comment
Share on other sites

Thanks, I have fixed it.

 

const createSplits = () => {
Array.from(document.querySelectorAll(".section-heading")).forEach(el => {
if(el.motion) {
el.motion.progress(1).kill();
el.split.revert();
}
el.split = new SplitText(el, {
type: "lines,words,chars",
linesClass: "split-lines"
});
el.motion = gsap.from(el.split.chars, {
scrollTrigger: {
trigger: el,
toggleActions: "restart pause resume reverse",
start: "top 100%",
end: "bottom top"
},
y: "0%",
opacity: 0.2,
duration: 0.02,
rotationX: -0,
ease: "none",
stagger: {
amount: 0.8,
from: "start"
}
});
});
}
ScrollTrigger.addEventListener("refresh", createSplits);
createSplits();
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...