GSAP SplitText Scroll Animation in Bricks Builder

In this GSAP and Bricks tutorial, I’ll show you how to easily create a highlight text on scroll effect as the user scrolls down the page.

Timestamps:

  • 0:00 Intro / Demo
  • 0:31 Add Split Text & CSS Class
  • 2:50 Add GSAP Code

GSAP Code

				
					<script src="https://cdn.jsdelivr.net/npm/gsap@3.15/dist/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15/dist/ScrollTrigger.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15/dist/SplitText.min.js"></script>

<script>
  // split text scroll effect
gsap.registerPlugin(ScrollTrigger, SplitText);

// Prevent excessive refreshes on mobile
ScrollTrigger.config({
  ignoreMobileResize: true
});

window.addEventListener("load", () => {
  document.fonts.ready.then(() => {

 const split = SplitText.create(".split-text p", {
  type: "words"
});

gsap.to(split.words, {
  color: "var(--wicky-charcoal)",
  stagger: 0.1,
  scrollTrigger: {
    trigger: ".split-text",
    start: "top 50%",
    end: "bottom 85%",
    //markers: true,
    scrub: true
  }
});

    ScrollTrigger.refresh();
  });
});
</script>
				
			

Free Brand Messaging Worksheet

Define Your Voice and Connect with Your Audience

More Free Resources

Let's Work Together

Big ideas start with a quick chat. Let’s talk!

Business Growth Insights Worth Opening

Practical, no-fluff insights on branding, web design, and building a stronger business. As a subscriber, you’ll also get exclusive access to our $500 referral bonus program.