From f03ecc83ea81b1379675541c0b225185e1d563de Mon Sep 17 00:00:00 2001 From: Lucas Tavares Date: Fri, 22 Nov 2024 17:03:05 -0300 Subject: [PATCH] fix --- src/pages/supercentro/components/chapters.js | 4 ++-- src/pages/supercentro/story.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/supercentro/components/chapters.js b/src/pages/supercentro/components/chapters.js index 2f961bb7..a897f386 100644 --- a/src/pages/supercentro/components/chapters.js +++ b/src/pages/supercentro/components/chapters.js @@ -39,10 +39,10 @@ export function useScrollArrow() { setShowArrow(false); clearTimeout(scrollTimeoutRef.current); const sectionTop = sectionRef.current.offsetTop; - const sectionHeight = sectionRef.current.offsetHeight; + const sectionHeight = sectionRef.current.scrollHeight; const scrollPosition = window.scrollY + window.innerHeight; scrollTimeoutRef.current = setTimeout(() => { - if (scrollPosition > sectionTop && scrollPosition < sectionTop + sectionHeight) { + if (scrollPosition < sectionTop + sectionHeight) { setShowArrow(true); } }, 1000); diff --git a/src/pages/supercentro/story.js b/src/pages/supercentro/story.js index 4edb3e82..b5554879 100644 --- a/src/pages/supercentro/story.js +++ b/src/pages/supercentro/story.js @@ -78,8 +78,9 @@ export default function SuperCentro() { type="video/mp4" style={{ position: "sticky", - top: "50%", - transform: "translateY(-50%)", + top: "0", + // top: "50%", + // transform: "translateY(-50%)", maxHeight: "100vh", margin: "0 auto", display: "block",