mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-02 23:16:51 +00:00
hexo 动画优化、支持图片卡牌配置
This commit is contained in:
@@ -43,10 +43,10 @@ const Header = props => {
|
||||
})
|
||||
|
||||
function updateHeaderHeight () {
|
||||
setTimeout(() => {
|
||||
requestAnimationFrame(() => {
|
||||
const wrapperElement = document.getElementById('wrapper')
|
||||
wrapperTop = wrapperElement?.offsetTop
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -103,12 +103,12 @@ const scrollTrigger = () => {
|
||||
) {
|
||||
autoScroll = true
|
||||
window.scrollTo({ top: wrapperTop, behavior: 'smooth' })
|
||||
setTimeout(autoScrollEnd, 500)
|
||||
requestAnimationFrame(autoScrollEnd)
|
||||
}
|
||||
if ((scrollS < windowTop) && (scrollS < window.innerHeight) && !autoScroll) {
|
||||
autoScroll = true
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||
setTimeout(autoScrollEnd, 500)
|
||||
requestAnimationFrame(autoScrollEnd)
|
||||
}
|
||||
windowTop = scrollS
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user