mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 16:17:20 +02:00
32 lines
882 B
TypeScript
Executable File
32 lines
882 B
TypeScript
Executable File
import { BxLogger } from "@/utils/bx-logger";
|
|
import { CE } from "@/utils/html";
|
|
|
|
export class FullscreenText {
|
|
private static instance: FullscreenText;
|
|
public static getInstance = () => FullscreenText.instance ?? (FullscreenText.instance = new FullscreenText());
|
|
private readonly LOG_TAG = 'FullscreenText';
|
|
|
|
$text: HTMLElement;
|
|
|
|
private constructor() {
|
|
BxLogger.info(this.LOG_TAG, 'constructor()');
|
|
this.$text = CE('div', {
|
|
class: 'bx-fullscreen-text bx-gone',
|
|
});
|
|
|
|
document.documentElement.appendChild(this.$text);
|
|
}
|
|
|
|
show(msg: string) {
|
|
document.body.classList.add('bx-no-scroll');
|
|
|
|
this.$text.classList.remove('bx-gone');
|
|
this.$text.textContent = msg;
|
|
}
|
|
|
|
hide() {
|
|
document.body.classList.remove('bx-no-scroll');
|
|
this.$text.classList.add('bx-gone');
|
|
}
|
|
}
|