+
{Object.keys(categories).map(category => {
const selected = currentCategory === category
return
diff --git a/components/DarkModeButton.js b/components/DarkModeButton.js
index 1bb7d086..c4df5e3c 100644
--- a/components/DarkModeButton.js
+++ b/components/DarkModeButton.js
@@ -11,8 +11,8 @@ const DarkModeButton = () => {
saveTheme(newTheme)
changeTheme(newTheme)
}
- return
-
+
}
diff --git a/components/FloatDarkModeButton.js b/components/FloatDarkModeButton.js
index b36b404b..06ed046d 100644
--- a/components/FloatDarkModeButton.js
+++ b/components/FloatDarkModeButton.js
@@ -6,7 +6,8 @@ export default function FloatDarkModeButton () {
const [show, switchShow] = useState(false)
const scrollListener = () => {
const scrollY = window.pageYOffset
- const shouldShow = scrollY > 100 && scrollY < windowTop
+ // const shouldShow = scrollY > 100 && scrollY < windowTop
+ const shouldShow = scrollY > 100
windowTop = scrollY
if (shouldShow !== show) {
switchShow(shouldShow)
diff --git a/components/JumpToTopButton.js b/components/JumpToTopButton.js
index b8ee6e9e..2d708f27 100644
--- a/components/JumpToTopButton.js
+++ b/components/JumpToTopButton.js
@@ -25,7 +25,8 @@ const JumpToTopButton = ({ targetRef, showPercent = true }) => {
const fullHeight = clientHeight - window.outerHeight
let per = parseFloat(((scrollY / fullHeight * 100)).toFixed(0))
if (per > 100) per = 100
- const shouldShow = scrollY > 100 && per > 0 && scrollY < windowTop
+ // const shouldShow = scrollY > 100 && per > 0 && scrollY < windowTop
+ const shouldShow = scrollY > 100 && per > 0
windowTop = scrollY
if (shouldShow !== show) {
@@ -39,11 +40,11 @@ const JumpToTopButton = ({ targetRef, showPercent = true }) => {
return () => document.removeEventListener('scroll', scrollListener)
}, [show])
- return (
+ return (
window.scrollTo({ top: 0, behavior: 'smooth' })}
- className={(show ? '' : 'hidden') + ' animate__fadeInRight animate__animated animate__faster shadow-card rounded-full glassmorphism p-2 cursor-pointer '}>
+ className={(show ? '' : 'hidden') + ' animate__fadeInRight animate__animated animate__faster shadow-card rounded-full glassmorphism py-1 cursor-pointer '}>
-
-
+
+
{showPercent && (
{post && (
- {percent}
)}
diff --git a/components/SideArea.js b/components/SideArea.js
index f01f4368..98728f09 100644
--- a/components/SideArea.js
+++ b/components/SideArea.js
@@ -86,8 +86,8 @@ const SideArea = ({ title, tags, currentTag, post, posts, categories, currentCat
+
+
diff --git a/components/SideAreaDrawer.js b/components/SideAreaDrawer.js
deleted file mode 100644
index 2855ceb8..00000000
--- a/components/SideAreaDrawer.js
+++ /dev/null
@@ -1,45 +0,0 @@
-import React, { useImperativeHandle, useState } from 'react'
-import SideArea from './SideArea'
-
-/**
- * 侧边栏抽屉面板,可以从侧面拉出
- * @returns {JSX.Element}
- * @constructor
- */
-const SideAreaDrawer = ({ post, currentTag, cRef, tags, posts, categories, currentCategory }) => {
- // 暴露给父组件 通过cRef.current.handleMenuClick 调用
- useImperativeHandle(cRef, () => {
- return {
- handleSwitchSideDrawerVisible: () => switchSideDrawerVisible()
- }
- })
- const [isShow, changeHiddenStatus] = useState(false)
- // 点击按钮更改侧边抽屉状态
- const switchSideDrawerVisible = () => {
- const showStatus = !isShow
- changeHiddenStatus(showStatus)
- if (window) {
- const sideBarDrawer = window.document.getElementById('sidebar-drawer')
- const sideBarDrawerBackground = window.document.getElementById('sidebar-drawer-background')
-
- if (showStatus) {
- sideBarDrawer.classList.replace('-ml-72', 'ml-2')
- sideBarDrawerBackground.classList.replace('hidden', 'block')
- } else {
- sideBarDrawer.classList.replace('ml-2', '-ml-72')
- sideBarDrawerBackground.classList.replace('block', 'hidden')
- }
- }
- }
- return <>
-
- {/* 背景蒙版 */}
-
-
- >
-}
-export default SideAreaDrawer
diff --git a/components/SideBar.js b/components/SideBar.js
index cd1797ba..2c322052 100644
--- a/components/SideBar.js
+++ b/components/SideBar.js
@@ -25,7 +25,7 @@ import { faAngleDoubleRight, faArchive, faTags, faThList } from '@fortawesome/fr
*/
const SideBar = ({ title, tags, currentTag, post, posts, categories, currentCategory, currentSearch }) => {
const { locale } = useGlobal()
- return
{post && (
-
{locale.COMMON.TABLE_OF_CONTENTS}
{locale.COMMON.TABLE_OF_CONTENTS}
diff --git a/components/SideBarDrawer.js b/components/SideBarDrawer.js
index 30e96a6a..e500ec77 100644
--- a/components/SideBarDrawer.js
+++ b/components/SideBarDrawer.js
@@ -23,16 +23,16 @@ const SideBarDrawer = ({ post, currentTag, cRef, tags, posts, categories, curren
const sideBarDrawerBackground = window.document.getElementById('sidebar-drawer-background')
if (showStatus) {
- sideBarDrawer.classList.replace('-ml-72', 'ml-0')
+ sideBarDrawer.classList.replace('-ml-80', 'ml-0')
sideBarDrawerBackground.classList.replace('hidden', 'block')
} else {
- sideBarDrawer.classList.replace('ml-0', '-ml-72')
+ sideBarDrawer.classList.replace('ml-0', '-ml-80')
sideBarDrawerBackground.classList.replace('block', 'hidden')
}
}
}
return <>
-