From ea7db4fa478e83c8561ca5aa75a50c18de3d5939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=B7=E5=8D=8E=20=E5=88=98?= Date: Wed, 29 Nov 2023 18:46:17 +0000 Subject: [PATCH 1/2] fix: add ids to headings in the pricing page --- src/routes/pricing/+page.svelte | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/pricing/+page.svelte b/src/routes/pricing/+page.svelte index c87cea06a7..9f5a84ff17 100644 --- a/src/routes/pricing/+page.svelte +++ b/src/routes/pricing/+page.svelte @@ -64,7 +64,7 @@ >
-

Starter

+

Starter

@@ -112,7 +112,7 @@ >
-

Pro

+

Pro

@@ -159,7 +159,7 @@ >
-

Scale

+

Scale

@@ -205,7 +205,7 @@ style="background:rgba(35, 35, 37, 0.90);" >
-

+

Enterprises

Coming Soon
@@ -228,7 +228,7 @@ style="background:rgba(35, 35, 37, 0.90);" >
-

+

Open-source teams

From 6eddfcc55b4b5f297bef4c74fdbf5a718f0d1e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=B7=E5=8D=8E=20=E5=88=98?= Date: Wed, 29 Nov 2023 21:12:10 +0000 Subject: [PATCH 2/2] fix: capture initial scroll position on anchor links --- src/lib/utils/scroll.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lib/utils/scroll.ts b/src/lib/utils/scroll.ts index d9c30160b3..b3e392a408 100644 --- a/src/lib/utils/scroll.ts +++ b/src/lib/utils/scroll.ts @@ -18,6 +18,20 @@ export const createScrollInfo = () => { let lastDirChange = 0; onMount(() => { + const handleInitialAnchor = () => { + if (window.location.hash) { + const anchorElement = document.querySelector(window.location.hash); + if (anchorElement) { + return window.pageYOffset + anchorElement.getBoundingClientRect().top; + } + } + return 0; + }; + + const initialTop = handleInitialAnchor(); + scrollInfo.set({ direction: 'down', top: initialTop, deltaDirChange: 0 }); + lastDirChange = initialTop; + const handleScroll = () => { scrollInfo.update((p) => { const top = window.scrollY;