From a5892cb4676b33a05849ef6819674ffa496558f7 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 15 Jul 2023 11:57:51 +0800 Subject: [PATCH] =?UTF-8?q?body=E8=83=8C=E6=99=AF=E8=89=B2=20=E6=8F=90?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/_document.js | 2 +- themes/example/style.js | 6 ++-- themes/fukasawa/style.js | 10 ++++--- themes/gitbook/style.js | 5 ++-- themes/heo/components/Header.js | 34 ++++++++++++----------- themes/heo/components/PaginationNumber.js | 8 ++++-- themes/heo/index.js | 19 ++++++------- themes/heo/style.js | 4 +-- themes/hexo/style.js | 7 +++++ themes/matery/style.js | 9 ++++-- themes/medium/style.js | 5 ++-- themes/next/style.js | 10 +++++-- themes/nobelium/style.js | 5 ++-- themes/plog/style.js | 7 ++--- themes/simple/style.js | 5 ++++ 15 files changed, 81 insertions(+), 55 deletions(-) diff --git a/pages/_document.js b/pages/_document.js index c053a632..6b7daa70 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -17,7 +17,7 @@ class MyDocument extends Document { - +
diff --git a/themes/example/style.js b/themes/example/style.js index 7a59e053..0708b7b5 100644 --- a/themes/example/style.js +++ b/themes/example/style.js @@ -6,9 +6,9 @@ */ const Style = () => { return diff --git a/themes/fukasawa/style.js b/themes/fukasawa/style.js index e96d8036..e730d919 100644 --- a/themes/fukasawa/style.js +++ b/themes/fukasawa/style.js @@ -6,11 +6,13 @@ */ const Style = () => { return diff --git a/themes/heo/components/Header.js b/themes/heo/components/Header.js index f654d230..624f8a49 100644 --- a/themes/heo/components/Header.js +++ b/themes/heo/components/Header.js @@ -10,7 +10,7 @@ import throttle from 'lodash.throttle' */ const Header = props => { const [isOpen, changeShow] = useState(false) - const [headerBgShow, setHeaderBgShow] = useState(false) + const [fixedNav, setHeaderBgShow] = useState(false) const [whiteTitle, setWhiteTitle] = useState(false) const toggleMenuOpen = () => { @@ -29,15 +29,15 @@ const Header = props => { const throttleMs = 200 /** - * 根据滚动条,切换导航栏样式 - */ + * 根据滚动条,切换导航栏样式 + */ const scrollTrigger = useCallback(throttle(() => { const scrollS = window.scrollY const header = document.querySelector('#header') const postHeader = document.querySelector('#post-bg') // 导航栏设置 白色背景 - if (header && scrollS > 60) { + if (header && scrollS > 0) { setHeaderBgShow(true) setWhiteTitle(false) } else { @@ -50,21 +50,23 @@ const Header = props => { return (<> {/* 头条 */} - + ) } diff --git a/themes/heo/components/PaginationNumber.js b/themes/heo/components/PaginationNumber.js index 7be7901a..3cb5105f 100644 --- a/themes/heo/components/PaginationNumber.js +++ b/themes/heo/components/PaginationNumber.js @@ -27,10 +27,12 @@ const PaginationNumber = ({ page, totalPage }) => { } /** - * 调到指定页 - */ + * 调到指定页 + */ const jumpToPage = () => { - router.push(value === 1 ? `${pagePrefix}/` : `${pagePrefix}/page/${value}`) + if (value) { + router.push(value === 1 ? `${pagePrefix}/` : `${pagePrefix}/page/${value}`) + } } return ( diff --git a/themes/heo/index.js b/themes/heo/index.js index af648427..8ed171dd 100644 --- a/themes/heo/index.js +++ b/themes/heo/index.js @@ -124,7 +124,14 @@ const LayoutBase = props => { * @returns */ const LayoutIndex = (props) => { - return + // 博客列表上方嵌入一个 通知横幅和英雄块 + const headerSlot = <> + {/* 通知横幅 */} + + + + + return } /** @@ -133,18 +140,10 @@ const LayoutIndex = (props) => { * @returns */ const LayoutPostList = (props) => { - // 博客列表上方嵌入一个 通知横幅和英雄块 - const headerSlot =
- {/* 通知横幅 */} - - -
- // 右侧栏 const slotRight = - return - + return {/* 文章分类条 */} diff --git a/themes/heo/style.js b/themes/heo/style.js index 5b462e3b..b1d0c4e3 100644 --- a/themes/heo/style.js +++ b/themes/heo/style.js @@ -6,8 +6,8 @@ */ const Style = () => { return diff --git a/themes/next/style.js b/themes/next/style.js index 7a59e053..d01b13b3 100644 --- a/themes/next/style.js +++ b/themes/next/style.js @@ -6,9 +6,13 @@ */ const Style = () => { return diff --git a/themes/nobelium/style.js b/themes/nobelium/style.js index 7a59e053..5e8eaa5a 100644 --- a/themes/nobelium/style.js +++ b/themes/nobelium/style.js @@ -7,8 +7,9 @@ const Style = () => { return diff --git a/themes/plog/style.js b/themes/plog/style.js index 7a59e053..23643fa9 100644 --- a/themes/plog/style.js +++ b/themes/plog/style.js @@ -6,11 +6,10 @@ */ const Style = () => { return } diff --git a/themes/simple/style.js b/themes/simple/style.js index 1d8141b9..647a404e 100644 --- a/themes/simple/style.js +++ b/themes/simple/style.js @@ -7,6 +7,11 @@ const Style = () => { return