From b2351f43197b8ea2422ffc73d03a7ee089813439 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 24 Dec 2022 21:58:24 +0800 Subject: [PATCH] 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