1
0

Updates
All checks were successful
Test / test (push) Successful in 9m33s

This commit is contained in:
Aiden
2026-06-11 05:48:19 +10:00
parent a470d4bdc7
commit fbdb733f13
13 changed files with 310 additions and 15 deletions

View File

@@ -3,9 +3,9 @@ import {
setVrPanelOpacity,
type VrControlPanel
} from './vr-control-panel.js';
import { DEFAULT_MENU_AUTO_HIDE_DELAY_MS } from '../utils/control-panel-timing.js';
const FADE_DURATION_MS = 200;
const AUTO_HIDE_DELAY_MS = 10000;
export class VrPanelVisibility {
private hideTimeout: number | undefined;
@@ -28,15 +28,15 @@ export class VrPanelVisibility {
this.hideImmediately();
}
show(): void {
this.showWithAutoHide(true);
show(autoHideDelayMs = DEFAULT_MENU_AUTO_HIDE_DELAY_MS): void {
this.showWithAutoHide(true, autoHideDelayMs);
}
showPersistent(): void {
this.showWithAutoHide(false);
this.showWithAutoHide(false, DEFAULT_MENU_AUTO_HIDE_DELAY_MS);
}
private showWithAutoHide(shouldAutoHide: boolean): void {
private showWithAutoHide(shouldAutoHide: boolean, autoHideDelayMs: number): void {
if (this.panel) this.panel.group.visible = true;
this.clearHideTimeout();
@@ -46,7 +46,7 @@ export class VrPanelVisibility {
}
if (shouldAutoHide) {
this.hideTimeout = window.setTimeout(() => this.hide(), AUTO_HIDE_DELAY_MS);
this.hideTimeout = window.setTimeout(() => this.hide(), autoHideDelayMs);
}
}