feat: categories, runtime nav, and UX updates

This commit is contained in:
2026-04-21 11:43:43 +00:00
parent 9eb3403f8c
commit 52d1991092
12 changed files with 560 additions and 51 deletions
+4 -9
View File
@@ -25,7 +25,7 @@ cat > /opt/portal/index.html <<HTML
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Инфра полигон МОНТ</title>
<title>Инфрастуктурный полигон МОНТ</title>
<style>
html,body,#screen{margin:0;height:100%;background:#111}
.nav-panel{
@@ -45,17 +45,13 @@ cat > /opt/portal/index.html <<HTML
<div id="screen"></div>
<div class="nav-panel">
<button class="nav-btn" id="btn-back" type="button">Назад</button>
<button class="nav-btn" id="btn-forward" type="button">Вперед</button>
<button class="nav-btn" id="btn-home" type="button">Домой</button>
<button class="nav-btn" id="btn-home" type="button">Главная</button>
</div>
<script type="module">
import RFB from './core/rfb.js';
const XK_ALT_L = 0xffe9;
const XK_CONTROL_L = 0xffe3;
const XK_LEFT = 0xff51;
const XK_RIGHT = 0xff53;
const XK_ENTER = 0xff0d;
const HOME_URL = ${HOME_URL@Q};
const XK_LEFT = 0xff51;
const HOME_URL = ${HOME_URL@Q};
const wsBase = location.pathname.replace(/\/+$/, '');
const wsUrl = (location.protocol === 'https:' ? 'wss://' : 'ws://') + location.host + wsBase + '/websockify';
const rfb = new RFB(document.getElementById('screen'), wsUrl);
@@ -97,7 +93,6 @@ cat > /opt/portal/index.html <<HTML
window.location.href = '/';
}
document.getElementById('btn-back').addEventListener('click', () => chord(XK_ALT_L, XK_LEFT, "AltLeft", "ArrowLeft"));
document.getElementById('btn-forward').addEventListener('click', () => chord(XK_ALT_L, XK_RIGHT, "AltLeft", "ArrowRight"));
document.getElementById('btn-home').addEventListener('click', goHome);
document.addEventListener('contextmenu', (e) => e.preventDefault());
</script>