From 7e8703517a9988af225b2dcebb5a4530d46d2ed0 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Tue, 8 Mar 2022 15:25:07 +0800 Subject: [PATCH] =?UTF-8?q?hexo=20=E4=B8=BB=E9=A2=98=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/Hexo/LayoutBase.js | 2 +- themes/Hexo/components/FloatDarkModeButton.js | 2 +- themes/Hexo/components/Footer.js | 7 ++++--- themes/Hexo/components/InfoCard.js | 4 ++-- themes/Hexo/components/JumpToCommentButton.js | 2 +- themes/Hexo/components/JumpToTopButton.js | 6 +++--- .../components/{MenuButtonGroup.js => MenuGroupCard.js} | 4 ++-- themes/Hexo/components/PaginationNumber.js | 2 +- themes/Hexo/components/TocDrawerButton.js | 4 ++-- themes/Hexo/components/TopNav.js | 2 +- 10 files changed, 18 insertions(+), 17 deletions(-) rename themes/Hexo/components/{MenuButtonGroup.js => MenuGroupCard.js} (95%) diff --git a/themes/Hexo/LayoutBase.js b/themes/Hexo/LayoutBase.js index 25163fcd..dd186e06 100644 --- a/themes/Hexo/LayoutBase.js +++ b/themes/Hexo/LayoutBase.js @@ -55,7 +55,7 @@ const LayoutBase = (props) => { {/* 右下角悬浮 */} -
+
{floatSlot} diff --git a/themes/Hexo/components/FloatDarkModeButton.js b/themes/Hexo/components/FloatDarkModeButton.js index f69d58f6..196a7875 100644 --- a/themes/Hexo/components/FloatDarkModeButton.js +++ b/themes/Hexo/components/FloatDarkModeButton.js @@ -21,7 +21,7 @@ export default function FloatDarkModeButton () { return (
diff --git a/themes/Hexo/components/Footer.js b/themes/Hexo/components/Footer.js index 50aacc75..c8612410 100644 --- a/themes/Hexo/components/Footer.js +++ b/themes/Hexo/components/Footer.js @@ -7,14 +7,15 @@ const Footer = ({ title }) => { const startYear = BLOG.SINCE && BLOG.SINCE !== currentYear && BLOG.SINCE + '-' return (
- {`${startYear}${currentYear}`} {BLOG.AUTHOR}. + {`${startYear}${currentYear}`} {BLOG.AUTHOR}.
- Powered by Notion & NotionNext.
+ Powered by Notion & NotionNext.
{BLOG.BEI_AN && <>
{BLOG.BEI_AN}
} +
diff --git a/themes/Hexo/components/InfoCard.js b/themes/Hexo/components/InfoCard.js index 81e7b6ee..6836ad9f 100644 --- a/themes/Hexo/components/InfoCard.js +++ b/themes/Hexo/components/InfoCard.js @@ -3,7 +3,7 @@ import Image from 'next/image' import { useRouter } from 'next/router' import Card from './Card' import SocialButton from './SocialButton' -import MenuButtonGroup from './MenuButtonGroup' +import MenuGroupCard from './MenuGroupCard' export function InfoCard (props) { const router = useRouter() return @@ -23,7 +23,7 @@ export function InfoCard (props) { />
{BLOG.TITLE}
- + } diff --git a/themes/Hexo/components/JumpToCommentButton.js b/themes/Hexo/components/JumpToCommentButton.js index a793c3c7..736468d4 100644 --- a/themes/Hexo/components/JumpToCommentButton.js +++ b/themes/Hexo/components/JumpToCommentButton.js @@ -17,7 +17,7 @@ const JumpToCommentButton = () => { } } - return (
+ return (
) } diff --git a/themes/Hexo/components/JumpToTopButton.js b/themes/Hexo/components/JumpToTopButton.js index 25a186d7..de1bce3d 100644 --- a/themes/Hexo/components/JumpToTopButton.js +++ b/themes/Hexo/components/JumpToTopButton.js @@ -15,9 +15,9 @@ const JumpToTopButton = ({ showPercent = true, percent }) => { return <> } const { locale } = useGlobal() - return (
window.scrollTo({ top: 0, behavior: 'smooth' })} > - {!showPercent &&
} - {showPercent && (
{percent}
)} + return (
window.scrollTo({ top: 0, behavior: 'smooth' })} > +
+ {showPercent && (
{percent}
)}
) } diff --git a/themes/Hexo/components/MenuButtonGroup.js b/themes/Hexo/components/MenuGroupCard.js similarity index 95% rename from themes/Hexo/components/MenuButtonGroup.js rename to themes/Hexo/components/MenuGroupCard.js index e0e6946c..0ff25e37 100644 --- a/themes/Hexo/components/MenuButtonGroup.js +++ b/themes/Hexo/components/MenuGroupCard.js @@ -3,7 +3,7 @@ import Link from 'next/link' import { useGlobal } from '@/lib/global' import CONFIG_HEXO from '../config_hexo' -const MenuButtonGroup = (props) => { +const MenuGroupCard = (props) => { const { postCount, categories, tags } = props const { locale } = useGlobal() const archiveSlot =
{postCount}
@@ -33,4 +33,4 @@ const MenuButtonGroup = (props) => { })} } -export default MenuButtonGroup +export default MenuGroupCard diff --git a/themes/Hexo/components/PaginationNumber.js b/themes/Hexo/components/PaginationNumber.js index 7224e078..56942531 100644 --- a/themes/Hexo/components/PaginationNumber.js +++ b/themes/Hexo/components/PaginationNumber.js @@ -48,7 +48,7 @@ const PaginationNumber = ({ page, totalPage }) => { function getPageElement (page, currentPage) { return - {page} diff --git a/themes/Hexo/components/TocDrawerButton.js b/themes/Hexo/components/TocDrawerButton.js index 4554ca8c..a4bba1a4 100644 --- a/themes/Hexo/components/TocDrawerButton.js +++ b/themes/Hexo/components/TocDrawerButton.js @@ -14,8 +14,8 @@ const TocDrawerButton = (props) => { return <> } const { locale } = useGlobal() - return (
- + return (
+
) } diff --git a/themes/Hexo/components/TopNav.js b/themes/Hexo/components/TopNav.js index 8936325a..b2b73433 100644 --- a/themes/Hexo/components/TopNav.js +++ b/themes/Hexo/components/TopNav.js @@ -27,7 +27,7 @@ const TopNav = (props) => { const scrollS = window.scrollY const nav = document.querySelector('#sticky-nav') const header = document.querySelector('#header') - const showNav = (scrollS > 10 && scrollS < windowTop) || (header && scrollS < 5) // 非首页无大图时影藏顶部 滚动条置顶时隐藏 + const showNav = (scrollS > 0 && scrollS < windowTop) || (header && scrollS < 5) // 非首页无大图时影藏顶部 滚动条置顶时隐藏 if (!showNav) { nav && nav.classList.replace('top-0', '-top-20')