From 648c410953fef7711c08699b1cae486bd3bbbbdc Mon Sep 17 00:00:00 2001 From: Mustafa Date: Fri, 31 Jul 2026 00:05:18 +0300 Subject: [PATCH] fix: getBoundingClientRect() for reliable scroll progress --- components/sections/CloudRevealSection.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/sections/CloudRevealSection.tsx b/components/sections/CloudRevealSection.tsx index 9c47325..e641ef7 100644 --- a/components/sections/CloudRevealSection.tsx +++ b/components/sections/CloudRevealSection.tsx @@ -81,8 +81,9 @@ export default function CloudRevealSection() { let rafId: number const loop = () => { + const rect = section.getBoundingClientRect() const totalHeight = section.offsetHeight - window.innerHeight - const scrolled = window.scrollY - section.offsetTop + const scrolled = -rect.top const progress = Math.max(0, Math.min(1, scrolled / totalHeight)) const targetIdx = Math.min(