微调样式

This commit is contained in:
tangly1024
2021-10-15 09:15:48 +08:00
parent 85bf342718
commit 14699b63ae
4 changed files with 14 additions and 13 deletions

View File

@@ -1,7 +1,6 @@
import PropTypes from 'prop-types'
import React, { useCallback, useEffect } from 'react'
import CommonHead from '@/components/CommonHead'
import TopNav from '@/components/TopNav'
import throttle from 'lodash.throttle'
import BLOG from '@/blog.config'
import { useTheme } from '@/lib/theme'
@@ -15,14 +14,14 @@ const Container = ({ children, layout, fullWidth, tags, meta, ...customMeta }) =
const tagsBar = document.querySelector('#tags-bar')
const rightToc = document.querySelector('#right-toc')
if (scrollS >= windowTop && scrollS > 10) {
nav && nav.classList.add('-mt-16')
tagsBar && tagsBar.classList.add('-mt-32')
nav && nav.classList.replace('top-0', '-top-16')
tagsBar && tagsBar.classList.replace('top-16', 'top-0')
sidebar && sidebar.classList.replace('top-20', 'top-2')
rightToc && rightToc.classList.replace('top-16', 'top-0')
windowTop = scrollS
} else {
nav && nav.classList.remove('-mt-16')
tagsBar && tagsBar.classList.remove('-mt-32')
nav && nav.classList.replace('-top-16', 'top-0')
tagsBar && tagsBar.classList.replace('top-0', 'top-16')
sidebar && sidebar.classList.replace('top-2', 'top-20')
rightToc && rightToc.classList.replace('top-0', 'top-16')
windowTop = scrollS