{"id":933,"date":"2025-08-18T13:07:36","date_gmt":"2025-08-18T13:07:36","guid":{"rendered":"https:\/\/laywow.com\/non-categorise\/text-appearance-when-scrolling\/"},"modified":"2025-09-17T14:28:44","modified_gmt":"2025-09-17T14:28:44","slug":"text-appearance-when-scrolling","status":"publish","type":"post","link":"https:\/\/laywow.com\/en\/animations\/text-appearance-when-scrolling\/","title":{"rendered":"Text appearance when scrolling"},"content":{"rendered":"\n<p>In this guide, we will see <strong>step by step<\/strong> how to integrate this code into Elementor and apply the animation.<\/p>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\">Add custom code in Elementor<\/h2>\n\n<ol class=\"wp-block-list\">\n<li>Go to your <strong>WordPress dashboard<\/strong>.<\/li>\n\n\n\n<li>Navigate to <strong>Elementor &gt; Custom Code<\/strong>.<\/li>\n\n\n\n<li>Click on <strong>Add New Code<\/strong>.<\/li>\n\n\n\n<li>Name it, for example: <code>Texte Reveal Scroll<\/code>.<\/li>\n\n\n\n<li>Paste the following code, choosing the location <strong><strong>&lt;\/body&gt; &#8211; End<\/strong> <img decoding=\"async\" width=\"150\" height=\"25\" class=\"wp-image-726\" style=\"width: 150px;\" src=\"https:\/\/laywow.com\/wp-content\/uploads\/2025\/08\/image-1.png\" alt=\"\" srcset=\"https:\/\/laywow.com\/wp-content\/uploads\/2025\/08\/image-1.png 348w, https:\/\/laywow.com\/wp-content\/uploads\/2025\/08\/image-1-300x50.png 300w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/strong> :<\/li>\n<\/ol>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code>&lt;script src=\"https:\/\/unpkg.com\/split-type\"&gt;&lt;\/script&gt;\n&lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/gsap\/3.10.4\/gsap.min.js\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"&gt;&lt;\/script&gt;\n&lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/gsap\/3.10.4\/ScrollTrigger.min.js\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"&gt;&lt;\/script&gt;\n\n&lt;style&gt;\n.textRevealOnScroll .elementor-heading-title .line {\n  background: linear-gradient(to right, #FFF 50%, rgba(182,182,182,0.2) 56%);\n  background-size: 230% 100%;\n  background-position-x: 100%;\n  color: transparent;\n  background-clip: text;\n  -webkit-background-clip: text;\n}\n&lt;\/style&gt;\n\n&lt;script&gt;\nwindow.addEventListener('load', function() {\n  gsap.registerPlugin(ScrollTrigger);\n\n  ScrollTrigger.defaults({\n    scroller: document.documentElement\n  });\n\n  let configObject = {\n    limitCallbacks: true,\n    ignoreMobileResize: true,\n    autoRefreshEvents: \"load\",\n  }\n  ScrollTrigger.config(configObject);\n\n  let revealContainers = document.querySelectorAll('.textRevealOnScroll .elementor-heading-title');\n\n  revealContainers.forEach(e =&gt; {\n    let text = new SplitType(e, { types: \"lines\" });\n\n    let options = {\n      backgroundPositionX: \"0%\",\n      stagger: 0.4,\n      scrollTrigger: {\n        trigger: e,\n        scrub: 2,\n        start: \"top 60%\",\n        end: \"bottom 50%\"\n      }\n    };\n\n    let anim = gsap.to(e.querySelectorAll(\".line\"), options);\n\n    let windowsWidth = window.innerWidth;\n    window.addEventListener(\"resize\", function() {\n      if (windowsWidth !== window.innerWidth) {\n        anim.kill();\n        text = new SplitType(e, { types: \"lines\" });\n        anim = gsap.to(e.querySelectorAll(\".line\"), options);\n        windowsWidth = window.innerWidth;\n      }\n    });\n  });\n});\n&lt;\/script&gt;\n<\/code><\/pre>\n\n<p>This code automatically loads the <strong>SplitType<\/strong>, <strong>GSAP<\/strong>, and <strong>ScrollTrigger<\/strong> libraries, then applies the animation only to elements containing the class <code>.textRevealOnScroll<\/code>.<\/p>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\">Add a Title with the Class<\/h2>\n\n<ol class=\"wp-block-list\">\n<li>Open a <strong>page with Elementor<\/strong>.<\/li>\n\n\n\n<li>Add a <strong>Heading widget<\/strong> (<code>Heading<\/code>).<\/li>\n\n\n\n<li>In <strong>Advanced Settings &gt; CSS Classes<\/strong>, enter:  <\/li>\n<\/ol>\n\n<pre class=\"wp-block-code\"><code>.<span style=\"background-color: initial; font-family: inherit; text-align: initial;\">textRevealOnScroll<\/span><\/code><\/pre>\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"493\" height=\"56\" src=\"https:\/\/laywow.com\/wp-content\/uploads\/2025\/08\/image.png\" alt=\"\" class=\"wp-image-671\" srcset=\"https:\/\/laywow.com\/wp-content\/uploads\/2025\/08\/image.png 493w, https:\/\/laywow.com\/wp-content\/uploads\/2025\/08\/image-300x34.png 300w\" sizes=\"(max-width: 493px) 100vw, 493px\" \/><\/figure>\n\n<p>Your heading is now ready to animate on scroll!<\/p>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\">Test the Animation<\/h2>\n\n<ul class=\"wp-block-list\">\n<li>Scroll down your page and observe your headings: each line will be <strong>revealed with a smooth gradient effect<\/strong>.<\/li>\n\n\n\n<li>If you resize the window, the code automatically adapts to recalculate the lines.<\/li>\n<\/ul>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\">Expected Result<\/h2>\n\n<p>\u2705 Headings are revealed <strong>progressively on scroll<\/strong>, line by line.<br\/>\u2705 The effect is <strong>dynamic and modern<\/strong>, perfect for a landing page or portfolio.<br\/>\u2705 Compatible with Elementor and easy to customize.<\/p>\n\n<p><\/p>\n\n<h2 class=\"wp-block-heading\">Customize the Effect<\/h2>\n\n<ul class=\"wp-block-list\">\n<li><strong>Colors<\/strong>: modify the value of &#8220;background: linear-gradient(to right, #FFF 50%, rgba(182,182,182,0.2) 56%);&#8221; in the CSS.<\/li>\n\n\n\n<li><strong>Speed<\/strong>: adjust &#8220;<code>scrub: 2<\/code>&#8221; in GSAP to speed up or slow down.<\/li>\n\n\n\n<li><strong>Start\/End<\/strong>: adjust <code>start: \"top 60%\"<\/code> and <code>end: \"bottom 50%\"<\/code> to control when the effect starts.<\/li>\n<\/ul>\n\n<p>With this tutorial, you now have an <strong>ultra-modern scroll text effect<\/strong> that will give your Elementor pages a high-end style!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we will see step by step how to integrate this code into Elementor and apply the animation. Add custom code in Elementor This code automatically loads the SplitType, GSAP, and ScrollTrigger libraries, then applies the animation only to elements containing the class .textRevealOnScroll. Add a Title with the Class Your heading is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":932,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25],"tags":[22,23],"class_list":["post-933","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-animations","tag-scroll","tag-text"],"acf":[],"_links":{"self":[{"href":"https:\/\/laywow.com\/en\/wp-json\/wp\/v2\/posts\/933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laywow.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laywow.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laywow.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/laywow.com\/en\/wp-json\/wp\/v2\/comments?post=933"}],"version-history":[{"count":1,"href":"https:\/\/laywow.com\/en\/wp-json\/wp\/v2\/posts\/933\/revisions"}],"predecessor-version":[{"id":935,"href":"https:\/\/laywow.com\/en\/wp-json\/wp\/v2\/posts\/933\/revisions\/935"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/laywow.com\/en\/wp-json\/wp\/v2\/media\/932"}],"wp:attachment":[{"href":"https:\/\/laywow.com\/en\/wp-json\/wp\/v2\/media?parent=933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laywow.com\/en\/wp-json\/wp\/v2\/categories?post=933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laywow.com\/en\/wp-json\/wp\/v2\/tags?post=933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}