Skip to content

Play page: the website's look, and placing ships you can see - #9

Merged
AdminGodZ merged 3 commits into
mainfrom
play-setup
Nov 20, 2026
Merged

AdminGodZ merged 3 commits into
mainfrom
play-setup

Conversation

@AdminGodZ

Copy link
Copy Markdown
Owner

Redesign of web/page.html, the browser game served at /play and offered as a download. The game logic and every call into the engine are unchanged.

What changes

Look. The page now uses the website's colours and type: Newsreader for text, the stencil face for the name, navy on chart paper, and no capitals-only labels.

  • The header holds the name (linking to the website) and the session score.
  • The long tagline about the engine is removed.
  • The rules fold away under "Rules".

Placing ships.

  • Your chart sits next to a dock of the five ships. Each row shows the ship's shape and its cells once placed (for example "✓ C2–C6"), or "Not placed".
  • Preview: The ship in hand is highlighted in the dock and follows the cursor on the chart. The preview turns red where the ship would overlap another or run off the chart.
  • Feedback: Placing a ship drops it with a short animation, the status line says where it went, and the next ship comes to hand.
  • Moving: Click a ship on the chart or in the dock to pick it up. Esc, or clicking it again, puts it back.
  • Controls: an Across / Down toggle (or R), Random, Clear, and Start battle, which stays disabled until all five ships are placed.
  • Enemy waters stay hidden until the battle starts.

Battle.

  • Enemy waters come first, with your chart beside it.
  • Ships are rounded hulls drawn under the grid's cells. Hits are crosses, misses are dots, and the engine's last shot is ringed.
  • Your sunk ships turn red, and the engine's fleet is outlined when the game ends.

Phones. Dock rows are compact, and touch screens show no keyboard hints.

Checks

  • web/build.sh builds the page with the engine.
  • The site build (npm run build) passes and bundles the page as /play.
  • Checked in a browser, desktop and 390×844:
    • Clearing the fleet, placing a ship, turning it with R, the off-chart warning, swapping to another ship, putting a ship back with Esc.
    • Ten turns of battle, resigning, and a new game that reloads the last fleet.
    • No horizontal scroll at 390px.
  • Rust is unchanged.

- Same colours and type as the website (Newsreader, the stencil name, navy on chart
  paper); no capitals-only labels. The header is the name, linking to the website, and
  the session score; the tagline is gone, and the rules fold away under "Rules".
- Placing: your chart and a dock of the five ships, each with its shape, its cells
  once placed (C2–C6, with a tick) or "Not placed". The ship in hand is highlighted in
  the dock and follows the cursor on the chart as a preview, red where it would overlap
  or run off the chart. Placing drops it with a short animation, says where it went, and
  hands you the next ship. Click a ship on the chart or in the dock to move it; Esc or
  clicking it again puts it back. Across / Down toggle (or R), Random, Clear, and Start
  battle, which waits until all five are placed. Enemy waters stay hidden until then.
- Battle: enemy waters first, your chart beside it. Ships are drawn as rounded hulls on
  a layer under the cells, hits as crosses, misses as dots, the engine's last shot ringed;
  your sunk ships turn red, and the engine's fleet is outlined at the end.
- Phones: compact dock rows, no keyboard hints on touch screens.
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
broadside Ready Ready Preview Nov 20, 2026 6:39pm UTC

Browsers show the focus ring after any key press, so turning a ship with R right after
placing one ringed the clicked cell. Rings now show only while navigating by keyboard
(Tab or arrows); a pointer press turns them off again.
- Shading is now proportional to the engine's chance for each cell (was boosted 1.6x
  and capped, so anything over about 60% looked certain), with a 0-100% scale beside
  the toggle.
- Hovering a cell shows its chance ("G9: 65%"); screen readers get it in the label.
  Cells stay enabled in battle (a disabled cell gets no hover) but leave the tab order.
- Game over no longer shows the forecast of the next fleet's spacing.
@AdminGodZ
AdminGodZ merged commit e0dc688 into main Nov 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant