1
- import { Alg } from "cubing/alg" ;
1
+ import type { Alg } from "cubing/alg" ;
2
2
import { wcaEventInfo } from "cubing/puzzles" ;
3
3
import { randomScrambleForEvent } from "cubing/scramble" ;
4
4
import { setSearchDebug } from "cubing/search" ;
5
5
import "cubing/twisty" ;
6
- import { PuzzleID , TwistyPlayer } from "cubing/twisty" ;
6
+ import type { PuzzleID , TwistyPlayer } from "cubing/twisty" ;
7
7
8
8
function updateURLParam ( key , value , defaultValue ) : void {
9
9
const url = new URL ( location . href ) ;
@@ -42,6 +42,7 @@ const unofficialEvents: Record<string, EventInfo> = {
42
42
43
43
const { searchParams } = new URL ( location . href ) ;
44
44
const event = searchParams . get ( "event" ) ?? "333" ;
45
+ // biome-ignore lint/style/noNonNullAssertion: TODO
45
46
const eventInfo : EventInfo = wcaEventInfo ( event ) ?? unofficialEvents [ event ] ! ;
46
47
47
48
const cubingIcon = document . querySelector ( "#event-selector" ) as HTMLElement ;
@@ -78,13 +79,13 @@ for (const button of document.querySelectorAll("#event-grid button")) {
78
79
} ) ;
79
80
}
80
81
81
- const tempoScale = parseFloat ( searchParams . get ( "tempo-scale" ) ?? "10" ) ;
82
+ const tempoScale = Number . parseFloat ( searchParams . get ( "tempo-scale" ) ?? "10" ) ;
82
83
player . tempoScale = tempoScale ;
83
84
const tempoSlider = document . querySelector (
84
85
"#speed-wrapper input" ,
85
86
) as HTMLInputElement ;
86
87
tempoSlider . addEventListener ( "input" , ( ) => {
87
- player . tempoScale = parseFloat ( tempoSlider . value ) ;
88
+ player . tempoScale = Number . parseFloat ( tempoSlider . value ) ;
88
89
updateURLParam ( "tempo-scale" , tempoSlider . value , "10" ) ;
89
90
} ) ;
90
91
tempoSlider . value = tempoScale . toString ( ) ;
@@ -104,6 +105,7 @@ if (visualizationIs2D) {
104
105
}
105
106
106
107
const eventName = eventInfo . eventName ;
108
+ // biome-ignore lint/style/noNonNullAssertion: DOM binding
107
109
const generating = document . querySelector ( "#generating" ) ! ;
108
110
player . puzzle = eventInfo . puzzleID ;
109
111
textElem . classList . add ( `event-${ event } ` ) ;
@@ -132,12 +134,14 @@ async function rescramble() {
132
134
}
133
135
rescramble ( ) ;
134
136
137
+ // biome-ignore lint/style/noNonNullAssertion: DOM binding
135
138
const rescrambleElem = document . querySelector ( "#rescramble" ) ! ;
136
139
rescrambleElem . addEventListener ( "click" , rescramble ) ;
137
140
const showRescrambleCheckbox = document . querySelector (
138
141
"#show-rescramble" ,
139
142
) as HTMLInputElement ;
140
143
if (
144
+ // biome-ignore lint/suspicious/noExplicitAny: Workaround
141
145
( navigator as any ) . standalone // Safari workaround
142
146
) {
143
147
rescrambleElem . classList . add ( "force-show" ) ;
0 commit comments