GSAP BLUR TEXT REVEAL ON SCROLL

So if you follow along in the video, I refer to this blog post for you to enter code at certain point into the HTML widget, so below is everything you will need!

The Following code goes into the HTML widget:

				
					<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.3/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.3/ScrollTrigger.min.js"></script>

<script>
document.addEventListener('DOMContentLoaded', function () {
  gsap.registerPlugin(ScrollTrigger);

  // Function to split text into spans
  function splitTextIntoSpans(selector) {
    const elements = document.querySelectorAll(selector);
    elements.forEach(element => {
      const text = element.innerText;
      element.innerHTML = ""; // Clear existing content
      text.split("").forEach(char => {
        const span = document.createElement("span");
        span.style.display = "inline-block";
        span.style.opacity = "0";
        span.style.filter = "blur(8px)";
        span.style.transform = "translateX(-100px)";
        span.innerText = char === " " ? "\u00A0" : char; // Non-breaking space for spaces
        element.appendChild(span);
      });
    });
  }

  splitTextIntoSpans("h1");

  document.querySelectorAll("h1").forEach(h1 => {
    gsap.fromTo(h1.querySelectorAll("span"), {
      x: '-100%',
      filter: 'blur(8px)',
      opacity: 0,
    }, {
      x: '0%',
      filter: 'blur(0)',
      opacity: 1,
      duration: 1.5,
      ease: "power4.out",
      stagger: 0.05,
      scrollTrigger: {
        trigger: h1,
        start: "top 80%", // Adjust if necessary
        end: "top 50%", // Ensures animation completes
        toggleActions: "restart none none reset",
        scrub: 1,
        markers: false
      },
    });
  });
});
</script>
				
			

Other Articles

How To Make A Vertical 3D Gallery Slider

https://youtu.be/BWoXciYFn-Q So if you follow along in the video, I refer to this blog post for you to enter code ...

How To Make A Horizontal 3D Gallery Slider

So if you follow along in the video, I refer to this blog post for you to enter code at ...

How To Make A Auto Rotating 3D Carousel

So if you follow along in the video, I refer to this blog post for you to enter code at ...

How To Make A 3D Carousel For Products

So if you follow along in the video, I refer to this blog post for you to enter code at ...