From ccc49abce90aacc6039164055f8a860b846fd908 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 24 Dec 2022 19:26:38 +0800 Subject: [PATCH 01/15] =?UTF-8?q?fix=20=E9=87=8D=E5=A4=8D=E7=9A=84css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/next/LayoutBase.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/next/LayoutBase.js b/themes/next/LayoutBase.js index e178da0f..f9d2580d 100644 --- a/themes/next/LayoutBase.js +++ b/themes/next/LayoutBase.js @@ -79,7 +79,7 @@ const LayoutBase = (props) => { {/* 右下角悬浮 */} -
+
From 2aea439e1321ceebd9d18e9cd5b836c4b50ebb98 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 24 Dec 2022 20:00:21 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E5=8D=87=E7=BA=A7tailwindCSS=203.2.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- tailwind.config.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ad6de107..e7b1d90c 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ }, "devDependencies": { "@waline/client": "^2.5.1", - "autoprefixer": "^10.2.5", + "autoprefixer": "^10.4.13", "eslint": "^7.26.0", "eslint-config-next": "^11.0.0", "eslint-config-standard": "^16.0.2", @@ -67,8 +67,8 @@ "eslint-plugin-promise": "^5.1.0", "eslint-plugin-react": "^7.23.2", "next-sitemap": "^1.6.203", - "postcss": "^8.2.15", - "tailwindcss": "^2.1.2", + "postcss": "^8.4.20", + "tailwindcss": "^3.2.4", "webpack-bundle-analyzer": "^4.5.0" }, "resolutions": { diff --git a/tailwind.config.js b/tailwind.config.js index 5079e173..0c5e4a68 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -2,7 +2,7 @@ const BLOG = require('./blog.config') const { fontFamilies } = require('./lib/font') module.exports = { - purge: ['./pages/**/*.js', './components/**/*.js', './layouts/**/*.js', './themes/**/*.js'], + content: ['./pages/**/*.js', './components/**/*.js', './layouts/**/*.js', './themes/**/*.js'], darkMode: BLOG.APPEARANCE === 'class' ? 'media' : 'class', // or 'media' or 'class' theme: { fontFamily: fontFamilies, From b2351f43197b8ea2422ffc73d03a7ee089813439 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 24 Dec 2022 21:58:24 +0800 Subject: [PATCH 03/15] theme-matery --- components/Live2D.js | 18 +- components/SideBarDrawer.js | 19 +-- themes/hexo/components/BlogPostCard.js | 2 +- themes/hexo/components/Card.js | 2 +- themes/hexo/components/TopNav.js | 2 +- themes/index.js | 5 +- themes/matery/Layout404.js | 32 ++++ themes/matery/LayoutArchive.js | 53 ++++++ themes/matery/LayoutBase.js | 87 ++++++++++ themes/matery/LayoutCategory.js | 15 ++ themes/matery/LayoutCategoryIndex.js | 35 ++++ themes/matery/LayoutIndex.js | 13 ++ themes/matery/LayoutPage.js | 9 + themes/matery/LayoutSearch.js | 99 +++++++++++ themes/matery/LayoutSlug.js | 92 ++++++++++ themes/matery/LayoutTag.js | 26 +++ themes/matery/LayoutTagIndex.js | 28 +++ themes/matery/components/AnalyticsCard.js | 30 ++++ themes/matery/components/ArticleAdjacent.js | 25 +++ themes/matery/components/ArticleCopyright.js | 39 +++++ themes/matery/components/ArticleLock.js | 37 ++++ themes/matery/components/ArticleRecommend.js | 66 ++++++++ themes/matery/components/BlogPostArchive.js | 46 +++++ themes/matery/components/BlogPostCard.js | 93 ++++++++++ themes/matery/components/BlogPostListEmpty.js | 14 ++ themes/matery/components/BlogPostListPage.js | 35 ++++ .../matery/components/BlogPostListScroll.js | 74 ++++++++ themes/matery/components/Card.js | 9 + themes/matery/components/Catalog.js | 91 ++++++++++ themes/matery/components/CategoryGroup.js | 25 +++ themes/matery/components/Collapse.js | 75 +++++++++ .../matery/components/FloatDarkModeButton.js | 30 ++++ themes/matery/components/Footer.js | 37 ++++ themes/matery/components/Header.js | 95 +++++++++++ themes/matery/components/HeaderArticle.js | 69 ++++++++ .../matery/components/HexoRecentComments.js | 43 +++++ themes/matery/components/InfoCard.js | 24 +++ .../matery/components/JumpToCommentButton.js | 29 ++++ themes/matery/components/JumpToTopButton.js | 26 +++ themes/matery/components/LatestPostsGroup.js | 66 ++++++++ themes/matery/components/LoadingCover.js | 8 + themes/matery/components/Logo.js | 13 ++ .../matery/components/MenuButtonGroupTop.js | 38 +++++ themes/matery/components/MenuGroupCard.js | 36 ++++ themes/matery/components/MenuList.js | 44 +++++ themes/matery/components/NavButtonGroup.js | 24 +++ themes/matery/components/PaginationNumber.js | 101 +++++++++++ themes/matery/components/PaginationSimple.js | 57 +++++++ themes/matery/components/Progress.js | 44 +++++ themes/matery/components/SearchDrawer.js | 36 ++++ themes/matery/components/SearchInput.js | 106 ++++++++++++ themes/matery/components/SideBar.js | 61 +++++++ themes/matery/components/SideRight.js | 60 +++++++ themes/matery/components/SocialButton.js | 36 ++++ themes/matery/components/TagGroups.js | 27 +++ themes/matery/components/TagItemMini.js | 12 ++ themes/matery/components/TocDrawer.js | 42 +++++ themes/matery/components/TocDrawerButton.js | 22 +++ themes/matery/components/TopNav.js | 159 ++++++++++++++++++ themes/matery/config_matery.js | 28 +++ themes/matery/index.js | 25 +++ themes/nobelium/LayoutBase.js | 6 +- themes/nobelium/components/Header.js | 128 -------------- themes/nobelium/components/Nav.js | 147 ++++++++++++---- themes/nobelium/config_nobelium.js | 4 +- themes/nobelium/index.js | 4 +- 66 files changed, 2694 insertions(+), 189 deletions(-) create mode 100644 themes/matery/Layout404.js create mode 100644 themes/matery/LayoutArchive.js create mode 100644 themes/matery/LayoutBase.js create mode 100644 themes/matery/LayoutCategory.js create mode 100644 themes/matery/LayoutCategoryIndex.js create mode 100644 themes/matery/LayoutIndex.js create mode 100644 themes/matery/LayoutPage.js create mode 100644 themes/matery/LayoutSearch.js create mode 100644 themes/matery/LayoutSlug.js create mode 100644 themes/matery/LayoutTag.js create mode 100644 themes/matery/LayoutTagIndex.js create mode 100644 themes/matery/components/AnalyticsCard.js create mode 100644 themes/matery/components/ArticleAdjacent.js create mode 100644 themes/matery/components/ArticleCopyright.js create mode 100644 themes/matery/components/ArticleLock.js create mode 100644 themes/matery/components/ArticleRecommend.js create mode 100644 themes/matery/components/BlogPostArchive.js create mode 100644 themes/matery/components/BlogPostCard.js create mode 100644 themes/matery/components/BlogPostListEmpty.js create mode 100644 themes/matery/components/BlogPostListPage.js create mode 100644 themes/matery/components/BlogPostListScroll.js create mode 100644 themes/matery/components/Card.js create mode 100644 themes/matery/components/Catalog.js create mode 100644 themes/matery/components/CategoryGroup.js create mode 100644 themes/matery/components/Collapse.js create mode 100644 themes/matery/components/FloatDarkModeButton.js create mode 100644 themes/matery/components/Footer.js create mode 100644 themes/matery/components/Header.js create mode 100644 themes/matery/components/HeaderArticle.js create mode 100644 themes/matery/components/HexoRecentComments.js create mode 100644 themes/matery/components/InfoCard.js create mode 100644 themes/matery/components/JumpToCommentButton.js create mode 100644 themes/matery/components/JumpToTopButton.js create mode 100644 themes/matery/components/LatestPostsGroup.js create mode 100644 themes/matery/components/LoadingCover.js create mode 100644 themes/matery/components/Logo.js create mode 100644 themes/matery/components/MenuButtonGroupTop.js create mode 100644 themes/matery/components/MenuGroupCard.js create mode 100644 themes/matery/components/MenuList.js create mode 100644 themes/matery/components/NavButtonGroup.js create mode 100644 themes/matery/components/PaginationNumber.js create mode 100644 themes/matery/components/PaginationSimple.js create mode 100644 themes/matery/components/Progress.js create mode 100644 themes/matery/components/SearchDrawer.js create mode 100644 themes/matery/components/SearchInput.js create mode 100644 themes/matery/components/SideBar.js create mode 100644 themes/matery/components/SideRight.js create mode 100644 themes/matery/components/SocialButton.js create mode 100644 themes/matery/components/TagGroups.js create mode 100644 themes/matery/components/TagItemMini.js create mode 100644 themes/matery/components/TocDrawer.js create mode 100644 themes/matery/components/TocDrawerButton.js create mode 100644 themes/matery/components/TopNav.js create mode 100644 themes/matery/config_matery.js create mode 100644 themes/matery/index.js delete mode 100644 themes/nobelium/components/Header.js diff --git a/components/Live2D.js b/components/Live2D.js index 2e2011b6..74522cc2 100644 --- a/components/Live2D.js +++ b/components/Live2D.js @@ -36,14 +36,14 @@ function initLive2D() { window.removeEventListener('scroll', initLive2D) setTimeout(() => { // 加载 waifu.css live2d.min.js waifu-tips.js - if (screen.width >= 768) { - Promise.all([ - // loadExternalResource('https://cdn.zhangxinxu.com/sp/demo/live2d/live2d/js/live2d.js', 'js') - loadExternalResource('https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/live2d.min.js', 'js') - ]).then((e) => { - // https://github.com/xiazeyu/live2d-widget-models - loadlive2d('live2d', BLOG.WIDGET_PET_LINK) - }) - } + // if (screen.width >= 768) { + Promise.all([ + // loadExternalResource('https://cdn.zhangxinxu.com/sp/demo/live2d/live2d/js/live2d.js', 'js') + loadExternalResource('https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/live2d.min.js', 'js') + ]).then((e) => { + // https://github.com/xiazeyu/live2d-widget-models + loadlive2d('live2d', BLOG.WIDGET_PET_LINK) + }) + // } }, 300) } diff --git a/components/SideBarDrawer.js b/components/SideBarDrawer.js index ad988503..dac43d75 100644 --- a/components/SideBarDrawer.js +++ b/components/SideBarDrawer.js @@ -9,10 +9,6 @@ import React from 'react' const SideBarDrawer = ({ children, isOpen, onOpen, onClose, className }) => { const router = useRouter() React.useEffect(() => { - // 页面渲染后删除hidden属性 - // const sideBarWrapperElement = document.getElementById('sidebar-wrapper') - // sideBarWrapperElement?.classList?.remove('hidden') - const sideBarDrawerRouteListener = () => { switchSideDrawerVisible(false) } @@ -25,29 +21,30 @@ const SideBarDrawer = ({ children, isOpen, onOpen, onClose, className }) => { // 点击按钮更改侧边抽屉状态 const switchSideDrawerVisible = (showStatus) => { if (showStatus) { - onOpen() + onOpen && onOpen() } else { - onClose() + onClose && onClose() } const sideBarDrawer = window.document.getElementById('sidebar-drawer') const sideBarDrawerBackground = window.document.getElementById('sidebar-drawer-background') if (showStatus) { - sideBarDrawer.classList.replace('-ml-80', 'ml-0') + sideBarDrawer.classList.replace('-ml-56', 'ml-0') sideBarDrawerBackground.classList.replace('hidden', 'block') } else { - sideBarDrawer.classList.replace('ml-0', '-ml-80') + sideBarDrawer.classList.replace('ml-0', '-ml-56') sideBarDrawerBackground.classList.replace('block', 'hidden') } } - return