mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-16 15:09:28 +00:00
@@ -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 }
|
||||
)
|
||||
|
||||
9
components/Gitalk.js
Normal file
9
components/Gitalk.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import 'gitalk/dist/gitalk.css'
|
||||
|
||||
import GitalkComponent from 'gitalk/dist/gitalk-component'
|
||||
|
||||
const Gitalk = props => {
|
||||
return <GitalkComponent {...props} />
|
||||
}
|
||||
|
||||
export default Gitalk
|
||||
@@ -17,7 +17,10 @@ export default function Live2D() {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
initLive2D()
|
||||
window.addEventListener('scroll', initLive2D)
|
||||
return () => {
|
||||
window.removeEventListener('scroll', initLive2D)
|
||||
}
|
||||
}, [])
|
||||
|
||||
return <canvas id="live2d" className='cursor-pointer' width="280" height="250" onClick={handleClick} alt='切换主题' title='切换主题' />
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ module.exports = withBundleAnalyzer({
|
||||
webpack5: true
|
||||
},
|
||||
images: {
|
||||
// 图片压缩
|
||||
formats: ['image/avif', 'image/webp'],
|
||||
// 允许next/image加载的图片 域名
|
||||
domains: [
|
||||
'gravatar.com',
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}")`
|
||||
}}
|
||||
>
|
||||
<div className="absolute flex flex-col h-full items-center justify-center w-full font-sans">
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user