From 00343cd77b78de11e5f36ed847a514596ba23ef6 Mon Sep 17 00:00:00 2001 From: tlyong1992 Date: Wed, 8 Jun 2022 11:12:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8D=A1=E7=89=87URL=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/NotionPage.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/NotionPage.js b/components/NotionPage.js index ead0d0ba..7c25f2dc 100644 --- a/components/NotionPage.js +++ b/components/NotionPage.js @@ -58,15 +58,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 +73,7 @@ const NotionPage = ({ post }) => { }, 800) addWatch4Dom() - }) + }, []) return
Date: Wed, 8 Jun 2022 12:54:12 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=85=A7=E7=89=87?= =?UTF-8?q?=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- styles/globals.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/styles/globals.css b/styles/globals.css index af6c3ac6..e5eda977 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -156,10 +156,6 @@ nav { pointer-events: none; } -.medium-zoom-image--opened{ - /* width: auto !important; */ -} - [data-waline] p { color: var(--waline-color); @apply dark:text-gray-200 !important From 81ff604c0daded0fc7b9f022c027ca9768247dd0 Mon Sep 17 00:00:00 2001 From: tlyong1992 Date: Wed, 8 Jun 2022 12:57:12 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=85=A7=E7=89=87?= =?UTF-8?q?=E9=9B=86=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/NotionPage.js | 1 + styles/notion.css | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/components/NotionPage.js b/components/NotionPage.js index 7c25f2dc..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() }) diff --git a/styles/notion.css b/styles/notion.css index a43bfcc1..a6361d76 100644 --- a/styles/notion.css +++ b/styles/notion.css @@ -207,6 +207,20 @@ .medium-zoom-image--opened { z-index: 301; + /* width: auto !important; */ +} + +@media (max-width: 768px){ + .medium-zoom-image--opened { + object-fit: fill !important; + height: auto !important; + } +} + +@media (min-width: 768px){ + .medium-zoom-image--opened { + object-fit: scale-down !important; + } } .notion-frame {