From 0e55d8e9d3f5d48f7410d821608d9368d2029ef2 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Thu, 11 Nov 2021 10:55:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=82=AC=E6=B5=AE=E6=8C=89=E9=92=AE=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/JumpToTopButton.js | 9 ++++----- components/TocDrawerButton.js | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/components/JumpToTopButton.js b/components/JumpToTopButton.js index 4a949db0..69349846 100644 --- a/components/JumpToTopButton.js +++ b/components/JumpToTopButton.js @@ -22,7 +22,6 @@ const JumpToTopButton = ({ targetRef, showPercent = true }) => { if (per > 100) per = 100 const shouldShow = scrollY > 100 && per > 0 - if (shouldShow !== show) { switchShow(shouldShow) } @@ -34,15 +33,15 @@ const JumpToTopButton = ({ targetRef, showPercent = true }) => { }, [show]) return ( -
+
window.scrollTo({ top: 0, behavior: 'smooth' })} style={{ boxShadow: 'rgba(41, 50, 60, 0.5) 0px 2px 16px', borderRadius: '28px' }} - className={(show ? 'animate__fadeInUp' : 'animate__fadeOutUp') + ' bg-gray-700 px-1 py-1 cursor-pointer animate__animated animate__faster shadow-2xl'}> + className={(show ? 'animate__fadeInUp' : 'animate__fadeOutUp') + ' bg-white dark:bg-gray-700 px-1 py-1 cursor-pointer animate__animated animate__faster shadow-2xl'}>
-
- {showPercent && (
{percent}
)} +
+ {showPercent && (
{percent}
)}
diff --git a/components/TocDrawerButton.js b/components/TocDrawerButton.js index 39f9f98e..7a60d58a 100644 --- a/components/TocDrawerButton.js +++ b/components/TocDrawerButton.js @@ -10,11 +10,11 @@ import React from 'react' */ const TocDrawerButton = (props) => { return ( -
+
-
+ className={'animate__fadeInUp bg-white dark:bg-gray-700 px-1 py-1 cursor-pointer animate__animated animate__faster shadow-xl'}> +
目录