Merge pull request #2699 from tangly1024/feat/gitbook-loading-cover

gitbook 主题添加loadingcover
This commit is contained in:
tangly1024
2024-09-04 16:58:34 +08:00
committed by GitHub
3 changed files with 9 additions and 8 deletions

View File

@@ -12,7 +12,7 @@ export default function BottomMenuBar({ post, className }) {
return (
<>
{/* 移动端底部导航按钮 */}
<div className='bottom-button-group md:hidden w-screen h-14 px-4 fixed flex items-center justify-between right-left bottom-0 z-30 bg-white border-t dark:border-gray-800'>
<div className='dark:bg-hexo-black-gray bottom-button-group md:hidden w-screen h-14 px-4 fixed flex items-center justify-between right-left bottom-0 z-30 bg-white border-t dark:border-gray-800'>
<div className='w-full'>
<MobileButtonPageNav />
</div>

View File

@@ -1,7 +0,0 @@
export default function LoadingCover() {
return <div id='cover-loading' className={'z-50 opacity-50pointer-events-none transition-all duration-300'}>
<div className='w-full h-screen flex justify-center items-center'>
<i className="fa-solid fa-spinner text-2xl text-black dark:text-white animate-spin"> </i>
</div>
</div>
}

View File

@@ -3,6 +3,7 @@
import Comment from '@/components/Comment'
import { AdSlot } from '@/components/GoogleAdsense'
import Live2D from '@/components/Live2D'
import LoadingCover from '@/components/LoadingCover'
import NotionIcon from '@/components/NotionIcon'
import NotionPage from '@/components/NotionPage'
import ShareBar from '@/components/ShareBar'
@@ -113,6 +114,11 @@ const LayoutBase = props => {
setFilteredNavPages(getNavPagesWithLatest(allNavPages, latestPosts, post))
}, [router])
const GITBOOK_LOADING_COVER = siteConfig(
'GITBOOK_LOADING_COVER',
true,
CONFIG
)
return (
<ThemeGlobalGitbook.Provider
value={{
@@ -237,6 +243,8 @@ const LayoutBase = props => {
)}
</main>
{GITBOOK_LOADING_COVER && <LoadingCover />}
{/* 移动端导航抽屉 */}
<PageNavDrawer {...props} filteredNavPages={filteredNavPages} />