Merge pull request #647 from tangly1024/main

tangly1024.com
This commit is contained in:
tangly1024
2022-12-27 10:45:47 +08:00
committed by GitHub
3 changed files with 16 additions and 2 deletions

View File

@@ -44,9 +44,15 @@ const Header = props => {
}
}
/**
* 自动吸附滚动,移动端体验不好暂时关闭
*/
const scrollTrigger = () => {
const scrollS = window.scrollY
if (screen.width <= 768) {
return
}
const scrollS = window.scrollY
// 自动滚动
if ((scrollS > windowTop) & (scrollS < window.innerHeight) && !autoScroll
) {

View File

@@ -43,7 +43,15 @@ const Header = props => {
}
}
/**
* 吸附滚动,移动端关闭
* @returns
*/
const scrollTrigger = () => {
if (screen.width <= 768) {
return
}
const scrollS = window.scrollY
// 自动滚动

View File

@@ -2,7 +2,7 @@ export default function HeaderArticle({ post, siteInfo }) {
const headerImage = post?.page_cover ? post?.page_cover : siteInfo?.pageCover
const title = post?.title
return (
<div id='header' className="flex h-96 justify-center align-middle items-center w-full relative duration-200 bg-black rounded-t-md">
<div id='header' className="flex h-96 justify-center align-middle items-center w-full relative duration-200 bg-black">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={headerImage}