Skip to content

Commit 219eb8f

Browse files
author
Sebastian Flick
committed
goto approach
(need to sort the pages map)
1 parent 4016af0 commit 219eb8f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/routes/fassungen/[thirties]/FassungenContent.svelte

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<script>
22
import { onMount } from 'svelte';
33
import { page } from '$app/stores';
4+
import { goto } from '$app/navigation';
5+
import { base } from '$app/paths';
46
57
/** @type {{pages: any}} */
68
let { pages } = $props();
@@ -15,7 +17,8 @@
1517
(entries) => {
1618
entries.forEach((entry) => {
1719
if (entry.isIntersecting) {
18-
console.log(entry.target);
20+
const direction = entry.boundingClientRect.y < 0 ? -1 : 1;
21+
goto(`${base}/fassungen/${Number($page.data.thirties) + direction}`);
1922
}
2023
});
2124
},

0 commit comments

Comments
 (0)