From ea148835f60c3d704afefba6cac4806915e82531 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 13 May 2022 14:21:43 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=A4=A7=E5=9B=BE?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/hexo/components/Header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/hexo/components/Header.js b/themes/hexo/components/Header.js index c1e4e71f..9430c1db 100644 --- a/themes/hexo/components/Header.js +++ b/themes/hexo/components/Header.js @@ -103,7 +103,7 @@ const Header = props => { className="duration-500 md:bg-fixed w-full bg-cover bg-center h-screen bg-black text-white" style={{ backgroundImage: - `linear-gradient(rgba(0, 0, 0, 0.8), rgba(0,0,0,0.2), rgba(0, 0, 0, 0.8) ),url("${siteInfo?.pageCover}")` + `linear-gradient(rgba(0, 0, 0, 0.8), rgba(0,0,0,0.2), rgba(0,0,0,0.2), rgba(0,0,0,0.2), rgba(0, 0, 0, 0.8) ),url("${siteInfo?.pageCover}")` }} >
From d9d7839e7d525937bc3471385fbf1eb513caf8a6 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 13 May 2022 15:31:41 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=BB=B6=E8=BF=9F=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=8C=82=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Live2D.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/Live2D.js b/components/Live2D.js index e91a3806..c763349a 100644 --- a/components/Live2D.js +++ b/components/Live2D.js @@ -17,7 +17,10 @@ export default function Live2D() { } useEffect(() => { - initLive2D() + window.addEventListener('scroll', initLive2D) + return () => { + window.removeEventListener('scroll', initLive2D) + } }, []) return @@ -27,6 +30,7 @@ export default function Live2D() { * 加载宠物 */ function initLive2D() { + window.removeEventListener('scroll', initLive2D) setTimeout(() => { // 加载 waifu.css live2d.min.js waifu-tips.js if (screen.width >= 768) { @@ -38,5 +42,5 @@ function initLive2D() { loadlive2d('live2d', BLOG.WIDGET_PET_LINK) }) } - }, 1000) + }, 300) } From ef1ea5edc76b29e7c418f6fb5b5d098fea13d732 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 13 May 2022 15:45:16 +0800 Subject: [PATCH 3/5] =?UTF-8?q?next=20=E5=9B=BE=E7=89=87=E5=8E=8B=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- next.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/next.config.js b/next.config.js index f3bd40ae..7c8627f1 100644 --- a/next.config.js +++ b/next.config.js @@ -6,6 +6,8 @@ module.exports = withBundleAnalyzer({ webpack5: true }, images: { + // 图片压缩 + formats: ['image/avif', 'image/webp'], // 允许next/image加载的图片 域名 domains: [ 'gravatar.com', From 4afffe649381775f25193cab37f9b57a0ac93762 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 13 May 2022 15:56:23 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=86=97=E4=BD=99=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/article/[slug].js | 2 +- themes/hexo/Layout404.js | 2 +- themes/next/Layout404.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/article/[slug].js b/pages/article/[slug].js index 40fe2ef2..52a2082d 100644 --- a/pages/article/[slug].js +++ b/pages/article/[slug].js @@ -25,7 +25,7 @@ const Slug = props => { const article = document.getElementById('container') if (!article) { router.push('/404').then(() => { - console.warn('找不到页面', router.asPath) + // console.warn('找不到页面', router.asPath) }) } } diff --git a/themes/hexo/Layout404.js b/themes/hexo/Layout404.js index f64e8016..4ed0ebea 100644 --- a/themes/hexo/Layout404.js +++ b/themes/hexo/Layout404.js @@ -11,7 +11,7 @@ export const Layout404 = props => { const article = typeof document !== 'undefined' && document.getElementById('container') if (!article) { router.push('/').then(() => { - console.log('找不到页面', router.asPath) + // console.log('找不到页面', router.asPath) }) } } diff --git a/themes/next/Layout404.js b/themes/next/Layout404.js index 530d2c53..a9d18559 100644 --- a/themes/next/Layout404.js +++ b/themes/next/Layout404.js @@ -11,7 +11,7 @@ export const Layout404 = props => { const article = typeof document !== 'undefined' && document.getElementById('container') if (!article) { router.push('/').then(() => { - console.log('找不到页面', router.asPath) + // console.log('找不到页面', router.asPath) }) } } From 145f16e97d7e3174f5b35423f75016716a5b8260 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 13 May 2022 15:56:46 +0800 Subject: [PATCH 5/5] =?UTF-8?q?Gitalk=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Comment.js | 3 +-- components/Gitalk.js | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 components/Gitalk.js diff --git a/components/Comment.js b/components/Comment.js index 45bb554f..915b96ee 100644 --- a/components/Comment.js +++ b/components/Comment.js @@ -1,14 +1,13 @@ import BLOG from '@/blog.config' import dynamic from 'next/dynamic' import { useRouter } from 'next/router' -import 'gitalk/dist/gitalk.css' import Tabs from '@/components/Tabs' import { ReactCusdis } from 'react-cusdis' import { useGlobal } from '@/lib/global' const GitalkComponent = dynamic( () => { - return import('gitalk/dist/gitalk-component') + return import('@/components/Gitalk') }, { ssr: false } ) diff --git a/components/Gitalk.js b/components/Gitalk.js new file mode 100644 index 00000000..2edc44bd --- /dev/null +++ b/components/Gitalk.js @@ -0,0 +1,9 @@ +import 'gitalk/dist/gitalk.css' + +import GitalkComponent from 'gitalk/dist/gitalk-component' + +const Gitalk = props => { + return +} + +export default Gitalk