HEO添加加载动画

This commit is contained in:
tangly1024.com
2024-08-29 12:43:39 +08:00
parent 7b12ece1b7
commit a6d6127ea7
7 changed files with 90 additions and 26 deletions

View File

@@ -1,8 +0,0 @@
export default function LoadingCover () {
return (<div id="loading-cover" className={'md:-mt-20 flex-grow dark:text-white text-black animate__animated animate__fadeIn flex flex-col justify-center z-50 w-full h-screen container mx-auto'}>
<div className="mx-auto">
<i className="fas fa-spinner animate-spin"/>
</div>
</div>
)
}

View File

@@ -1,5 +1,6 @@
const CONFIG = {
HEO_HOME_POST_TWO_COLS: true, // 首页博客两列显示若为false则只显示一列
HEO_LOADING_COVER: true, // 页面加载的遮罩动画
HEO_HOME_BANNER_ENABLE: true,

View File

@@ -10,6 +10,7 @@ import Comment from '@/components/Comment'
import { AdSlot } from '@/components/GoogleAdsense'
import { HashTag } from '@/components/HeroIcons'
import LazyImage from '@/components/LazyImage'
import LoadingCover from '@/components/LoadingCover'
import replaceSearchResult from '@/components/Mark'
import NotionPage from '@/components/NotionPage'
import ShareBar from '@/components/ShareBar'
@@ -82,6 +83,7 @@ const LayoutBase = props => {
false,
CONFIG
)
const HEO_LOADING_COVER = siteConfig('HEO_LOADING_COVER', true, CONFIG)
// 加载wow动画
useEffect(() => {
@@ -121,6 +123,8 @@ const LayoutBase = props => {
{/* 页脚 */}
<Footer title={siteConfig('TITLE')} />
{HEO_LOADING_COVER && <LoadingCover />}
</div>
)
}