diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index cd5b665..af46e2c 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -413,18 +413,18 @@ const setup = () => { } }); window.swup.hooks.on('visit:end', (visit: {to: {url: string}}) => { - // execute 1s later setTimeout(() => { const heightExtend = document.getElementById('page-height-extend') if (heightExtend) { heightExtend.classList.add('hidden') } - }, 200) - const toc = document.getElementById('toc-wrapper'); - if (toc) { - toc.classList.remove('toc-not-ready') - } + // Just make the transition looks better + const toc = document.getElementById('toc-wrapper'); + if (toc) { + toc.classList.remove('toc-not-ready') + } + }, 200) }); } if (window?.swup?.hooks) { @@ -447,7 +447,7 @@ function scrollFunction() { } } - if (toc) { + if (bannerEnabled && toc) { if (document.body.scrollTop > bannerHeight || document.documentElement.scrollTop > bannerHeight) { toc.classList.remove('toc-hide') } else { diff --git a/src/layouts/MainGridLayout.astro b/src/layouts/MainGridLayout.astro index 189a9a6..1021712 100644 --- a/src/layouts/MainGridLayout.astro +++ b/src/layouts/MainGridLayout.astro @@ -93,9 +93,11 @@ const mainPanelTop = siteConfig.banner.enable ? `calc(${BANNER_HEIGHT}vh - ${MAI