File tree Expand file tree Collapse file tree 8 files changed +251
-243
lines changed
Expand file tree Collapse file tree 8 files changed +251
-243
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ export function hide(): void {
2020 } ) ;
2121}
2222
23+ export function instantHide ( ) : void {
24+ timerEl . style . opacity = "0" ;
25+ }
26+
2327export function updateTime ( sec : number , layout : string ) : void {
2428 timerEl . textContent = `${ capitalizeFirstLetter ( layout ) } in: ${ sec } s` ;
2529}
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ import { requestDebouncedAnimationFrame } from "../utils/debounced-animation-fra
77
88const textEl = document . querySelector (
99 "#liveStatsTextBottom .liveAcc" ,
10- ) as Element ;
11- const miniEl = document . querySelector ( "#liveStatsMini .acc" ) as Element ;
10+ ) as HTMLElement ;
11+ const miniEl = document . querySelector ( "#liveStatsMini .acc" ) as HTMLElement ;
1212
1313export function update ( acc : number ) : void {
1414 requestDebouncedAnimationFrame ( "live-acc.update" , ( ) => {
@@ -73,6 +73,17 @@ export function hide(): void {
7373 } ) ;
7474}
7575
76+ export function instantHide ( ) : void {
77+ if ( ! state ) return ;
78+
79+ textEl . classList . add ( "hidden" ) ;
80+ textEl . style . opacity = "0" ;
81+ miniEl . classList . add ( "hidden" ) ;
82+ miniEl . style . opacity = "0" ;
83+
84+ state = false ;
85+ }
86+
7687ConfigEvent . subscribe ( ( { key, newValue } ) => {
7788 if ( key === "liveAccStyle" ) newValue === "off" ? hide ( ) : show ( ) ;
7889} ) ;
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ import { requestDebouncedAnimationFrame } from "../utils/debounced-animation-fra
88
99const textEl = document . querySelector (
1010 "#liveStatsTextBottom .liveBurst" ,
11- ) as Element ;
12- const miniEl = document . querySelector ( "#liveStatsMini .burst" ) as Element ;
11+ ) as HTMLElement ;
12+ const miniEl = document . querySelector ( "#liveStatsMini .burst" ) as HTMLElement ;
1313
1414export function reset ( ) : void {
1515 requestDebouncedAnimationFrame ( "live-burst.reset" , ( ) => {
@@ -71,6 +71,17 @@ export function hide(): void {
7171 } ) ;
7272}
7373
74+ export function instantHide ( ) : void {
75+ if ( ! state ) return ;
76+
77+ textEl . classList . add ( "hidden" ) ;
78+ textEl . style . opacity = "0" ;
79+ miniEl . classList . add ( "hidden" ) ;
80+ miniEl . style . opacity = "0" ;
81+
82+ state = false ;
83+ }
84+
7485ConfigEvent . subscribe ( ( { key, newValue } ) => {
7586 if ( key === "liveBurstStyle" ) newValue === "off" ? hide ( ) : show ( ) ;
7687} ) ;
Original file line number Diff line number Diff line change @@ -8,8 +8,10 @@ import { animate } from "animejs";
88
99const textElement = document . querySelector (
1010 "#liveStatsTextBottom .liveSpeed" ,
11- ) as Element ;
12- const miniElement = document . querySelector ( "#liveStatsMini .speed" ) as Element ;
11+ ) as HTMLElement ;
12+ const miniElement = document . querySelector (
13+ "#liveStatsMini .speed" ,
14+ ) as HTMLElement ;
1315
1416export function reset ( ) : void {
1517 requestDebouncedAnimationFrame ( "live-speed.reset" , ( ) => {
@@ -75,6 +77,15 @@ export function hide(): void {
7577 } ) ;
7678}
7779
80+ export function instantHide ( ) : void {
81+ if ( ! state ) return ;
82+ miniElement . classList . add ( "hidden" ) ;
83+ miniElement . style . opacity = "0" ;
84+ textElement . classList . add ( "hidden" ) ;
85+ textElement . style . opacity = "0" ;
86+ state = false ;
87+ }
88+
7889ConfigEvent . subscribe ( ( { key, newValue } ) => {
7990 if ( key === "liveSpeedStyle" ) newValue === "off" ? hide ( ) : show ( ) ;
8091} ) ;
Original file line number Diff line number Diff line change @@ -162,3 +162,10 @@ export function hide(): void {
162162 } ,
163163 } ) ;
164164}
165+
166+ export function instantHide ( ) : void {
167+ monkeyEl . classList . add ( "hidden" ) ;
168+ monkeyEl . style . opacity = "0" ;
169+ monkeyEl . style . animationDuration = "0s" ;
170+ monkeyFastEl . style . opacity = "0" ;
171+ }
You can’t perform that action at this time.
0 commit comments