From f7258fd2c66c44756e3479ccd7dc85f07d4bbacb Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Wed, 29 May 2024 14:25:58 +0800 Subject: [PATCH] =?UTF-8?q?heo=20=E4=B8=BB=E9=A2=98=20=E4=B8=80=E7=82=B9?= =?UTF-8?q?=E7=82=B9=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/lang/en-US.js | 3 + lib/lang/zh-CN.js | 3 + styles/notion.css | 1 + themes/heo/components/BlogPostCard.js | 4 +- themes/heo/components/CategoryBar.js | 50 +++-- themes/heo/components/Hero.js | 15 +- themes/heo/components/LatestPostsGroupMini.js | 6 +- themes/heo/components/MenuItemCollapse.js | 4 +- themes/heo/components/MenuItemDrop.js | 4 +- themes/heo/components/MenuListSide.js | 2 +- themes/heo/components/NoticeBar.js | 23 +- themes/heo/components/PostHeader.js | 11 +- themes/heo/components/SlideOver.js | 208 ++++++++++-------- themes/heo/components/TagItemMini.js | 9 +- 14 files changed, 205 insertions(+), 138 deletions(-) diff --git a/lib/lang/en-US.js b/lib/lang/en-US.js index 49339220..f60b375a 100644 --- a/lib/lang/en-US.js +++ b/lib/lang/en-US.js @@ -33,6 +33,9 @@ export default { COPYRIGHT: 'Copyright', AUTHOR: 'Author', URL: 'URL', + NOW: 'NOW', + RECOMMEND_BADGES: 'Recommend', + BLOG: 'Blog', POSTS: 'Posts', ARTICLE: 'Article', VISITORS: 'Visitors', diff --git a/lib/lang/zh-CN.js b/lib/lang/zh-CN.js index 827f376f..4dd1962e 100644 --- a/lib/lang/zh-CN.js +++ b/lib/lang/zh-CN.js @@ -35,6 +35,9 @@ export default { AUTHOR: '作者', URL: '链接', ANALYTICS: '统计', + RECOMMEND_BADGES: '荐', + BLOG: '博客', + NOW: '此刻', POSTS: '篇文章', ARTICLE: '文章', VISITORS: '位访客', diff --git a/styles/notion.css b/styles/notion.css index e5f8c14f..ba794f88 100644 --- a/styles/notion.css +++ b/styles/notion.css @@ -1451,6 +1451,7 @@ code[class*='language-'] { .notion-collection-card-property .notion-page-title-text { border-bottom: 0 none; + @apply dark:text-gray-200; } .notion-collection-card-property diff --git a/themes/heo/components/BlogPostCard.js b/themes/heo/components/BlogPostCard.js index 3a1cf689..b26256e4 100644 --- a/themes/heo/components/BlogPostCard.js +++ b/themes/heo/components/BlogPostCard.js @@ -50,11 +50,11 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { {/* 分类 */} {post?.category && ( diff --git a/themes/heo/components/CategoryBar.js b/themes/heo/components/CategoryBar.js index eccd9685..9879d8a7 100644 --- a/themes/heo/components/CategoryBar.js +++ b/themes/heo/components/CategoryBar.js @@ -29,23 +29,40 @@ export default function CategoryBar(props) { } } - return
+
+ + {categoryOptions?.map((c, index) => ( + + ))} +
-
- - {categoryOptions?.map((c, index) => )} -
- -
- - - {locale.MENU.CATEGORY} - +
+ + + {locale.MENU.CATEGORY} + +
+ ) } /** @@ -57,7 +74,10 @@ const MenuItem = ({ href, name }) => { const router = useRouter() const { category } = router.query const selected = category === name - return
- {name} + return ( +
+ {name}
+ ) } diff --git a/themes/heo/components/Hero.js b/themes/heo/components/Hero.js index 656bca55..b43987e6 100644 --- a/themes/heo/components/Hero.js +++ b/themes/heo/components/Hero.js @@ -2,6 +2,7 @@ import { ArrowSmallRight, PlusSmall } from '@/components/HeroIcons' import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' +import { useGlobal } from '@/lib/global' import Link from 'next/link' import { useRouter } from 'next/router' import { useImperativeHandle, useRef, useState } from 'react' @@ -206,6 +207,7 @@ function GroupMenu() { */ function TopGroup(props) { const { latestPosts, allNavPages, siteInfo } = props + const { locale } = useGlobal() const todayCardRef = useRef() function handleMouseLeave() { todayCardRef.current.coverUp() @@ -238,7 +240,7 @@ function TopGroup(props) {
{/* hover 悬浮的 ‘荐’ 字 */}
- 荐 + {locale.COMMON.RECOMMEND_BADGES}
@@ -304,6 +306,7 @@ function getTopPosts({ latestPosts, allNavPages }) { function TodayCard({ cRef, siteInfo }) { const router = useRouter() const link = siteConfig('HEO_HERO_TITLE_LINK', null, CONFIG) + const { locale } = useGlobal() // 卡牌是否盖住下层 const [isCoverUp, setIsCoverUp] = useState(true) @@ -348,7 +351,7 @@ function TodayCard({ cRef, siteInfo }) { isCoverUp ? 'opacity-100 cursor-pointer' : 'opacity-0 transform scale-110 pointer-events-none' - } shadow transition-all duration-200 today-card h-full bg-[#0E57D5] rounded-xl relative overflow-hidden flex items-end`}> + } shadow transition-all duration-200 today-card h-full bg-[#0E57D5] dark:bg-yellow-500 rounded-xl relative overflow-hidden flex items-end`}>
@@ -364,12 +367,14 @@ function TodayCard({ cRef, siteInfo }) { onClick={handleClickMore} className={`'${ isCoverUp ? '' : 'hidden pointer-events-none ' - } flex items-center px-3 h-10 justify-center bg-[#425aef] hover:bg-[#4259efcb] transition-colors duration-100 rounded-3xl`}> + } flex items-center px-3 h-10 justify-center bg-[#425aef] hover:bg-[#4259efcb] dark:bg-yellow-500 dark:hover:bg-yellow-600 transition-colors duration-100 rounded-3xl`}>
- 更多推荐 + {locale.COMMON.MORE}
diff --git a/themes/heo/components/LatestPostsGroupMini.js b/themes/heo/components/LatestPostsGroupMini.js index 7bc65df3..c8f0dcf4 100644 --- a/themes/heo/components/LatestPostsGroupMini.js +++ b/themes/heo/components/LatestPostsGroupMini.js @@ -50,13 +50,13 @@ export default function LatestPostsGroupMini({ latestPosts, siteInfo }) {
{post.title}
-
{post.lastEditedDay}
+
{post.lastEditedDay}
diff --git a/themes/heo/components/MenuItemCollapse.js b/themes/heo/components/MenuItemCollapse.js index f0f9486b..6278cebe 100644 --- a/themes/heo/components/MenuItemCollapse.js +++ b/themes/heo/components/MenuItemCollapse.js @@ -28,7 +28,7 @@ export const MenuItemCollapse = ({ link }) => { return ( <>
{!hasSubMenu && ( { return (
+ className='dark:bg-hexo-black-gray dark:text-gray-200 text-left px-3 justify-start bg-gray-50 hover:bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200 py-3 pr-6'> {link?.icon && }{' '} diff --git a/themes/heo/components/MenuItemDrop.js b/themes/heo/components/MenuItemDrop.js index 2e6929a7..4f8241fc 100644 --- a/themes/heo/components/MenuItemDrop.js +++ b/themes/heo/components/MenuItemDrop.js @@ -36,12 +36,12 @@ export const MenuItemDrop = ({ link }) => { {hasSubMenu && (
    + className={`${show ? 'visible opacity-100 top-14' : 'invisible opacity-0 top-20'} drop-shadow-md overflow-hidden rounded-xl bg-white dark:bg-[#1e1e1e] border dark:border-gray-700 transition-all duration-300 z-20 absolute`}> {link.subMenus.map((sLink, index) => { return (
  • + className='cursor-pointer hover:bg-blue-600 dark:hover:bg-yellow-600 hover:text-white text-gray-900 dark:text-gray-100 tracking-widest transition-all duration-200 dark:border-gray-700 py-1 pr-6 pl-3'> {link?.icon &&   } diff --git a/themes/heo/components/MenuListSide.js b/themes/heo/components/MenuListSide.js index 5716d5b8..50bec3c2 100644 --- a/themes/heo/components/MenuListSide.js +++ b/themes/heo/components/MenuListSide.js @@ -48,7 +48,7 @@ export const MenuListSide = props => { } return ( -