From b1ffa283034cd02e27923be7d7cdacb1643a7254 Mon Sep 17 00:00:00 2001
From: Bhwa233 <404174262@qq.com>
Date: Sat, 16 Mar 2024 14:34:03 +0800
Subject: [PATCH 08/16] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=93=8D=E4=BD=9C?=
=?UTF-8?q?=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/AlgoliaSearchModal.js | 28 +++++++++++++++++++++++++++-
components/ShortcutTag.js | 7 +++++++
2 files changed, 34 insertions(+), 1 deletion(-)
create mode 100644 components/ShortcutTag.js
diff --git a/components/AlgoliaSearchModal.js b/components/AlgoliaSearchModal.js
index 5446582645c..49cad8b2d15 100644
--- a/components/AlgoliaSearchModal.js
+++ b/components/AlgoliaSearchModal.js
@@ -1,4 +1,4 @@
-import { useState, useImperativeHandle, useRef, useEffect } from 'react'
+import { useState, useImperativeHandle, useRef, useEffect, Fragment } from 'react'
import algoliasearch from 'algoliasearch'
import replaceSearchResult from '@/components/Mark'
import Link from 'next/link'
@@ -6,6 +6,23 @@ import { useGlobal } from '@/lib/global'
import throttle from 'lodash/throttle'
import { siteConfig } from '@/lib/config'
import { useHotkeys } from 'react-hotkeys-hook';
+import ShortcutTag from '@/components/ShortcutTag'
+
+const ShortCutActions = [
+ {
+ key: '↑ ↓',
+ action: '选择'
+ },
+ {
+ key: 'Enter',
+ action: '跳转'
+ },
+ {
+ key: 'Esc',
+ action: '关闭'
+ }
+
+]
/**
* 结合 Algolia 实现的弹出式搜索框
@@ -234,6 +251,15 @@ export default function AlgoliaSearchModal({ cRef }) {
+ {totalHit === 0 && (
+ {
+ ShortCutActions.map((action, index) => {
+ return
{action.key}
+ {action.action}
+ })
+ }
+
)
+ }
{totalHit > 0 && (
diff --git a/components/ShortcutTag.js b/components/ShortcutTag.js
new file mode 100644
index 00000000000..4e36e8bec05
--- /dev/null
+++ b/components/ShortcutTag.js
@@ -0,0 +1,7 @@
+// 操作提示标签
+import React from 'react';
+
+const ShortcutTag = ({ children, className }) => {
+ return
{children}
+}
+export default ShortcutTag
\ No newline at end of file
From c0acdbff4336cf9c7d8f1cc55228395d86516b76 Mon Sep 17 00:00:00 2001
From: Bhwa233 <404174262@qq.com>
Date: Sat, 16 Mar 2024 14:50:07 +0800
Subject: [PATCH 09/16] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A0=B7=E5=BC=8F?=
=?UTF-8?q?=EF=BC=8C=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/AlgoliaSearchModal.js | 3 +--
components/ShortcutTag.js | 7 -------
2 files changed, 1 insertion(+), 9 deletions(-)
delete mode 100644 components/ShortcutTag.js
diff --git a/components/AlgoliaSearchModal.js b/components/AlgoliaSearchModal.js
index 49cad8b2d15..8fc62d919ee 100644
--- a/components/AlgoliaSearchModal.js
+++ b/components/AlgoliaSearchModal.js
@@ -6,7 +6,6 @@ import { useGlobal } from '@/lib/global'
import throttle from 'lodash/throttle'
import { siteConfig } from '@/lib/config'
import { useHotkeys } from 'react-hotkeys-hook';
-import ShortcutTag from '@/components/ShortcutTag'
const ShortCutActions = [
{
@@ -254,7 +253,7 @@ export default function AlgoliaSearchModal({ cRef }) {
{totalHit === 0 && (
{
ShortCutActions.map((action, index) => {
- return
{action.key}
+ return {action.key}
{action.action}
})
}
diff --git a/components/ShortcutTag.js b/components/ShortcutTag.js
deleted file mode 100644
index 4e36e8bec05..00000000000
--- a/components/ShortcutTag.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// 操作提示标签
-import React from 'react';
-
-const ShortcutTag = ({ children, className }) => {
- return {children}
-}
-export default ShortcutTag
\ No newline at end of file
From a407cd548d5eaff2a32e2ecfd91834f190809384 Mon Sep 17 00:00:00 2001
From: Bhwa233 <404174262@qq.com>
Date: Sat, 16 Mar 2024 15:01:18 +0800
Subject: [PATCH 10/16] =?UTF-8?q?format=20=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/AlgoliaSearchModal.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/AlgoliaSearchModal.js b/components/AlgoliaSearchModal.js
index 8fc62d919ee..ea727a48dbb 100644
--- a/components/AlgoliaSearchModal.js
+++ b/components/AlgoliaSearchModal.js
@@ -253,7 +253,7 @@ export default function AlgoliaSearchModal({ cRef }) {
{totalHit === 0 && (
{
ShortCutActions.map((action, index) => {
- return
{action.key}
+ return {action.key}
{action.action}
})
}
From a8b7f37377327d3ecb69b79df27cfaab9ce8ff4f Mon Sep 17 00:00:00 2001
From: Bhwa233 <404174262@qq.com>
Date: Sat, 16 Mar 2024 16:16:17 +0800
Subject: [PATCH 11/16] =?UTF-8?q?=E4=BF=AE=E5=A4=8DuseMemo=E4=BD=8D?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
themes/fukasawa/components/AsideLeft.js | 34 +++++++++++++------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/themes/fukasawa/components/AsideLeft.js b/themes/fukasawa/components/AsideLeft.js
index 984385cfbee..f6025d0470d 100644
--- a/themes/fukasawa/components/AsideLeft.js
+++ b/themes/fukasawa/components/AsideLeft.js
@@ -45,6 +45,23 @@ function AsideLeft(props) {
}
}, [isCollapsed])
+ const position = useMemo(() => {
+ const isReverse = JSON.parse(siteConfig('LAYOUT_SIDEBAR_REVERSE'))
+ if (isCollapsed) {
+ if (isReverse) {
+ return 'right-2'
+ } else {
+ return 'left-2'
+ }
+ } else {
+ if (isReverse) {
+ return 'right-80'
+ } else {
+ return 'left-80'
+ }
+ }
+ }, [isCollapsed])
+
// 折叠侧边栏
const toggleOpen = () => {
setIsCollapse(!isCollapsed)
@@ -75,22 +92,7 @@ function AsideLeft(props) {
}
}
}, [])
- const position = useMemo(()=>{
- const isReverse = JSON.parse(siteConfig('LAYOUT_SIDEBAR_REVERSE'))
- if(isCollapsed){
- if(isReverse){
- return 'right-2'
- }else{
- return 'left-2'
- }
- }else{
- if(isReverse){
- return 'right-80'
- }else{
- return 'left-80'
- }
- }
- },[isCollapsed] )
+
return
{/* 折叠按钮 */}
From 05059a6b498b3c78f41bbcaa9b53a5d5613688fc Mon Sep 17 00:00:00 2001
From: tangly1024
Date: Sun, 17 Mar 2024 11:18:15 +0800
Subject: [PATCH 12/16] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20theme.js?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
themes/theme.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/themes/theme.js b/themes/theme.js
index 7b50b1ee0f1..794b0303ef5 100644
--- a/themes/theme.js
+++ b/themes/theme.js
@@ -101,9 +101,9 @@ export const initDarkMode = (updateDarkMode,defaultDarkMode) => {
}
// 如果站点强制设置默认深色,则优先级改过用
- if(defaultDarkMode){
- newDarkMode = defaultDarkMode
- }
+ //if(defaultDarkMode){
+ //newDarkMode = defaultDarkMode
+ //}
// url查询条件中是否深色模式
const queryMode = getQueryVariable('mode')
From 1099571e85f288f24a8c86477f5582b7bbd0fe99 Mon Sep 17 00:00:00 2001
From: tangly1024
Date: Sun, 17 Mar 2024 13:50:06 +0800
Subject: [PATCH 13/16] theme movie & dark mode
---
lib/global.js | 2 +-
public/dplayer.htm | 13 +++++++--
themes/movie/index.js | 2 +-
themes/theme.js | 62 ++++++++++++++++++++++++-------------------
4 files changed, 48 insertions(+), 31 deletions(-)
diff --git a/lib/global.js b/lib/global.js
index 57f5e41d0b2..4b24b0d294e 100644
--- a/lib/global.js
+++ b/lib/global.js
@@ -16,7 +16,7 @@ export function GlobalContextProvider(props) {
const [lang, updateLang] = useState(NOTION_CONFIG?.LANG || LANG) // 默认语言
const [locale, updateLocale] = useState(generateLocaleDict(NOTION_CONFIG?.LANG || LANG)) // 默认语言
const [theme, setTheme] = useState(NOTION_CONFIG?.THEME || THEME) // 默认博客主题
- const defaultDarkMode = NOTION_CONFIG?.APPEARANCE || APPEARANCE === 'dark'
+ const defaultDarkMode = NOTION_CONFIG?.APPEARANCE === 'dark' || APPEARANCE === 'dark'
const [isDarkMode, updateDarkMode] = useState(defaultDarkMode) // 默认深色模式
const [onLoading, setOnLoading] = useState(false) // 抓取文章数据
const router = useRouter()
diff --git a/public/dplayer.htm b/public/dplayer.htm
index 67348de4e88..73760fa3380 100644
--- a/public/dplayer.htm
+++ b/public/dplayer.htm
@@ -8,8 +8,17 @@
@@ -25,7 +34,7 @@