From 4afa74bd16b1b63170222f9a4ad893b91d93ffef Mon Sep 17 00:00:00 2001 From: Reef Date: Thu, 20 Aug 2026 22:20:56 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20restore=20gsap.set=20pre-hide=20+=20simp?= =?UTF-8?q?ler=20observer=20(threshold=200.1,=20no=20rootMargin)=20?= =?UTF-8?q?=E2=80=94=20ensures=20no=20flash=20and=20animations=20fire=20co?= =?UTF-8?q?rrectly=20on=20scroll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/script.js b/script.js index bf4f299..7344b5a 100644 --- a/script.js +++ b/script.js @@ -549,11 +549,11 @@ var si = 0, entries.forEach(function (entry) { if (!entry.isIntersecting) return; var grid = entry.target; - if (animated[grid.dataset.section]) return; - animated[grid.dataset.section] = true; - var items = grid.children; + var key = grid.className || 'anon'; + if (animated[key]) return; + animated[key] = true; gsap.fromTo( - items, + grid.children, { y: 30, opacity: 0 }, { y: 0, @@ -565,14 +565,13 @@ var si = 0, } ); }); - }, { threshold: 0.12, rootMargin: '0px 0px -40px 0px' }); + }, { threshold: 0.1 }); var grids = document.querySelectorAll( '.features-grid, .faq-grid, .pricing-grid, .blog-grid, .biz-wizard .container' ); grids.forEach(function (g) { - g.dataset.section = g.className || 'anon'; - /* Pre-set children to hidden state so they start invisible */ + /* Pre-set children invisible so no flash even before observer fires */ gsap.set(g.children, { y: 30, opacity: 0 }); observer.observe(g); });