mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-23 07:26:47 +00:00
fix/animation lagging
This commit is contained in:
@@ -100,7 +100,7 @@ const BlogPostCard = ({ post, showSummary, siteInfo }) => {
|
||||
alt={post.title}
|
||||
className="h-full w-full hover:scale-125 transform object-cover duration-500"
|
||||
/>
|
||||
{/* <Image className='hover:scale-125 transform duration-500' src={post?.page_cover} alt={post.title} layout='fill' objectFit='cover' loading='lazy' /> */}
|
||||
{/* <Image className='hover:scale-125 transform duration-500' src={post?.page_cover} style={{ objectFit: 'cover' }} alt={post.title} fill loading='lazy' /> */}
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -23,18 +23,11 @@ const LayoutBase = props => {
|
||||
|
||||
const scrollListener = () => {
|
||||
requestAnimationFrame(() => {
|
||||
// const targetRef = document.getElementById('wrapper')
|
||||
// const clientHeight = targetRef?.clientHeight
|
||||
const scrollY = window.pageYOffset
|
||||
// const fullHeight = clientHeight - window.outerHeight
|
||||
// let per = parseFloat(((scrollY / fullHeight) * 100).toFixed(0))
|
||||
// if (per > 100) per = 100
|
||||
const shouldShow = scrollY > 300
|
||||
console.log(scrollY)
|
||||
if (shouldShow !== show) {
|
||||
switchShow(shouldShow)
|
||||
}
|
||||
// changePercent(per)
|
||||
})
|
||||
}
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user