From 5b322c2d3d9041a404d7564b6b690ffac786a427 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Tue, 28 Dec 2021 15:02:23 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20Live2D=E8=B0=83=E6=95=B4=20=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ArticleDetail.js | 5 ++--- components/Live2D.js | 2 +- components/Live2DWaifu.js | 6 +++--- pages/archive/index.js | 2 ++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/components/ArticleDetail.js b/components/ArticleDetail.js index b3c2604c..afb057a7 100644 --- a/components/ArticleDetail.js +++ b/components/ArticleDetail.js @@ -168,9 +168,8 @@ export default function ArticleDetail ({ post, blockMap, recommendPosts, prev, n {/* 宠物 */} -
- -
+ + ) } diff --git a/components/Live2D.js b/components/Live2D.js index 4c61cc31..2b700aaf 100644 --- a/components/Live2D.js +++ b/components/Live2D.js @@ -7,7 +7,7 @@ export default function Live2D () { initLive2D() } }) - return
+ return
} diff --git a/components/Live2DWaifu.js b/components/Live2DWaifu.js index 559e8efe..e79029ad 100644 --- a/components/Live2DWaifu.js +++ b/components/Live2DWaifu.js @@ -1,10 +1,10 @@ import Head from 'next/head' import { useEffect } from 'react' -export default function Live2D () { +export default function Live2DWife () { useEffect(() => { if (window) { - initLive2D() + initLive2DWife() } }) return <> @@ -12,7 +12,7 @@ export default function Live2D () { } -function initLive2D () { +function initLive2DWife () { // 注意:live2d_path 参数应使用绝对路径 const live2dPath = 'https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/' // const live2d_path = "/live2d-widget/"; diff --git a/pages/archive/index.js b/pages/archive/index.js index fb223d96..1d4c1550 100644 --- a/pages/archive/index.js +++ b/pages/archive/index.js @@ -5,6 +5,7 @@ import { getNotionPageData } from '@/lib/notion/getNotionData' import React, { useEffect } from 'react' import { useGlobal } from '@/lib/global' import BlogPostArchive from '@/components/BlogPostArchive' +import Live2D from '@/components/Live2D' export async function getStaticProps () { const from = 'index' @@ -74,6 +75,7 @@ const Index = ({ allPosts, tags, categories }) => { ))}
+ ) }