From 4354f3650b3f924ddc5c8592fa1a2c4cc1ed1065 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Tue, 28 Sep 2021 17:36:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=85=20=E6=A0=B7=E5=BC=8F=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E7=BB=9F=E4=B8=80=EF=BC=8C=E5=B8=83=E5=B1=80=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/BlogPost.js | 4 +-- components/BlogPostMini.js | 2 +- components/Comment.js | 4 +-- components/DarkModeButton.js | 8 ++--- components/Footer.js | 10 ------ components/RightAside.js | 60 +++++++++++++++++++++++++++---- components/RightWidget.js | 8 ++--- components/ShareBar.js | 46 ++++++++++++------------ components/ShareButton.js | 8 ++--- components/SideBar.js | 61 ++++++++++++++++++-------------- components/TagItem.js | 2 +- components/{Toc.js => TocBar.js} | 52 +++++++++++++-------------- components/TopJumper.js | 2 +- layouts/ArticleLayout.js | 20 +++++------ layouts/DefaultLayout.js | 20 ++++++----- 15 files changed, 174 insertions(+), 133 deletions(-) rename components/{Toc.js => TocBar.js} (70%) diff --git a/components/BlogPost.js b/components/BlogPost.js index f8cd86be..e66580ed 100644 --- a/components/BlogPost.js +++ b/components/BlogPost.js @@ -4,11 +4,11 @@ import TagItem from '@/components/TagItem' const BlogPost = ({ post }) => { return (
+ className='inline-block border dark:border-gray-600 my-2 shadow-card w-full md:max-w-md bg-white dark:bg-gray-700 dark:hover:bg-gray-600 overflow-hidden'> {/* 封面图 */} {post.page_cover && post.page_cover.length > 1 && ( - {post.title} + {post.title} )} diff --git a/components/BlogPostMini.js b/components/BlogPostMini.js index 9b155ba2..9955c5b8 100644 --- a/components/BlogPostMini.js +++ b/components/BlogPostMini.js @@ -3,7 +3,7 @@ import BLOG from '@/blog.config' const BlogPostMini = ({ post }) => { return ( + className='md:flex w-full border dark:border-gray-500 my-2 duration-200 transform hover:scale-105 hover:shadow-2xl bg-white dark:bg-gray-800 dark:hover:bg-gray-600'> {/* 封面图 */} {post.page_cover && post.page_cover.length > 1 && ( {post.title} diff --git a/components/Comment.js b/components/Comment.js index 421738a7..3bdfa55c 100644 --- a/components/Comment.js +++ b/components/Comment.js @@ -24,8 +24,8 @@ const CusdisComponent = dynamic( const Comment = ({ frontMatter }) => { const router = useRouter() - return
-
留下评论
+ return
+
留下评论
{/* 评论插件 */} {BLOG.comment.provider === 'gitalk' && ( diff --git a/components/DarkModeButton.js b/components/DarkModeButton.js index 27bbd75e..313c50b9 100644 --- a/components/DarkModeButton.js +++ b/components/DarkModeButton.js @@ -8,10 +8,8 @@ const DarkModeButton = () => { changeTheme(newTheme) localStorage.setItem('theme', newTheme) } - return
- -
+ return
+ +
} export default DarkModeButton diff --git a/components/Footer.js b/components/Footer.js index 2e53a3db..e17bc537 100644 --- a/components/Footer.js +++ b/components/Footer.js @@ -10,16 +10,6 @@ const Footer = ({ fullWidth = true }) => {
- - + {/* */} {/* */} {/* */} - - {/* 右侧内容 */} - - + diff --git a/layouts/DefaultLayout.js b/layouts/DefaultLayout.js index 40900e1c..dbe21327 100644 --- a/layouts/DefaultLayout.js +++ b/layouts/DefaultLayout.js @@ -44,12 +44,12 @@ const DefaultLayout = ({ tags, posts, page, currentTag, ...customMeta }) => { showNext = page * BLOG.postsPerPage < totalPosts } - // 首页隐藏看板娘 useEffect(() => { - const ref = document.getElementById('waifu') - if (ref) { - ref.remove() - } + // 首页隐藏看板娘 + // const ref = document.getElementById('waifu') + // if (ref) { + // ref.remove() + // } window.addEventListener('resize', resizeWindowHideToc) resizeWindowHideToc() return () => { @@ -58,7 +58,11 @@ const DefaultLayout = ({ tags, posts, page, currentTag, ...customMeta }) => { }, []) const resizeWindowHideToc = throttle(() => { - if (window.innerWidth > 1300) { + if (window.innerWidth > 2500) { + changeColumn(5) + } else if (window.innerWidth > 1800) { + changeColumn(4) + } else if (window.innerWidth > 1300) { changeColumn(3) } else if (window.innerWidth < 768) { changeColumn(1) @@ -80,7 +84,7 @@ const DefaultLayout = ({ tags, posts, page, currentTag, ...customMeta }) => {
-
+
{(!page || page === 1) && (
) @@ -110,7 +114,7 @@ const DefaultLayout = ({ tags, posts, page, currentTag, ...customMeta }) => { {/* 文章列表 */}
{/*
*/} -
+
{!postsToShow.length && (

No posts found.

)}