From 055236d941a521ba7201951a59ed8c70169b976f Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 29 Apr 2024 10:08:39 +0800 Subject: [PATCH 1/4] =?UTF-8?q?matery=20=E4=B8=BB=E9=A2=98=E4=B8=80?= =?UTF-8?q?=E9=97=AA=E8=80=8C=E8=BF=87=E7=9A=84title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/matery/components/Hero.js | 6 +++--- themes/matery/components/Logo.js | 13 +++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/themes/matery/components/Hero.js b/themes/matery/components/Hero.js index 35260f9a..65975a0f 100644 --- a/themes/matery/components/Hero.js +++ b/themes/matery/components/Hero.js @@ -9,7 +9,8 @@ import CONFIG from '../config' let wrapperTop = 0 /** - * + * 首页英雄区 + * 是一张大图,带个居中按钮 * @returns 头图 */ const Hero = props => { @@ -17,7 +18,6 @@ const Hero = props => { const { siteInfo } = props const { locale } = useGlobal() const GREETING_WORDS = siteConfig('GREETING_WORDS').split(',') - useEffect(() => { updateHeaderHeight() if (!typed && window && document.getElementById('typed')) { @@ -61,7 +61,7 @@ const Hero = props => {
{/* 站点标题 */}
- {siteConfig('TITLE')} + {siteInfo?.title || siteConfig('TITLE')}
{/* 站点欢迎语 */}
diff --git a/themes/matery/components/Logo.js b/themes/matery/components/Logo.js index 3e6542f4..a1082ae3 100644 --- a/themes/matery/components/Logo.js +++ b/themes/matery/components/Logo.js @@ -1,11 +1,20 @@ import { siteConfig } from '@/lib/config' import Link from 'next/link' - +/** + * 站点logo + * 这里默认只支持纯文字 + * @param {*} props + * @returns + */ const Logo = props => { + const { siteInfo } = props return (
-
{siteConfig('TITLE') }
+
+ {' '} + {siteInfo?.title || siteConfig('TITLE')} +
) From d68a97bc9b2dae3e251aa5c9e838423f68e323b5 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 29 Apr 2024 10:10:09 +0800 Subject: [PATCH 2/4] =?UTF-8?q?hexo=20=E4=B8=BB=E9=A2=98=E4=B8=80=E9=97=AA?= =?UTF-8?q?=E8=80=8C=E8=BF=87=E7=9A=84title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/hexo/components/Hero.js | 2 +- themes/hexo/components/Logo.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/themes/hexo/components/Hero.js b/themes/hexo/components/Hero.js index 67ae3468..91059205 100644 --- a/themes/hexo/components/Hero.js +++ b/themes/hexo/components/Hero.js @@ -66,7 +66,7 @@ const Hero = props => {
{/* 站点标题 */}
- {siteConfig('TITLE')} + {siteInfo?.title || siteConfig('TITLE')}
{/* 站点欢迎语 */}
diff --git a/themes/hexo/components/Logo.js b/themes/hexo/components/Logo.js index 30054acc..2279834c 100644 --- a/themes/hexo/components/Logo.js +++ b/themes/hexo/components/Logo.js @@ -1,11 +1,20 @@ import { siteConfig } from '@/lib/config' import Link from 'next/link' - +/** + * Logo + * 实际值支持文字 + * @param {*} props + * @returns + */ const Logo = props => { + const { siteInfo } = props return (
-
{siteConfig('TITLE') }
+
+ {' '} + {siteInfo?.title || siteConfig('TITLE')} +
) From a81c1426b534f0bb4dd3bcac3558e5fcdb4492ba Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 29 Apr 2024 10:22:19 +0800 Subject: [PATCH 3/4] =?UTF-8?q?hexo=20=E4=B8=BB=E9=A2=98=20=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/hexo/components/MenuItemCollapse.js | 6 +-- themes/hexo/components/MenuItemDrop.js | 10 +++-- themes/hexo/components/MenuListSide.js | 48 +++++++++++++++++----- themes/hexo/components/SideBar.js | 37 +++++++++++------ themes/matery/components/MenuItemDrop.js | 7 +++- themes/matery/components/MenuListTop.js | 43 +++++++++++++++---- 6 files changed, 111 insertions(+), 40 deletions(-) diff --git a/themes/hexo/components/MenuItemCollapse.js b/themes/hexo/components/MenuItemCollapse.js index 828079c7..1782ce52 100644 --- a/themes/hexo/components/MenuItemCollapse.js +++ b/themes/hexo/components/MenuItemCollapse.js @@ -29,13 +29,13 @@ export const MenuItemCollapse = props => { return ( <>
{!hasSubMenu && ( + className=' font-extralight flex justify-between pl-2 pr-4 dark:text-gray-200 no-underline tracking-widest pb-1'> {link?.icon && } {link?.name} @@ -63,7 +63,7 @@ export const MenuItemCollapse = props => { return (
+ className='dark:hover:bg-indigo-500 hover:bg-indigo-500 hover:text-white dark:bg-black dark:text-gray-200 text-left px-10 justify-start bg-gray-50 tracking-widest transition-all duration-200 py-3 pr-6'> {link?.icon && }{' '} diff --git a/themes/hexo/components/MenuItemDrop.js b/themes/hexo/components/MenuItemDrop.js index b74d7a8f..18ea74b6 100644 --- a/themes/hexo/components/MenuItemDrop.js +++ b/themes/hexo/components/MenuItemDrop.js @@ -1,6 +1,10 @@ import Link from 'next/link' import { useState } from 'react' - +/** + * 支持二级展开的菜单 + * @param {*} param0 + * @returns + */ export const MenuItemDrop = ({ link }) => { const [show, changeShow] = useState(false) const hasSubMenu = link?.subMenus?.length > 0 @@ -25,7 +29,7 @@ export const MenuItemDrop = ({ link }) => { {hasSubMenu && ( <> -
+
{link?.icon && } {link?.name} @@ -42,7 +46,7 @@ export const MenuItemDrop = ({ link }) => { return (
  • + className='cursor-pointer hover:bg-indigo-500 hover:text-white tracking-widest transition-all duration-200 dark:border-gray-800 py-1 pr-6 pl-3'> {link?.icon &&   } diff --git a/themes/hexo/components/MenuListSide.js b/themes/hexo/components/MenuListSide.js index 3a146d43..ab0b4278 100644 --- a/themes/hexo/components/MenuListSide.js +++ b/themes/hexo/components/MenuListSide.js @@ -1,17 +1,41 @@ -import { useGlobal } from '@/lib/global' import { siteConfig } from '@/lib/config' -import { MenuItemCollapse } from './MenuItemCollapse' +import { useGlobal } from '@/lib/global' import CONFIG from '../config' - -export const MenuListSide = (props) => { +import { MenuItemCollapse } from './MenuItemCollapse' +/** + * 侧拉抽屉菜单 + * @param {*} props + * @returns + */ +export const MenuListSide = props => { const { customNav, customMenu } = props const { locale } = useGlobal() let links = [ - { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: siteConfig('HEXO_MENU_ARCHIVE', null, CONFIG) }, - { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: siteConfig('HEXO_MENU_SEARCH', null, CONFIG) }, - { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: siteConfig('HEXO_MENU_CATEGORY', null, CONFIG) }, - { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: siteConfig('HEXO_MENU_TAG', null, CONFIG) } + { + icon: 'fas fa-archive', + name: locale.NAV.ARCHIVE, + to: '/archive', + show: siteConfig('HEXO_MENU_ARCHIVE', null, CONFIG) + }, + { + icon: 'fas fa-search', + name: locale.NAV.SEARCH, + to: '/search', + show: siteConfig('HEXO_MENU_SEARCH', null, CONFIG) + }, + { + icon: 'fas fa-folder', + name: locale.COMMON.CATEGORY, + to: '/category', + show: siteConfig('HEXO_MENU_CATEGORY', null, CONFIG) + }, + { + icon: 'fas fa-tag', + name: locale.COMMON.TAGS, + to: '/tag', + show: siteConfig('HEXO_MENU_TAG', null, CONFIG) + } ] if (customNav) { @@ -34,8 +58,10 @@ export const MenuListSide = (props) => { } return ( - + ) } diff --git a/themes/hexo/components/SideBar.js b/themes/hexo/components/SideBar.js index 913ce0a9..64def6ec 100644 --- a/themes/hexo/components/SideBar.js +++ b/themes/hexo/components/SideBar.js @@ -1,5 +1,5 @@ -import { siteConfig } from '@/lib/config' import LazyImage from '@/components/LazyImage' +import { siteConfig } from '@/lib/config' import { useRouter } from 'next/router' import MenuGroupCard from './MenuGroupCard' import { MenuListSide } from './MenuListSide' @@ -11,22 +11,33 @@ import { MenuListSide } from './MenuListSide' * @returns {JSX.Element} * @constructor */ -const SideBar = (props) => { +const SideBar = props => { const { siteInfo } = props const router = useRouter() return ( -
  • + className='cursor-pointer hover:bg-indigo-500 text-gray-900 hover:text-white tracking-widest transition-all duration-200 dark:border-gray-800 py-1 pr-6 pl-3'> {link?.icon &&   } diff --git a/themes/matery/components/MenuListTop.js b/themes/matery/components/MenuListTop.js index 506f9c59..04897f7b 100644 --- a/themes/matery/components/MenuListTop.js +++ b/themes/matery/components/MenuListTop.js @@ -1,17 +1,42 @@ +import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import CONFIG from '../config' import { MenuItemDrop } from './MenuItemDrop' -import { siteConfig } from '@/lib/config' - -export const MenuListTop = (props) => { +/** + * 菜单列表 + * 顶部导航栏用 + * @param {*} props + * @returns + */ +export const MenuListTop = props => { const { customNav, customMenu } = props const { locale } = useGlobal() let links = [ - { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: siteConfig('MATERY_MENU_ARCHIVE', null, CONFIG) }, - { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: siteConfig('MATERY_MENU_SEARCH', null, CONFIG) }, - { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: siteConfig('MATERY_MENU_CATEGORY', null, CONFIG) }, - { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: siteConfig('MATERY_MENU_TAG', null, CONFIG) } + { + icon: 'fas fa-archive', + name: locale.NAV.ARCHIVE, + to: '/archive', + show: siteConfig('MATERY_MENU_ARCHIVE', null, CONFIG) + }, + { + icon: 'fas fa-search', + name: locale.NAV.SEARCH, + to: '/search', + show: siteConfig('MATERY_MENU_SEARCH', null, CONFIG) + }, + { + icon: 'fas fa-folder', + name: locale.COMMON.CATEGORY, + to: '/category', + show: siteConfig('MATERY_MENU_CATEGORY', null, CONFIG) + }, + { + icon: 'fas fa-tag', + name: locale.COMMON.TAGS, + to: '/tag', + show: siteConfig('MATERY_MENU_TAG', null, CONFIG) + } ] if (customNav) { @@ -29,7 +54,9 @@ export const MenuListTop = (props) => { return ( ) } From 4811cb7319d8bf1313b24c934190d464040edd90 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 29 Apr 2024 10:25:49 +0800 Subject: [PATCH 4/4] =?UTF-8?q?matery=20=E8=8F=9C=E5=8D=95=E5=BE=AE?= =?UTF-8?q?=E8=B0=83=EF=BC=9B=E5=8A=A0=E5=85=A5=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/matery/components/MenuItemCollapse.js | 2 +- themes/matery/style.js | 55 +++++++++++++++----- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/themes/matery/components/MenuItemCollapse.js b/themes/matery/components/MenuItemCollapse.js index 6cd373f6..0094fa86 100644 --- a/themes/matery/components/MenuItemCollapse.js +++ b/themes/matery/components/MenuItemCollapse.js @@ -72,7 +72,7 @@ export const MenuItemCollapse = ({ link }) => { return (
    + className='cursor-pointer whitespace-nowrap dark:text-gray-200 w-full font-extralight dark:bg-black text-left px-5 justify-start bg-gray-100 hover:bg-indigo-500 dark:hover:bg-indigo-500 hover:text-white tracking-widest transition-all duration-200 border-b dark:border-gray-800 py-3 pr-6'> diff --git a/themes/matery/style.js b/themes/matery/style.js index 711670c9..32918e92 100644 --- a/themes/matery/style.js +++ b/themes/matery/style.js @@ -5,27 +5,54 @@ * @returns */ const Style = () => { - return + background: linear-gradient( + to bottom, + rgba(0, 0, 0, 0.5) 0%, + rgba(0, 0, 0, 0.2) 10%, + rgba(0, 0, 0, 0) 25%, + rgba(0, 0, 0, 0.2) 75%, + rgba(0, 0, 0, 0.5) 100% + ); + } + + // 自定义滚动条 + ::-webkit-scrollbar { + width: 5px; + height: 5px; + } + + ::-webkit-scrollbar-track { + background: transparent; + } + + ::-webkit-scrollbar-thumb { + background-color: #4338ca; + } + + * { + scrollbar-width: thin; + scrollbar-color: #4338ca transparent; + } + `} + ) } export { Style }