back to top correctin are updated

This commit is contained in:
akash 2026-03-16 19:09:12 +05:30
parent 4405fab34d
commit 6bc01cb3df

View File

@ -9,7 +9,7 @@ const BackToTop = () => {
const handleScroll = () => { const handleScroll = () => {
const scroll = window.scrollY; const scroll = window.scrollY;
const height = document.documentElement.scrollHeight - window.innerHeight; const height = document.documentElement.scrollHeight - window.innerHeight;
const progressValue = 307.919 - (scroll * 307.919 / height); const progressValue = height > 0 ? (307.919 - (scroll * 307.919 / height)) : 307.919;
setProgress(progressValue); setProgress(progressValue);