File tree 3 files changed +18
-27
lines changed
3 files changed +18
-27
lines changed Original file line number Diff line number Diff line change 63
63
"prettier-plugin-svelte" : " ^3.2.7" ,
64
64
"svelte" : " ^4.2.19" ,
65
65
"svelte-check" : " ^4.0.5" ,
66
- "svelte-scrollto " : " 0.2 .0" ,
66
+ "svelte-scrolling " : " ^1.4 .0" ,
67
67
"tslib" : " ^2.7.0" ,
68
68
"typescript" : " ~5.6.3" ,
69
69
"typescript-eslint" : " ^8.8.1" ,
Original file line number Diff line number Diff line change @@ -7,17 +7,16 @@ import goGameImage from '$lib/assets/gogame.webp';
7
7
import shogiImage from ' $lib/assets/shogi.webp' ;
8
8
import tictactoeImage from ' $lib/assets/tic-tac-toe.webp' ;
9
9
10
- import { scrollTo } from ' svelte-scrollto' ;
10
+ import { scrollRef , scrollTo } from ' svelte-scrolling' ;
11
+ import type { ScrollToOptions } from ' svelte-scrolling/dist/types/options' ;
11
12
12
13
let footerHeight: number ;
13
14
14
- const scrollToAbout = (): void => {
15
- scrollTo ({
16
- element: ' #about' ,
17
- offset: - 64 ,
18
- duration: 1500
19
- });
20
- };
15
+ const scrollToAbout = {
16
+ ref: ' about' ,
17
+ offset: 0 ,
18
+ duration: 1500
19
+ } satisfies ScrollToOptions ;
21
20
</script >
22
21
23
22
<svelte:head >
@@ -33,12 +32,12 @@ const scrollToAbout = (): void => {
33
32
<LogoTitleRowWhite
34
33
styles =" width: 100%; max-width: var(--contents-width-text); margin: 0 10px 20vh 10px; z-index: 1;"
35
34
/>
36
- <a data-sveltekit-noscroll href ="/#about" on:click ={scrollToAbout } class =" btn_03" >
35
+ <a data-sveltekit-noscroll href ="/#about" use:scrollTo ={scrollToAbout } class =" btn_03" >
37
36
<span >Start</span >
38
37
</a >
39
38
</header >
40
39
41
- <section id =" about" >
40
+ <section id ="about" use:scrollRef ={ ' about ' } >
42
41
<h1 class =" section-title" >About</h1 >
43
42
<p >
44
43
Quantum Game Arena
You can’t perform that action at this time.
0 commit comments