@@ -9,10 +9,11 @@ import { useTimerStatistics } from "@/hooks/useTimerStatistics";
9
9
import useDeviceMatch from "@/hooks/useDeviceMatch" ;
10
10
11
11
const timerStatusClasses = {
12
- idle : "light:text-neutral-900 dark:text-white" ,
13
- holdingKey : "light:text-pink-600 dark:text-pink-600" ,
14
- solving : "light:text-neutral-700 dark:text-slate-200" ,
15
- ready : "text-emerald-400" ,
12
+ IDLE : "light:text-neutral-900 dark:text-white" ,
13
+ HOLDING : "light:text-pink-600 dark:text-pink-600" ,
14
+ SOLVING : "light:text-neutral-700 dark:text-slate-200" ,
15
+ READY : "text-emerald-400" ,
16
+ INSPECTING : "text-orange-500" ,
16
17
} ;
17
18
18
19
const config : any = {
@@ -31,10 +32,12 @@ const config: any = {
31
32
32
33
export default function Timer ( ) {
33
34
const { lang, settings } = useSettingsModalStore ( ) ;
34
- const { selectedCube, isSolving, lastSolve } = useTimerStore ( ) ;
35
- const { timerStatus, hideWhileSolving, solvingTime } = useTimer ( ) ;
35
+ const { selectedCube, isSolving, lastSolve, timerStatus, solvingTime } =
36
+ useTimerStore ( ) ;
37
+ const { inspectionTime } = useTimer ( ) ;
36
38
const { global } = useTimerStatistics ( ) ;
37
39
const { device } = useDeviceMatch ( ) ;
40
+ const hideWhileSolving = settings . features . hideWhileSolving . status ;
38
41
39
42
return (
40
43
selectedCube && (
@@ -50,16 +53,26 @@ export default function Timer() {
50
53
{ translation . timer [ "solving" ] [ lang ] }
51
54
</ span >
52
55
) : (
53
- < div className = "font-mono relative flex flex-col gap-1" >
56
+ < div className = "relative flex flex-col gap-1 font-mono " >
54
57
< div className = "flex items-end justify-center" >
55
- < div className = "text-6xl sm:text-7xl md:text-8xl lg:text-9xl" >
56
- { formatTime ( solvingTime ) . split ( "." ) [ 0 ] }
57
- </ div >
58
- < div className = "text-5xl sm:text-6xl md:text-7xl lg:text-8xl" >
59
- .{ formatTime ( solvingTime ) . split ( "." ) [ 1 ] }
60
- </ div >
58
+ { inspectionTime !== 16000 ? (
59
+ < >
60
+ < div className = "text-6xl sm:text-7xl md:text-8xl lg:text-9xl" >
61
+ { Math . trunc ( inspectionTime ) }
62
+ </ div >
63
+ </ >
64
+ ) : (
65
+ < >
66
+ < div className = "text-6xl sm:text-7xl md:text-8xl lg:text-9xl" >
67
+ { formatTime ( solvingTime ) . split ( "." ) [ 0 ] }
68
+ </ div >
69
+ < div className = "text-5xl sm:text-6xl md:text-7xl lg:text-8xl" >
70
+ .{ formatTime ( solvingTime ) . split ( "." ) [ 1 ] }
71
+ </ div >
72
+ </ >
73
+ ) }
61
74
</ div >
62
- { ! lastSolve && timerStatus === "idle " ? (
75
+ { ! lastSolve && timerStatus === "IDLE " ? (
63
76
< div className = "text-xs text-center animate-pulse" >
64
77
{ device === "Desktop"
65
78
? `${ translation . timer [ "space-to-start" ] [ lang ] } `
@@ -80,7 +93,7 @@ export default function Timer() {
80
93
/>
81
94
{ lastSolve &&
82
95
settings . features . quickActionButtons . status &&
83
- timerStatus === "idle " && < SolveOptions solve = { lastSolve } /> }
96
+ timerStatus === "IDLE " && < SolveOptions solve = { lastSolve } /> }
84
97
</ div >
85
98
</ >
86
99
)
0 commit comments