Browser-based menus for the Unity game, loaded from StreamingAssets (transparent background for embedding in a WebView / browser overlay).
Standalone repo: collapse-machine-web
Live preview (GitHub Pages): stcost.github.io/collapse-machine-web
Pushes to main run .github/workflows/deploy-pages.yml and publish the main menu at the site root. In the repo settings, set Pages → Build and deployment → Source to GitHub Actions (first deploy only).
- CRT terminal presentation: IBM 3270 typography, orange phosphor gradients, scanlines, vignette.
- Industrial hazard layer: diagonal orange stripes (
hazard-tile.png) on the frame and scrollbars — subtle, not loud. - Fullscreen shell shared across pages: animated landscape backdrop, masked stripe field, no OS chrome.
- Unity bridge via
windowCustomEvents (no backend); HTML/JS owns layout and local UI state only. - Single entry file
index.htmlwith in-page subpages (menu + connect); no full document navigation. - Localization in
Localization/(JSON per language); loaded by Unity in-game and bymenu-locale-loader.jsin the browser. - Menu audio in
audio/(music, hover, click); played by the web page, not FMOD.
Brand color: #ff8000. Keep new UI consistent with terminal rows (term-row), dim labels, and uppercase labels.
StreamingAssets/Web UI/
README.md
.gitignore
Localization/ language JSON + languages.json manifest
audio/ menu-music.mp3, ui-hover.wav, ui-click.wav
Web Main Menu/
index.html
menu-background.js non-repeating backdrop rotation (localStorage)
menu-locale-loader.js fetch locale when not in Unity
menu-ui-sounds.js hover/click in browser
menu-music.js menu music loop + fade
backgrounds/ background-01.png … (cycles without repeat)
screen-shared.css
…
Web Loading/
index.html
loading.css
In-game HUD (hotbar, health, chat) is embedded in Web Main Menu/index.html (menu-game-hud.js, menu-game-hud.css, menu-game-hud-layer.css).
#device.menu-mode--menu(default in browser): full backdrop and menu music.#device.menu-mode--game(Unity pause menu): transparent backdrop, no menu music.
In the browser (no Unity), window positions and start lists persist in localStorage (cm-menu-window-layouts, cm-menu-start-lists). The connect screen ships default worlds, IP servers, and sample Steam friends for preview.
Browsers block fetch() on file:// pages. Serve this folder over HTTP:
- Windows: double-click
serve-local.bat(opens a terminal and starts the server) - Git Bash / macOS / Linux:
./serve-local.sh - PowerShell:
.\serve-local.ps1
Then open http://localhost:8765/Web%20Main%20Menu/index.html. Locales load from Localization/*.json via fetch.
GitHub Pages serves the same menu at the repo root (index.html); the workflow copies Web Main Menu/, Localization/, and audio/ into the published artifact. menu-audio-paths.js picks audio/ vs ../audio/ from the page URL so menu and extras game music work in both layouts.
Requires Node.js (npx on PATH).
Menu music and UI sounds need one click/keypress in the page (browser autoplay policy), then hover/click audio works.
Font: Web Main Menu/fonts/3270-Regular.otf (IBM 3270, bundled for standalone serve and Unity StreamingAssets).
- Add a new
#pageYourIdblock inindex.html(copy.menu-pagepattern). - Add page CSS/JS as needed under
Web Main Menu/. - Register show/hide in
menu-common.js(showPage, status module label if required).