hiding most live stat elements when not focused

closes #3613
This commit is contained in:
Miodec 2022-09-29 13:23:17 +02:00
parent 2a49beb893
commit aba32bd11d

View file

@ -1,5 +1,8 @@
import * as Caret from "./caret";
import * as ActivePage from "../states/active-page";
import * as LiveWpm from "./live-wpm";
import * as LiveBurst from "./live-burst";
import * as LiveAcc from "./live-acc";
const unfocusPx = 3;
let state = false;
@ -20,6 +23,9 @@ export function set(foc: boolean, withCursor = false): void {
$("#ad-vertical-left-wrapper").addClass("focus");
$("#ad-footer-wrapper").addClass("focus");
$("#ad-footer-small-wrapper").addClass("focus");
LiveWpm.show();
LiveBurst.show();
LiveAcc.show();
} else if (!foc && state) {
state = false;
Caret.startAnimation();
@ -36,6 +42,9 @@ export function set(foc: boolean, withCursor = false): void {
$("#ad-vertical-left-wrapper").removeClass("focus");
$("#ad-footer-wrapper").removeClass("focus");
$("#ad-footer-small-wrapper").removeClass("focus");
LiveWpm.hide();
LiveBurst.hide();
LiveAcc.hide();
}
}