diff --git a/components/NotionPage.js b/components/NotionPage.js index ead0d0ba..cad7fcf1 100644 --- a/components/NotionPage.js +++ b/components/NotionPage.js @@ -33,6 +33,7 @@ const NotionPage = ({ post }) => { const zoom = isBrowser() && mediumZoom({ container: '.notion-viewport', background: 'rgba(0, 0, 0, 0.2)', + scrollOffset: 200, margin: getMediumZoomMargin() }) @@ -58,15 +59,14 @@ const NotionPage = ({ post }) => { } } + // 相册中的url替换成可点击 const cards = document.getElementsByClassName('notion-collection-card') for (const e of cards) { e.removeAttribute('href') const links = e.querySelectorAll('.notion-link') if (links && links.length > 0) { for (const l of links) { - l.onclick = function() { - window.open('http://' + l.innerText) - } + l.parentElement.innerHTML = `${l.innerText}` } } } @@ -74,7 +74,7 @@ const NotionPage = ({ post }) => { }, 800) addWatch4Dom() - }) + }, []) return