MailChimp

This commit is contained in:
tangly1024.com
2023-07-04 12:39:18 +08:00
parent 26f6b2d85f
commit 194cd7ac7d
57 changed files with 361 additions and 235 deletions

View File

@@ -7,7 +7,7 @@ export const Layout404 = props => {
useEffect(() => {
// 延时3秒如果加载失败就返回首页
setTimeout(() => {
const article = typeof document !== 'undefined' && document.getElementById('container')
const article = typeof document !== 'undefined' && document.getElementById('notion-article')
if (!article) {
router.push('/').then(() => {
// console.log('找不到页面', router.asPath)

View File

@@ -26,7 +26,7 @@ export const LayoutSlug = props => {
></LayoutBase>
}
const targetRef = isBrowser() ? document.getElementById('container') : null
const targetRef = isBrowser() ? document.getElementById('article-wrapper') : null
const floatSlot = <>
{post?.toc?.length > 1 && <div className="block lg:hidden">
@@ -50,11 +50,11 @@ export const LayoutSlug = props => {
<div className="w-full lg:hover:shadow lg:border rounded-t-xl lg:rounded-xl lg:px-2 lg:py-4 bg-white dark:bg-hexo-black-gray dark:border-black article">
{lock && <ArticleLock validPassword={validPassword} />}
{!lock && <div id="container" className="overflow-x-auto flex-grow mx-auto md:w-full md:px-5 ">
{!lock && <div id="article-wrapper" className="overflow-x-auto flex-grow mx-auto md:w-full md:px-5 ">
<article itemScope itemType="https://schema.org/Movie" className="subpixel-antialiased overflow-y-hidden" >
{/* Notion文章主体 */}
<section id='notion-article' className='px-5 justify-center mx-auto max-w-2xl lg:max-w-full'>
<section className='px-5 justify-center mx-auto max-w-2xl lg:max-w-full'>
{post && <NotionPage post={post} />}
</section>

View File

@@ -10,7 +10,7 @@ const Progress = ({ targetRef, showPercent = true }) => {
const currentRef = targetRef?.current || targetRef
const [percent, changePercent] = useState(0)
const scrollListener = () => {
const target = currentRef || (isBrowser() && document.getElementById('container'))
const target = currentRef || (isBrowser() && document.getElementById('article-wrapper'))
if (target) {
const clientHeight = target.clientHeight
const scrollY = window.pageYOffset