From 3638d2cd780dd69d13e9600457bd6d061515cc46 Mon Sep 17 00:00:00 2001 From: seaHi Date: Sun, 27 Sep 2026 21:20:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E5=81=8F=E7=A7=BB=E9=87=8F=E5=8F=8A=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E5=AE=9A=E4=BD=8D=E7=9A=84=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/components/admin/ContentEditor.svelte | 2 +- src/lib/components/admin/MarkdownEditor.svelte | 2 +- src/routes/posts/[slug]/+page.svelte | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/components/admin/ContentEditor.svelte b/src/lib/components/admin/ContentEditor.svelte index 4054766..5005354 100644 --- a/src/lib/components/admin/ContentEditor.svelte +++ b/src/lib/components/admin/ContentEditor.svelte @@ -38,7 +38,7 @@ function trackPreview() { if (!preview || navigatingPreview) return; - const top = preview.getBoundingClientRect().top + 24; + const top = preview.getBoundingClientRect().top + 120; let active = -1; previewHeadings.forEach((heading, index) => { if (heading.getBoundingClientRect().top <= top) active = index; diff --git a/src/lib/components/admin/MarkdownEditor.svelte b/src/lib/components/admin/MarkdownEditor.svelte index 4da5367..7eb0368 100644 --- a/src/lib/components/admin/MarkdownEditor.svelte +++ b/src/lib/components/admin/MarkdownEditor.svelte @@ -74,7 +74,7 @@ scrollFrame = 0; if (!view || navigationPending) return; const rect = view.contentDOM.getBoundingClientRect(); - const top = Math.max(toolbar.getBoundingClientRect().bottom + 12, rect.top + 1); + const top = Math.max(toolbar.getBoundingClientRect().bottom + 120, rect.top + 1); if (top >= window.innerHeight || top >= rect.bottom) return; const position = view.posAtCoords({ x: rect.left + 8, y: top }, false); if (position !== null) onPositionChange?.(position); diff --git a/src/routes/posts/[slug]/+page.svelte b/src/routes/posts/[slug]/+page.svelte index 109880d..720b34e 100644 --- a/src/routes/posts/[slug]/+page.svelte +++ b/src/routes/posts/[slug]/+page.svelte @@ -68,7 +68,7 @@ listItemClass: 'toc-list-item', collapseDepth: 0, scrollSmooth: true, - headingsOffset: 20 + headingsOffset: 120 }); if (window.innerWidth < 1200) {