Skip to content

Commit c981be3

Browse files
author
Kiosk
committed
feat: home button on game menu to navigate to kiosk dashboard
1 parent 6c474a8 commit c981be3

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

game-menu.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@
7373
this.manualConfigSection = this.shadowRoot.getElementById('manualConfigSection');
7474
this.presetSection = this.shadowRoot.getElementById('presetSection');
7575
this.menuTitle = this.shadowRoot.querySelector('.menu-title');
76+
this.homeBtn = this.shadowRoot.getElementById('homeBtn');
77+
78+
// Home button — navigate to kiosk dashboard (use same host as current page)
79+
this.homeBtn?.addEventListener('click', () => {
80+
const host = window.location.hostname || '127.0.0.1';
81+
window.location.href = 'http://' + host;
82+
});
7683

7784
// Remove cursor after typewriter animation
7885
this.menuTitle?.addEventListener('animationend', (e) => {
@@ -575,6 +582,29 @@
575582
.mode-btn.active[data-mode="native"] { background: rgba(33, 150, 243, 0.25); }
576583
.mode-btn:disabled { opacity: 0.25; cursor: not-allowed; }
577584
.mode-btn + .mode-btn { border-left: 1px solid rgba(255, 255, 255, 0.08); }
585+
586+
.home-btn {
587+
position: fixed;
588+
bottom: 16px;
589+
left: 16px;
590+
width: 40px;
591+
height: 40px;
592+
border-radius: 50%;
593+
border: 1px solid rgba(255, 255, 255, 0.15);
594+
background: rgba(0, 0, 0, 0.6);
595+
color: rgba(255, 255, 255, 0.5);
596+
display: flex;
597+
align-items: center;
598+
justify-content: center;
599+
cursor: pointer;
600+
pointer-events: auto;
601+
transition: all 0.2s;
602+
z-index: 1001;
603+
padding: 0;
604+
}
605+
.home-btn:hover { background: rgba(0, 0, 0, 0.8); color: rgba(255, 255, 255, 0.8); border-color: rgba(255, 255, 255, 0.3); }
606+
.home-btn:active { transform: scale(0.9); }
607+
.home-btn svg { width: 20px; height: 20px; fill: currentColor; }
578608
</style>
579609
580610
<div class="player-status" id="playerStatus">
@@ -583,6 +613,9 @@
583613
<div class="player-indicator" data-player="2"><span class="pip"></span><span>P3</span></div>
584614
<div class="player-indicator" data-player="3"><span class="pip"></span><span>P4</span></div>
585615
</div>
616+
<button class="home-btn" id="homeBtn" title="Dashboard">
617+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>
618+
</button>
586619
<div class="game-controls" id="gameControls">
587620
<div class="menu-header">
588621
<div class="title-wrapper">

0 commit comments

Comments
 (0)