fix aos animate

This commit is contained in:
tangly1024.com
2023-02-08 12:19:36 +08:00
parent dbdad58c2d
commit 983504795e
4 changed files with 7 additions and 21 deletions

View File

@@ -32,6 +32,9 @@ import { Sakura } from '@/components/Sakura'
import { StarrySky } from '@/components/StarrySky'
import MusicPlayer from '@/components/MusicPlayer'
import ExternalScript from '@/components/ExternalScript'
import AOS from 'aos'
import { isBrowser } from '@/lib/utils'
import 'aos/dist/aos.css' // You can also use <link> for styles
const Ackee = dynamic(() => import('@/components/Ackee'), { ssr: false })
const Gtag = dynamic(() => import('@/components/Gtag'), { ssr: false })
@@ -72,6 +75,10 @@ const MyApp = ({ Component, pageProps }) => {
// 用户指定CUSTOM_FONT 则取CUSTOM_FONT_URL
const FONTS_URL = BLOG.CUSTOM_FONT ? BLOG.CUSTOM_FONT_URL : DEFAULT_FONTS_URL
if (isBrowser()) {
AOS.init()
}
return (
<GlobalContextProvider>
{/* 渲染所有字体 */}

View File

@@ -11,9 +11,6 @@ import Live2D from '@/components/Live2D'
import LoadingCover from './components/LoadingCover'
import { useGlobal } from '@/lib/global'
import BLOG from '@/blog.config'
import AOS from 'aos'
import 'aos/dist/aos.css' // You can also use <link> for styles
import { isBrowser } from '@/lib/utils'
import dynamic from 'next/dynamic'
const FacebookPage = dynamic(
@@ -61,10 +58,6 @@ const LayoutBase = props => {
return () => document.removeEventListener('scroll', scrollListener)
}, [show])
if (isBrowser()) {
AOS.init()
}
return (
<div className="bg-hexo-background-gray dark:bg-black">
<CommonHead meta={meta} siteInfo={siteInfo}/>

View File

@@ -9,10 +9,7 @@ import Live2D from '@/components/Live2D'
import LoadingCover from './components/LoadingCover'
import { useGlobal } from '@/lib/global'
import BLOG from '@/blog.config'
import AOS from 'aos'
import 'aos/dist/aos.css' // You can also use <link> for styles
import FloatDarkModeButton from './components/FloatDarkModeButton'
import { isBrowser } from '@/lib/utils'
/**
* 基础布局 采用左右两侧布局,移动端使用顶部导航栏
@@ -45,10 +42,6 @@ const LayoutBase = props => {
return () => document.removeEventListener('scroll', scrollListener)
}, [show])
if (isBrowser()) {
AOS.init()
}
return (
<div id="outer-wrapper" className="min-h-screen flex flex-col justify-between bg-hexo-background-gray dark:bg-black w-full">

View File

@@ -14,9 +14,6 @@ import smoothscroll from 'smoothscroll-polyfill'
import CONFIG_NEXT from './config_next'
import Live2D from '@/components/Live2D'
import BLOG from '@/blog.config'
import AOS from 'aos'
import 'aos/dist/aos.css' // You can also use <link> for styles
import { isBrowser } from '@/lib/utils'
/**
* 基础布局 采用左右两侧布局,移动端使用顶部导航栏
@@ -62,10 +59,6 @@ const LayoutBase = (props) => {
return () => document.removeEventListener('scroll', scrollListener)
}, [show])
if (isBrowser()) {
AOS.init()
}
return (<>
<CommonHead meta={meta} />