import BLOG from 'blog.config'
import React from 'react'
import dynamic from 'next/dynamic'
import 'animate.css'
import '@/styles/globals.css'
// core styles shared by all of react-notion-x (required)
import 'react-notion-x/src/styles.css'
import '@/styles/notion.css' // 重写部分样式
import { GlobalContextProvider } from '@/lib/global'
import { DebugPanel } from '@/components/DebugPanel'
import { ThemeSwitch } from '@/components/ThemeSwitch'
import { Fireworks } from '@/components/Fireworks'
import { Nest } from '@/components/Nest'
import { FlutteringRibbon } from '@/components/FlutteringRibbon'
import { Ribbon } from '@/components/Ribbon'
import { Sakura } from '@/components/Sakura'
import { StarrySky } from '@/components/StarrySky'
import MusicPlayer from '@/components/MusicPlayer'
import ExternalScript from '@/components/ExternalScript'
import { isBrowser } from '@/lib/utils'
import AOS from 'aos'
import 'aos/dist/aos.css' // You can also use for styles
const Ackee = dynamic(() => import('@/components/Ackee'), { ssr: false })
const Gtag = dynamic(() => import('@/components/Gtag'), { ssr: false })
const Busuanzi = dynamic(() => import('@/components/Busuanzi'), { ssr: false })
const GoogleAdsense = dynamic(() => import('@/components/GoogleAdsense'), {
ssr: false
})
const Messenger = dynamic(() => import('@/components/FacebookMessenger'), {
ssr: false
})
const MyApp = ({ Component, pageProps }) => {
// 外部插件
const externalPlugins = <>
{JSON.parse(BLOG.THEME_SWITCH) && }
{JSON.parse(BLOG.DEBUG) && }
{BLOG.ANALYTICS_ACKEE_TRACKER && }
{BLOG.ANALYTICS_GOOGLE_ID && }
{JSON.parse(BLOG.ANALYTICS_BUSUANZI_ENABLE) && }
{BLOG.ADSENSE_GOOGLE_ID && }
{BLOG.FACEBOOK_APP_ID && BLOG.FACEBOOK_PAGE_ID && }
{JSON.parse(BLOG.FIREWORKS) && }
{JSON.parse(BLOG.SAKURA) && }
{JSON.parse(BLOG.STARRY_SKY) && }
{JSON.parse(BLOG.MUSIC_PLAYER) && }
{JSON.parse(BLOG.NEST) && }
{JSON.parse(BLOG.FLUTTERINGRIBBON) && }
{JSON.parse(BLOG.RIBBON) && }
>
if (isBrowser()) {
AOS.init()
}
return (
{externalPlugins}
)
}
export default MyApp