Phone UI and touch precision overhaul, proxy fixes, Orbital Uplink, four new maps

Phone panels (reviewed + QA'd, matrix of 22 layouts with real taps/bounding boxes):
- selected-tower action bar over the board (Upgrade/Sell/Target/close), info panel
  updated in place so taps are never lost, scrollable palette for 7+ towers,
  overlays with pinned footers (Help "Got it", Play solo, Join always visible),
  tappable room chip to invite, reduced-motion/contrast/forced-colors fixes,
  paused state, partner cursor labels, bigger level pips and owner flags
- touch input rewritten around "pointerdown commits nothing": pinch never builds,
  10px tap slop, palm-proof pinch, long-press pings with any tool armed, nudge
  arrows for precise placement, hotkey repeat guard, proportional wheel zoom
- new e2e: select/sell, info-panel stability, UI states, touch precision;
  camera unit tests

Proxy/server (reproduced against real nginx 1.26 with NPM v2.16 config):
- Origin check works when the proxy drops a non-default port, TRUSTED_PROXIES for
  proxies on global IPv6/CGNAT addresses, service worker no longer serves nginx's
  502 page, DEPLOY.md corrected (NPM default read timeout is 90 s, Advanced-tab
  limits, path-prefix, cookie size, per-IP cap behaviour)

Content:
- Orbital Uplink: 4-level endgame tower (450 + 500/800/1200 credits): piercing
  armour-ignoring beam, blast and lingering slow, ground+air, range 11-14;
  glyph, beam effect, sound, help text, unit tests
- Maps: The Canyon, Archipelago, Fortress, Pinwheel (7 maps total)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tb8pW2KAN4oFkh1aK1BfD8
This commit is contained in:
Claude 2026-10-10 18:03:24 +00:00
parent dad0382e10
commit a5bd09d505
22 changed files with 2423 additions and 405 deletions

View file

@ -35,6 +35,7 @@
<symbol id="i-up" viewBox="0 0 24 24"><path d="M12 19V6M6 11.5L12 5.5l6 6" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></symbol>
<symbol id="i-trash" viewBox="0 0 24 24"><path d="M5 7h14M10 7V4.5h4V7M7 7l1 12.5h8L17 7M10.5 11v5M13.5 11v5" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/></symbol>
<symbol id="i-users" viewBox="0 0 24 24"><circle cx="9" cy="8.5" r="3.3" fill="currentColor"/><path d="M2.5 19.5c0-3.6 2.9-5.6 6.5-5.6s6.5 2 6.5 5.6z" fill="currentColor"/><circle cx="17" cy="9.5" r="2.5" fill="currentColor" opacity=".7"/><path d="M16.5 14.2c3 0 5 1.6 5 4.6h-4.2" fill="currentColor" opacity=".7"/></symbol>
<symbol id="i-target" viewBox="0 0 24 24"><circle cx="12" cy="12" r="7.5" fill="none" stroke="currentColor" stroke-width="2"/><circle cx="12" cy="12" r="2.2" fill="currentColor"/><path d="M12 2.5v4M12 17.5v4M2.5 12h4M17.5 12h4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></symbol>
<symbol id="i-fs" viewBox="0 0 24 24"><path d="M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
</defs>
</svg>
@ -46,12 +47,12 @@
<div class="stat" id="statWave" title="Wave"><span class="lbl">WAVE</span><b id="vWave">0</b><small id="vWaveMax"></small></div>
<div class="stat" id="statLives" title="Server integrity"><svg class="ic"><use href="#i-heart"/></svg><b id="vLives">20</b></div>
<div class="stat" id="statGold" title="Credits"><svg class="ic"><use href="#i-coin"/></svg><b id="vGold">0</b></div>
<div id="netChip" class="chip" hidden title="Co-op room"><svg class="ic"><use href="#i-users"/></svg><span id="netRoom"></span><span id="netPing"></span></div>
<button id="netChip" class="chip" type="button" hidden title="Co-op room: tap to invite your partner" aria-label="Co-op room. Tap to invite your partner"><svg class="ic"><use href="#i-users"/></svg><span id="netRoom"></span><span id="netPing"></span><svg class="ic share"><use href="#i-share"/></svg></button>
<div class="spacer"></div>
<button id="btnWave" class="primary" aria-label="Start next wave"><svg class="ic"><use href="#i-play"/></svg><span id="btnWaveText">Wave 1</span></button>
<button id="btnAuto" class="icon toggle" aria-pressed="false" aria-label="Automatic waves" title="Automatic waves (A)"><span>AUTO</span></button>
<button id="btnSpeed" class="icon" aria-label="Game speed" title="Speed (F)"><span id="speedText">1×</span></button>
<button id="btnPause" class="icon" aria-label="Pause" title="Pause (P)"><svg class="ic"><use href="#i-pause"/></svg></button>
<button id="btnPause" class="icon" aria-label="Pause" aria-pressed="false" title="Pause (P)"><svg class="ic"><use href="#i-pause"/></svg></button>
<button id="btnSound" class="icon" aria-label="Sound" title="Sound (M)"><svg class="ic"><use href="#i-sound"/></svg></button>
</header>
@ -59,14 +60,21 @@
<canvas id="board" aria-label="Game board" role="img"></canvas>
<div id="hint" class="hint" hidden></div>
<div id="banner" class="banner" aria-live="polite"></div>
<div id="pausedTag" class="paused-tag" hidden>PAUSED</div>
<button id="pausedTag" class="paused-tag" type="button" hidden><svg class="ic"><use href="#i-play"/></svg><span>PAUSED<small>tap to resume</small></span></button>
<div id="toasts" aria-live="polite"></div>
<button id="btnFit" class="icon floating" aria-label="Reset zoom" hidden><svg class="ic"><use href="#i-fit"/></svg></button>
<div id="confirm" class="confirm" hidden>
<button id="btnCancelBuild" class="icon danger" aria-label="Cancel"><svg class="ic"><use href="#i-x"/></svg></button>
<span id="confirmHint" class="chint" aria-live="polite"></span>
<button id="btnConfirmBuild" class="primary big"><svg class="ic"><use href="#i-check"/></svg><span id="confirmText">Build</span></button>
<div id="nudge" class="nudge" role="group" aria-label="Move the build cell by one cell">
<button type="button" data-dx="-1" data-dy="0" aria-label="Move left"><svg class="ic"><use href="#i-up"/></svg></button>
<button type="button" data-dx="0" data-dy="-1" aria-label="Move up"><svg class="ic"><use href="#i-up"/></svg></button>
<button type="button" data-dx="0" data-dy="1" aria-label="Move down"><svg class="ic"><use href="#i-up"/></svg></button>
<button type="button" data-dx="1" data-dy="0" aria-label="Move right"><svg class="ic"><use href="#i-up"/></svg></button>
</div>
</div>
<div id="reconnect" class="reconnect" hidden><div class="spinner"></div><span>Connection lost. Reconnecting&hellip;</span></div>
<div id="reconnect" class="reconnect" hidden role="alert"><div class="spinner"></div><span>Connection lost. Reconnecting&hellip;</span></div>
</main>
<aside id="side">
@ -76,24 +84,27 @@
<section id="players" hidden></section>
</aside>
<!-- ===== main menu ===== -->
<!-- ===== main menu: .card-body scrolls, .card-foot (the primary buttons) is always visible ===== -->
<div id="menu" class="overlay">
<div class="card">
<div class="logo"><span class="logo-mark" aria-hidden="true"></span><h1>NETWALL</h1></div>
<p class="tag">Build the firewall. Stretch the route. Protect the server.</p>
<div id="mapPick" class="maps" role="radiogroup" aria-label="Map"></div>
<p id="mapDesc" class="mapdesc"></p>
<div class="row">
<button id="btnSolo" class="primary big"><svg class="ic"><use href="#i-play"/></svg>Play solo</button>
<button id="btnCoop" class="big"><svg class="ic"><use href="#i-users"/></svg>Co-op online</button>
<div class="card-body">
<div class="logo"><span class="logo-mark" aria-hidden="true"></span><h1>NETWALL</h1></div>
<p class="tag">Build the firewall. Stretch the route. Protect the server.</p>
<div id="mapPick" class="maps" role="radiogroup" aria-label="Map"></div>
<p id="mapDesc" class="mapdesc"></p>
</div>
<button id="btnResume" class="big resume" hidden></button>
<div class="row small">
<button id="btnHelp" class="link">How to play</button>
<button id="btnFullscreen" class="link" hidden>Fullscreen</button>
<button id="btnCloseMenu" class="link" hidden>Back to game</button>
<div class="card-foot">
<div id="menuOpts" class="opts"></div><!-- room for the difficulty selector (Easy / Normal / Hard) -->
<div class="row">
<button id="btnSolo" class="primary big"><svg class="ic"><use href="#i-play"/></svg>Play solo</button>
<button id="btnCoop" class="big"><svg class="ic"><use href="#i-users"/></svg>Co-op online</button>
</div>
<button id="btnResume" class="big resume" hidden></button>
<div class="row small">
<button id="btnHelp" class="link">How to play</button>
<button id="btnFullscreen" class="link" hidden>Fullscreen</button>
<button id="btnCloseMenu" class="link" hidden>Back to game</button>
</div>
</div>
</div>
</div>
@ -101,55 +112,68 @@
<!-- ===== co-op lobby ===== -->
<div id="lobby" class="overlay" hidden>
<div class="card">
<h2>Co-op online</h2>
<p class="muted">Two players, one base, one pool of credits. Create a room and send the link, or enter a friend's code.</p>
<label class="field"><span>Your name</span><input id="inName" maxlength="16" autocomplete="nickname" autocapitalize="words" spellcheck="false" placeholder="Player"></label>
<div class="split">
<div class="col">
<h3>Host a game</h3>
<p class="muted small" id="lobbyMapName"></p>
<button id="btnCreate" class="primary big">Create room</button>
</div>
<div class="col">
<h3>Join a game</h3>
<input id="inCode" class="code" maxlength="4" autocomplete="off" autocapitalize="characters" spellcheck="false" inputmode="text" placeholder="ABCD" aria-label="Room code">
<button id="btnJoin" class="big">Join</button>
<div class="card-body">
<h2>Co-op online</h2>
<p class="muted lead">Two players, one base, one pool of credits. Create a room and send the link, or enter a friend's code.</p>
<label class="field"><span>Your name</span><input id="inName" maxlength="16" autocomplete="nickname" autocapitalize="words" spellcheck="false" placeholder="Player"></label>
<div class="split">
<div class="col">
<h3>Host a game</h3>
<p class="muted small" id="lobbyMapName"></p>
<button id="btnCreate" class="primary big">Create room</button>
</div>
<div class="col">
<h3>Join a game</h3>
<div class="joinrow">
<input id="inCode" class="code" maxlength="4" autocomplete="off" autocapitalize="characters" spellcheck="false" inputmode="text" placeholder="ABCD" aria-label="Room code">
<button id="btnJoin" class="big">Join</button>
</div>
</div>
</div>
<div id="roomList" class="roomlist" hidden></div><!-- room for the list of open rooms -->
</div>
<div class="card-foot">
<p id="lobbyMsg" class="msg" role="status"></p>
<div class="row small"><button id="btnLobbyBack" class="link">&larr; Back</button></div>
</div>
<p id="lobbyMsg" class="msg" role="status"></p>
<div class="row small"><button id="btnLobbyBack" class="link">&larr; Back</button></div>
</div>
</div>
<!-- ===== help ===== -->
<div id="help" class="overlay" hidden>
<div class="card wide">
<div class="card-body">
<h2>How to play</h2>
<ul class="howto">
<li><b>Goal.</b> Packets pour in from the gateways (red). Don't let them reach the <b>server</b>. Each leak costs integrity (&hearts;).</li>
<li><b>Maze.</b> The map is open: <b>Firewalls</b> are cheap walls. Packets always take the shortest open route, so walls make them walk further, past your turrets. You can lengthen the route but never seal it off completely. Hover to preview the new route.</li>
<li><b>Turrets.</b> Filter (fast), IDS Sniper (long range, armour-piercing), Mortar (splash), Rate Limiter (slows), Router Arc (chain lightning). <b>Spoofed packets fly</b> over your maze, so keep some anti-air. Mortars can't hit flyers.</li>
<li><b>Maze.</b> The map is open: <b>Firewalls</b> are cheap walls. Packets always take the shortest open route, so walls make them walk further, past your turrets. You can lengthen the route but never seal it off completely. <span class="kbd-only">Hover</span><span class="touch-only">Tap</span> to preview the new route.</li>
<li><b>Turrets.</b> Filter (fast), IDS Sniper (long range, armour-piercing), Mortar (splash), Rate Limiter (slows), Router Arc (chain lightning), and the very expensive late-game <b>Orbital Uplink</b> (a piercing beam that ignores armour, hits flyers and slows what it touches). <b>Spoofed packets fly</b> over your maze, so keep some anti-air. Mortars can't hit flyers.</li>
<li><b>Credits.</b> Earned from kills and every cleared wave. Upgrade turrets up to level 3. Sell for 70% back (walls refund in full).</li>
<li><b>Controls.</b> <span class="kbd-only">Click to build, drag to paint walls, right-click to cancel. Keys 1&ndash;6 pick a tower, Space starts a wave, U upgrades, X sells, T changes targeting, P pauses, F changes speed, wheel zooms.</span>
<span class="touch-only">Tap a tower type, then tap the map to preview and tap &#10003; to build. Walls paint as you drag. Pinch to zoom, two fingers to pan, long-press to ping your partner.</span></li>
<li><b>Controls.</b> <span class="kbd-only">Click to build, drag to paint walls, right-click to cancel. Keys <span id="helpKeys">1&ndash;6</span> pick a tower, Space starts a wave, U upgrades, X sells, T changes targeting, P pauses, F changes speed, wheel zooms.</span>
<span class="touch-only">Tap a tower type, then tap the map to preview; nudge the cell with the arrows and tap &#10003; to build. Walls paint as you drag. Pinch to zoom, two fingers to pan, long-press to ping your partner.</span></li>
<li><b>Co-op.</b> Both players share everything and can build, sell and upgrade at the same time. You see each other's cursors; long-press / Alt-click pings the map.</li>
</ul>
<div class="row"><button id="btnHelpClose" class="primary big">Got it</button></div>
</div>
<div class="card-foot"><div class="row"><button id="btnHelpClose" class="primary big">Got it</button></div></div>
</div>
</div>
<!-- ===== game over / victory ===== -->
<div id="end" class="overlay" hidden>
<div class="card">
<h2 id="endTitle">Breach!</h2>
<p id="endText" class="muted"></p>
<div id="endStats" class="stats"></div>
<div class="row">
<button id="btnAgain" class="primary big">Play again</button>
<button id="btnContinue" class="big" hidden>Keep going</button>
<button id="btnEndMenu" class="big">Menu</button>
<div class="card-body">
<h2 id="endTitle">Breach!</h2>
<p id="endText" class="muted"></p>
<div id="endStats" class="stats"></div>
</div>
<div class="card-foot">
<div class="row">
<button id="btnAgain" class="primary big">Play again</button>
<button id="btnContinue" class="big" hidden>Keep going</button>
<button id="btnEndMenu" class="big">Menu</button>
</div>
<p id="endWait" class="msg" hidden>Waiting for the host to start a new game&hellip;</p>
</div>
<p id="endWait" class="msg" hidden>Waiting for the host to start a new game&hellip;</p>
</div>
</div>