@@ -13,8 +13,13 @@ const ghostSheet = document.querySelector("#journal-minimap")!;
13
13
const body = document . body ;
14
14
const bottomContent = document . querySelector < HTMLElement > ( "#bottom-content" ) ! ;
15
15
16
- if ( readCookie ( "hide-excluded-toggle" ) === "True" ) {
17
- body . classList . add ( "hide-excluded-toggle" )
16
+ if ( readCookie ( "nightmare" ) . toLowerCase ( ) === "true" ) {
17
+ body . classList . add ( "nightmare" )
18
+ nightmareToggle . classList . add ( "active" ) ;
19
+ }
20
+
21
+ if ( readCookie ( "hide-excluded" ) . toLowerCase ( ) === "true" ) {
22
+ body . classList . add ( "hide-excluded" )
18
23
hideExcludedToggle . classList . add ( "active" ) ;
19
24
}
20
25
@@ -68,7 +73,14 @@ document.querySelectorAll(".toggle").forEach(toggle => {
68
73
} )
69
74
70
75
nightmareToggle . addEventListener ( "click" , function ( ) {
71
- body . classList . toggle ( "nightmare" ) ;
76
+ let state = body . classList . toggle ( "nightmare" ) ;
77
+ writeCookie ( "nightmare" , state . toString ( ) )
78
+ updateGhosts ( ) ;
79
+ } ) ;
80
+
81
+ hideExcludedToggle . addEventListener ( "click" , function ( ) {
82
+ let state = body . classList . toggle ( "hide-excluded" ) ;
83
+ writeCookie ( "hide-excluded" , state . toString ( ) )
72
84
updateGhosts ( ) ;
73
85
} ) ;
74
86
@@ -178,18 +190,6 @@ possessionButtons.forEach((button, i) => button.addEventListener("click", functi
178
190
}
179
191
} ) ) ;
180
192
181
- hideExcludedToggle . addEventListener ( "click" , function ( ) {
182
- if ( body . classList . contains ( "hide-excluded-toggle" ) ) {
183
- body . classList . remove ( "hide-excluded-toggle" ) ;
184
- writeCookie ( "hide-excluded-toggle" , "False" )
185
- } else {
186
- body . classList . add ( "hide-excluded-toggle" ) ;
187
- writeCookie ( "hide-excluded-toggle" , "True" )
188
- }
189
-
190
- updateGhosts ( ) ;
191
- } ) ;
192
-
193
193
evidenceButtons . forEach ( button => button . addEventListener ( "click" , function ( ) {
194
194
let changedGhostEvidences ;
195
195
let changedEvidence = button . dataset . evidence ;
0 commit comments