mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 15:09:22 +00:00
feature: Live2D调整 样式
This commit is contained in:
@@ -168,9 +168,8 @@ export default function ArticleDetail ({ post, blockMap, recommendPosts, prev, n
|
||||
</div>
|
||||
|
||||
{/* 宠物 */}
|
||||
<div className='fixed left-0 bottom-0'>
|
||||
<Live2D/>
|
||||
</div>
|
||||
<Live2D/>
|
||||
|
||||
</>)
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ export default function Live2D () {
|
||||
initLive2D()
|
||||
}
|
||||
})
|
||||
return <div className='animate__fadeIn animate__bounceInUp'>
|
||||
return <div className='fixed left-0 bottom-0 hidden md:block lg:ml-24 2xl:ml-36'>
|
||||
<canvas id="live2d" width="280" height="250"></canvas>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -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/";
|
||||
|
||||
@@ -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 }) => {
|
||||
<BlogPostArchive key={archiveTitle} posts={archivePosts[archiveTitle]} archiveTitle={archiveTitle}/>
|
||||
))}
|
||||
</div>
|
||||
<Live2D/>
|
||||
</BaseLayout>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user