{
const headerSlot = CONFIG_HEXO.HOME_BANNER_ENABLE &&
return
-
{BLOG.POST_LIST_STYLE === 'page' ? : }
}
diff --git a/themes/hexo/components/Announcement.js b/themes/hexo/components/Announcement.js
index 18cb3f8a..391fd3a8 100644
--- a/themes/hexo/components/Announcement.js
+++ b/themes/hexo/components/Announcement.js
@@ -6,12 +6,7 @@ const NotionPage = dynamic(() => import('@/components/NotionPage'))
const Announcement = ({ post, className }) => {
const { locale } = useGlobal()
if (post?.blockMap) {
- return
+ return
{locale.COMMON.ANNOUNCEMENT}
{post && (
diff --git a/themes/hexo/components/BlogPostCard.js b/themes/hexo/components/BlogPostCard.js
index 895a77ec..02940295 100644
--- a/themes/hexo/components/BlogPostCard.js
+++ b/themes/hexo/components/BlogPostCard.js
@@ -4,6 +4,7 @@ import React from 'react'
import TagItemMini from './TagItemMini'
import CONFIG_HEXO from '../config_hexo'
import NotionPage from '@/components/NotionPage'
+import Image from 'next/image'
const BlogPostCard = ({ post, showSummary, siteInfo }) => {
const showPreview = CONFIG_HEXO.POST_LIST_PREVIEW && post.blockMap
@@ -15,6 +16,7 @@ const BlogPostCard = ({ post, showSummary, siteInfo }) => {
{
{showPageCover && !showPreview && post?.page_cover && (
-
+
-
)
}
@@ -104,12 +109,12 @@ const scrollTrigger = () => {
) {
autoScroll = true
window.scrollTo({ top: wrapperTop, behavior: 'smooth' })
- requestAnimationFrame(autoScrollEnd)
+ autoScrollEnd()
}
if ((scrollS < windowTop) && (scrollS < window.innerHeight) && !autoScroll) {
autoScroll = true
window.scrollTo({ top: 0, behavior: 'smooth' })
- requestAnimationFrame(autoScrollEnd)
+ autoScrollEnd()
}
windowTop = scrollS
})
diff --git a/themes/hexo/components/LatestPostsGroup.js b/themes/hexo/components/LatestPostsGroup.js
index 9e799aa9..009e91cb 100644
--- a/themes/hexo/components/LatestPostsGroup.js
+++ b/themes/hexo/components/LatestPostsGroup.js
@@ -1,5 +1,6 @@
import BLOG from '@/blog.config'
import { useGlobal } from '@/lib/global'
+import Image from 'next/image'
import Link from 'next/link'
import { useRouter } from 'next/router'
@@ -19,46 +20,51 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
}
return <>
-
{/* eslint-disable-next-line @next/next/no-img-element */}
-
- {/* */}
+ className="w-full cursor-pointer object-cover duration-200 hover:scale-125 "
+ /> */}
+
)}
diff --git a/themes/hexo/components/Header.js b/themes/hexo/components/Header.js
index 7f38552e..d6fff722 100644
--- a/themes/hexo/components/Header.js
+++ b/themes/hexo/components/Header.js
@@ -1,3 +1,4 @@
+import Image from 'next/image'
import { useEffect, useState } from 'react'
import Typed from 'typed.js'
import CONFIG_HEXO from '../config_hexo'
@@ -45,7 +46,7 @@ const Header = props => {
}
})
- function updateHeaderHeight () {
+ function updateHeaderHeight() {
requestAnimationFrame(() => {
const wrapperElement = document.getElementById('wrapper')
wrapperTop = wrapperElement?.offsetTop
@@ -53,32 +54,36 @@ const Header = props => {
}
return (
-
+
+
-
+ }
+ }
-
+
+
+ {siteInfo?.title}
-
-
-
+
+
+
- {/* 首页导航插件 */}
- { CONFIG_HEXO.HOME_NAV_BUTTONS &&
+
+ {/* 首页导航插件 */}
+ {CONFIG_HEXO.HOME_NAV_BUTTONS && {siteInfo?.title}
+
+
+
- { window.scrollTo({ top: wrapperTop, behavior: 'smooth' }) }}
- className="cursor-pointer w-full text-center py-4 text-3xl absolute bottom-10 text-white"
- >
-
-
- { window.scrollTo({ top: wrapperTop, behavior: 'smooth' }) }}
+ className="cursor-pointer w-full text-center py-4 text-3xl absolute bottom-10 text-white"
+ >
+
+
+
-
- {latestPosts.map(post => {
- const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
- const headerImage = post?.page_cover
- ? `url("${post.page_cover}")`
- : `url("${siteInfo?.pageCover}")`
-
- return (
- (
-
-
-
-
- {locale.COMMON.LATEST_POSTS}
-
-
+
+
+ {latestPosts.map(post => {
+ const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
- )
- )
- })}
- >
+ const headerImage = post?.page_cover ? post.page_cover : siteInfo?.pageCover
+
+ return (
+ (
+
+
-
- {post.title}
- {post.lastEditedTime}
+
+ {locale.COMMON.LATEST_POSTS}
+
+
+
+
+
+ )
+ )
+ })}
+ >
}
export default LatestPostsGroup
diff --git a/themes/hexo/components/TopNav.js b/themes/hexo/components/TopNav.js
index 374f59ce..d3fe3f1b 100644
--- a/themes/hexo/components/TopNav.js
+++ b/themes/hexo/components/TopNav.js
@@ -61,7 +61,7 @@ const TopNav = props => {
nav && nav.classList.replace('transparent', 'dark:bg-hexo-black-gray')
}
- const showNav = scrollS <= windowTop || scrollS < 5 || (header && scrollS <= header.clientHeight)// 非首页无大图时影藏顶部 滚动条置顶时隐藏
+ const showNav = scrollS <= windowTop || scrollS < 5 || (header && scrollS <= header.clientHeight * 2)// 非首页无大图时影藏顶部 滚动条置顶时隐藏
if (!showNav) {
nav && nav.classList.replace('top-0', '-top-20')
windowTop = scrollS
diff --git a/themes/matery/LayoutBase.js b/themes/matery/LayoutBase.js
index 4a1bbc51..9fcd9849 100644
--- a/themes/matery/LayoutBase.js
+++ b/themes/matery/LayoutBase.js
@@ -23,18 +23,11 @@ const LayoutBase = props => {
const scrollListener = () => {
requestAnimationFrame(() => {
- // const targetRef = document.getElementById('wrapper')
- // const clientHeight = targetRef?.clientHeight
const scrollY = window.pageYOffset
- // const fullHeight = clientHeight - window.outerHeight
- // let per = parseFloat(((scrollY / fullHeight) * 100).toFixed(0))
- // if (per > 100) per = 100
const shouldShow = scrollY > 300
- console.log(scrollY)
if (shouldShow !== show) {
switchShow(shouldShow)
}
- // changePercent(per)
})
}
useEffect(() => {
diff --git a/themes/matery/components/BlogPostCard.js b/themes/matery/components/BlogPostCard.js
index b809c723..e7da2f17 100644
--- a/themes/matery/components/BlogPostCard.js
+++ b/themes/matery/components/BlogPostCard.js
@@ -3,6 +3,7 @@ import Link from 'next/link'
import React from 'react'
import TagItemMini from './TagItemMini'
import CONFIG_MATERY from '../config_matery'
+import Image from 'next/image'
const BlogPostCard = ({ post, showSummary, siteInfo }) => {
const showPreview = CONFIG_MATERY.POST_LIST_PREVIEW && post.blockMap
@@ -14,7 +15,7 @@ const BlogPostCard = ({ post, showSummary, siteInfo }) => {
return (
+
+ {post.title}
+ {post.lastEditedTime}
+
@@ -27,11 +28,22 @@ const BlogPostCard = ({ post, showSummary, siteInfo }) => {
-
+
+
)
}
diff --git a/themes/matery/components/HeaderArticle.js b/themes/matery/components/HeaderArticle.js
index 6d8229c3..62317d06 100644
--- a/themes/matery/components/HeaderArticle.js
+++ b/themes/matery/components/HeaderArticle.js
@@ -1,3 +1,5 @@
+import Image from 'next/image'
+
export default function HeaderArticle({ post, siteInfo }) {
const headerImage = post?.page_cover ? post?.page_cover : siteInfo?.pageCover
const title = post?.title
@@ -9,11 +11,16 @@ export default function HeaderArticle({ post, siteInfo }) {
data-aos-anchor-placement="top-center"
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 */}
-
+ /> */}
+
{title}
)
diff --git a/themes/matery/components/TopNav.js b/themes/matery/components/TopNav.js
index 47b485a8..73086b76 100644
--- a/themes/matery/components/TopNav.js
+++ b/themes/matery/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 <= windowTop || scrollS < 5 // 非首页无大图时影藏顶部 滚动条置顶时隐藏
+ const showNav = scrollS <= windowTop || scrollS < 5 || (header && scrollS <= header.clientHeight * 2)// 非首页无大图时影藏顶部 滚动条置顶时隐藏// 非首页无大图时影藏顶部 滚动条置顶时隐藏
// 是否将导航栏透明
const navTransparent = header && scrollS < 300 // 透明导航条的条件
diff --git a/themes/next/components/ShareBar.js b/themes/next/components/ShareBar.js
index 2f174b13..c595da13 100644
--- a/themes/next/components/ShareBar.js
+++ b/themes/next/components/ShareBar.js
@@ -8,17 +8,17 @@ import { useGlobal } from '@/lib/global'
import CONFIG_NEXT from '../config_next'
const ShareBar = ({ post }) => {
+ const router = useRouter()
+ const [qrCodeShow, setQrCodeShow] = React.useState(false)
+ const { locale } = useGlobal()
if (!CONFIG_NEXT.ARTICLE_SHARE) {
return <>>
}
- const router = useRouter()
const shareUrl = BLOG.LINK + router.asPath
// 二维码悬浮
- const [qrCodeShow, setQrCodeShow] = React.useState(false)
const btnRef = React.createRef()
const popoverRef = React.createRef()
- const { locale } = useGlobal()
const openPopover = () => {
createPopper(btnRef.current, popoverRef.current, {
@@ -57,7 +57,7 @@ const ShareBar = ({ post }) => {
{/* eslint-disable-next-line @next/next/no-img-element */}
-
+ /> */}
+
diff --git a/themes/matery/components/Header.js b/themes/matery/components/Header.js
index 5ad30675..b24ff85d 100644
--- a/themes/matery/components/Header.js
+++ b/themes/matery/components/Header.js
@@ -1,3 +1,4 @@
+import Image from 'next/image'
import { useEffect, useState } from 'react'
import Typed from 'typed.js'
import CONFIG_MATERY from '../config_matery'
@@ -49,9 +50,9 @@ const Header = props => {
}
/**
- * 吸附滚动,移动端关闭
- * @returns
- */
+ * 吸附滚动,移动端关闭
+ * @returns
+ */
const scrollTrigger = () => {
requestAnimationFrame(() => {
if (screen.width <= 768) {
@@ -76,7 +77,7 @@ const Header = props => {
})
}
- function updateHeaderHeight () {
+ function updateHeaderHeight() {
requestAnimationFrame(() => {
const wrapperElement = document.getElementById('wrapper')
wrapperTop = wrapperElement?.offsetTop
@@ -84,26 +85,30 @@ const Header = props => {
}
return (
-
+
+
{post.title}
-
+ {siteInfo?.title}
-
-
-
- { window.scrollTo({ top: wrapperTop, behavior: 'smooth' }) }}
- className="mt-12 border cursor-pointer w-40 text-center pt-4 pb-3 text-md text-white hover:bg-orange-600 duration-300 rounded-3xl">
- 开始阅读
-
-
+
+
-
+
+
+ {siteInfo?.title}
+
+
+
+ { window.scrollTo({ top: wrapperTop, behavior: 'smooth' }) }}
+ className="mt-12 border cursor-pointer w-40 text-center pt-4 pb-3 text-md text-white hover:bg-orange-600 duration-300 rounded-3xl">
+ 开始阅读
+
+