diff --git a/components/NotionPage.js b/components/NotionPage.js index 352dfbea..fe75ff7b 100644 --- a/components/NotionPage.js +++ b/components/NotionPage.js @@ -31,29 +31,30 @@ const NotionPage = ({ post }) => { background: 'rgba(0, 0, 0, 0.2)', margin: getMediumZoomMargin() }) + const zoomRef = React.useRef(zoom ? zoom.clone() : null) setTimeout(() => { - if (typeof document === 'undefined') { - return - } - const buttons = document.getElementsByClassName('notion-code-copy') - for (const e of buttons) { - e.addEventListener('click', fixCopy) - } - // 将所有container下的所有图片添加medium-zoom - const container = document?.getElementById('container') - const imgList = container?.getElementsByTagName('img') - if (imgList && zoomRef.current) { - for (let i = 0; i < imgList.length; i++) { - (zoomRef.current).attach(imgList[i]) + if (typeof document !== 'undefined') { + const buttons = document.getElementsByClassName('notion-code-copy') + for (const e of buttons) { + e.addEventListener('click', fixCopy) + } + // 将相册gallery下的图片加入放大功能 + // const container = document?.getElementById('container') + const imgList = document?.querySelectorAll('.notion-collection-card-cover img') + if (imgList && zoomRef.current) { + for (let i = 0; i < imgList.length; i++) { + (zoomRef.current).attach(imgList[i]) + } + } + + const cards = document.getElementsByClassName('notion-collection-card') + for (const e of cards) { + e.removeAttribute('href') } } - const cards = document.getElementsByClassName('notion-collection-card') - for (const e of cards) { - e.removeAttribute('href') - } - }, 500) + }, 800) /** * 复制代码后,会重复 @see https://github.com/tangly1024/NotionNext/issues/165 diff --git a/styles/globals.css b/styles/globals.css index 0ab1b7be..feb5f75e 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -151,6 +151,6 @@ nav { position: fixed; left: 0; top: 0; - z-index: 50; + z-index: 1000; pointer-events: none; } diff --git a/themes/hexo/LayoutBase.js b/themes/hexo/LayoutBase.js index 56a975e0..c8ca3f8a 100644 --- a/themes/hexo/LayoutBase.js +++ b/themes/hexo/LayoutBase.js @@ -59,10 +59,10 @@ const LayoutBase = props => { {headerSlot} -
+
{onLoading ? : children} diff --git a/themes/hexo/components/MenuList.js b/themes/hexo/components/MenuList.js index c8103624..3f16a2ff 100644 --- a/themes/hexo/components/MenuList.js +++ b/themes/hexo/components/MenuList.js @@ -21,7 +21,7 @@ const MenuList = (props) => { links = links.concat(customNav) } - return