gitbook-jump-to-top

This commit is contained in:
tangly1024
2023-06-28 23:19:21 +08:00
parent 7df33cb62a
commit ed7b235edf
15 changed files with 74 additions and 74 deletions

View File

@@ -13,6 +13,7 @@ import { useRouter } from 'next/router'
import Live2D from '@/components/Live2D'
import BLOG from '@/blog.config'
import Announcement from './components/Announcement'
import JumpToTopButton from './components/JumpToTopButton'
const ThemeGlobalMedium = createContext()
/**
@@ -53,15 +54,7 @@ const LayoutBase = props => {
{onLoading ? LoadingCover : children}
{/* 回顶按钮 */}
<div
data-aos="fade-up"
data-aos-duration="300"
data-aos-once="false"
data-aos-anchor-placement="top-center"
className='fixed xl:right-80 right-2 mr-10 bottom-24 hidden lg:block z-20'>
<i className='fas fa-chevron-up cursor-pointer p-2 rounded-full border' onClick={() => { window.scrollTo({ top: 0, behavior: 'smooth' }) }} />
</div>
<JumpToTopButton />
</div>
{/* 底部 */}
@@ -79,7 +72,7 @@ const LayoutBase = props => {
{CONFIG_MEDIUM.WIDGET_REVOLVER_MAPS === 'true' && <RevolverMaps />}
</div>
</Tabs>
<Announcement post={notice}/>
<Announcement post={notice} />
<Live2D />
</div>
</div>
@@ -93,4 +86,4 @@ const LayoutBase = props => {
}
export default LayoutBase
export const useMediumGlobal = () => useContext(ThemeGlobalMedium)
export const useGitBookGlobal = () => useContext(ThemeGlobalMedium)