File tree 6 files changed +42
-34
lines changed
6 files changed +42
-34
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " next-app" ,
3
3
"private" : true ,
4
4
"scripts" : {
5
- "dev" : " next dev --turbopack " ,
5
+ "dev" : " next dev" ,
6
6
"build" : " next build" ,
7
7
"start" : " next start" ,
8
8
"export" : " next export" ,
17
17
"@vercel/analytics" : " ^1.3.1" ,
18
18
"chart.js" : " ^4.4.2" ,
19
19
"chess.ts" : " ^0.16.2" ,
20
+ "chessground" : " ^8.3.5" ,
20
21
"chroma-js" : " ^2.4.2" ,
21
- "classnames" : " ^2.3.1" ,
22
22
"exponential-backoff" : " ^3.1.1" ,
23
23
"framer-motion" : " ^11.5.6" ,
24
24
"gray-matter" : " ^4.0.3" ,
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ export const useLocalStorage = <T>(
6
6
) : [ T , ( arg0 : T ) => void ] => {
7
7
const isClient = typeof window !== 'undefined'
8
8
const [ storedValue , setStoredValue ] = useState < T > ( ( ) => {
9
+ if ( ! isClient ) {
10
+ return initialValue
11
+ }
9
12
try {
10
13
const item = window . localStorage . getItem ( key )
11
14
return item ? JSON . parse ( item ) : initialValue
@@ -20,8 +23,9 @@ export const useLocalStorage = <T>(
20
23
const valueToStore =
21
24
value instanceof Function ? value ( storedValue ) : value
22
25
setStoredValue ( valueToStore )
23
- if ( isClient )
24
- window ?. localStorage ?. setItem ( key , JSON . stringify ( valueToStore ) )
26
+ if ( isClient ) {
27
+ window . localStorage . setItem ( key , JSON . stringify ( valueToStore ) )
28
+ }
25
29
} catch ( error ) {
26
30
console . error ( error )
27
31
}
Original file line number Diff line number Diff line change 1
- @import ' ./ theme' ;
2
- @import ' ./ layout' ;
1
+ @use ' theme' ;
2
+ @use ' layout' ;
3
3
4
4
@mixin rounded {
5
5
border-radius : 10px ;
6
6
}
7
7
8
8
@mixin shadowed {
9
- @include themed-styles {
10
- filter : drop-shadow (0px 2px 8px rgba (themed-colour (' background0' ), 1 ));
9
+ @include theme . themed-styles {
10
+ filter : drop-shadow (0px 2px 8px rgba (theme . themed-colour (' background0' ), 1 ));
11
11
}
12
12
}
13
13
14
14
@mixin boxed {
15
15
@include rounded ;
16
- @include themed-styles {
17
- background-color : rgba (themed-colour (' background0' ), 0.75 );
16
+ @include theme . themed-styles {
17
+ background-color : rgba (theme . themed-colour (' background0' ), 0.75 );
18
18
}
19
19
}
20
20
21
21
@mixin scroll {
22
22
& ::-webkit-scrollbar {
23
23
width : 7px ;
24
24
25
- @include mobile {
25
+ @include layout . mobile {
26
26
width : 4px ;
27
27
height : 8px ;
28
28
}
36
36
border-radius : 1px ;
37
37
transition : 150ms ;
38
38
39
- @include themed-styles {
40
- background-color : rgba (themed-colour (' human-accent' ), 0.4 );
39
+ @include theme . themed-styles {
40
+ background-color : rgba (theme . themed-colour (' human-accent' ), 0.4 );
41
41
}
42
42
43
43
& :hover {
44
- @include themed-styles {
45
- background-color : rgba (themed-colour (' human-accent' ), 0.65 );
44
+ @include theme . themed-styles {
45
+ background-color : rgba (theme . themed-colour (' human-accent' ), 0.65 );
46
46
}
47
47
}
48
48
}
Original file line number Diff line number Diff line change
1
+ @use ' sass:map' ;
2
+
3
+ $theme-map : null !default ;
4
+
1
5
$themes : (
2
6
light : (
3
7
backdrop : #f6f6f6 ,
@@ -28,8 +32,8 @@ $themes: (
28
32
:global (.theme-#{$theme} ) & {
29
33
$theme-map : () !global;
30
34
@each $key , $submap in $map {
31
- $value : map- get ($map , ' #{$key } ' );
32
- $theme-map : map- merge (
35
+ $value : map . get ($map , ' #{$key } ' );
36
+ $theme-map : map . merge (
33
37
$theme-map ,
34
38
(
35
39
$key : $value ,
@@ -45,8 +49,8 @@ $themes: (
45
49
.theme-#{$theme } & {
46
50
$theme-map : () !global;
47
51
@each $key , $submap in $map {
48
- $value : map- get ($map , ' #{$key } ' );
49
- $theme-map : map- merge (
52
+ $value : map . get ($map , ' #{$key } ' );
53
+ $theme-map : map . merge (
50
54
$theme-map ,
51
55
(
52
56
$key : $value ,
@@ -60,5 +64,5 @@ $themes: (
60
64
}
61
65
62
66
@function themed-colour ($key ) {
63
- @return map- get ($theme-map , $key );
67
+ @return map . get ($theme-map , $key );
64
68
}
Original file line number Diff line number Diff line change 1
- @import ' ./ theme' ;
2
- @import ' ./ layout' ;
3
- @import ' ./ fonts' ;
4
- @import ' ./ base' ;
1
+ @use ' theme' ;
2
+ @use ' layout' ;
3
+ @use ' fonts' ;
4
+ @use ' base' ;
5
5
6
6
button {
7
7
& :disabled {
31
31
32
32
width : 100% ;
33
33
min-height : 100vh ;
34
- @include themed-styles {
35
- background-color : themed-colour (backdrop );
36
- color : themed-colour (text-primary );
34
+ @include theme . themed-styles {
35
+ background-color : theme . themed-colour (backdrop );
36
+ color : theme . themed-colour (text-primary );
37
37
}
38
38
39
- @include mobile {
39
+ @include layout . mobile {
40
40
flex-direction : column ;
41
41
overflow-x : hidden ;
42
42
}
45
45
.content-container {
46
46
flex-grow : 1 ;
47
47
position : relative ;
48
- @include rounded ;
48
+ @include base . rounded ;
49
49
display : flex ;
50
50
flex-direction : column ;
51
51
}
65
65
flex-grow : 1 ;
66
66
margin-left : 2vw ;
67
67
68
- @include mobile {
68
+ @include layout . mobile {
69
69
flex-direction : column ;
70
70
margin-left : 0px ;
71
71
}
79
79
flex-grow : 1 ;
80
80
padding : 2em ;
81
81
82
- @include mobile {
82
+ @include layout . mobile {
83
83
width : 100% ;
84
84
padding : 1em ;
85
85
max-width : none ;
96
96
gap : 10px ;
97
97
margin : 10px ;
98
98
99
- @include mobile {
99
+ @include layout . mobile {
100
100
margin : 0px ;
101
101
width : 100% ;
102
102
max-width : none ;
103
103
}
104
104
}
105
105
106
106
.action {
107
- @include boxed ;
107
+ @include base . boxed ;
108
108
width : 100% ;
109
109
padding : 25px ;
110
110
}
You can’t perform that action at this time.
0 commit comments