remove smooth scroll and allow gallery image to scroll self

This commit is contained in:
2023-03-10 18:14:16 -08:00
parent f15f8213b2
commit 5760b436d2
4 changed files with 25 additions and 7 deletions

View File

@@ -63,6 +63,12 @@ const GalleryImage = ({ data, location: { state } }) => {
setIsClient(true);
}, []);
useEffect(() => {
requestAnimationFrame(() => {
window.scrollTo(0, 180);
});
}, [image.base]);
const nextIndex =
sortedImageList && currentIndex < sortedImageList.length
? currentIndex + 1

View File

@@ -94,7 +94,7 @@ const GalleryPage = ({
}
navigate(
getGalleryPageUrl({ sortKey, keyword: filterKeyword, showDebug }, ""),
{ replace: true, state: { suppressAutoscroll: true } }
// { replace: false }
);
window.removeEventListener("scroll", removeHash);
},
@@ -126,7 +126,7 @@ const GalleryPage = ({
});
setTimeout(() => {
window.addEventListener("scroll", removeHash);
}, 900)
}, 100)
});
}, [
hash,

View File

@@ -10,7 +10,7 @@
box-sizing: border-box;
}
:root {
scroll-behavior: smooth;
/* scroll-behavior: smooth; */
}
/* .hero * {
transition: color .2s, background-color .2s;