medium 回顶按钮微调

This commit is contained in:
tangly1024.com
2023-02-09 16:34:32 +08:00
parent 2aefbfb58d
commit ca26dae20f
3 changed files with 4 additions and 3 deletions

View File

@@ -41,13 +41,15 @@ const LayoutBase = props => {
<div className='px-7 max-w-5xl justify-center mx-auto min-h-screen'>
{slotTop}
{children}
{/* 回顶按钮 */}
<div
data-aos="fade-up"
data-aos-duration="300"
data-aos-easing="ease-in-out"
data-aos-once="false"
data-aos-anchor-placement="top-center"
className='fixed right-96 bottom-24 hidden lg:block z-20'>
className='fixed xl:right-80 right-2 mr-6 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>
</div>

View File

@@ -67,7 +67,7 @@ export const LayoutSlug = props => {
</section>
{/* Notion文章主体 */}
<section id="notion-article" className="px-1 max-w-5xl">
<section id="notion-article" className="px-1 max-w-4xl">
{post && (<NotionPage post={post} />)}
</section>

View File

@@ -28,7 +28,6 @@ const Catalog = ({ toc }) => {
const throttleMs = 100
const actionSectionScrollSpy = React.useCallback(throttle(() => {
console.log('滚动')
const sections = document.getElementsByClassName('notion-h')
let prevBBox = null
let currentSectionId = activeSection