No description
  • TypeScript 58.1%
  • Vue 15.9%
  • JavaScript 13.9%
  • Python 9.8%
  • Shell 2.1%
  • Other 0.2%
Find a file
goldjohn6 a8a7718b50
Map zoom (#176)
* Zoom the map: buttons, pinch, wheel, and drag to pan

Players asked for a way to zoom in after the board is fitted to the
screen. This adds a zoom on the map alone, on top of the fitted layout,
in both the desktop and portrait layouts.

- + / − / reset buttons in the map's top-right corner, sized in screen
  pixels so they stay thumb-sized on a phone.
- Two-finger pinch on touch screens zooms the map, not the page. One
  finger pans once zoomed; at the fitted size it still scrolls the page.
- Trackpad pinch (ctrl+wheel) everywhere; a plain wheel also zooms on
  desktop, where the board fits the window.
- Mouse drag pans when zoomed. A press that moves more than 6 px is a
  pan, and the click that follows it is swallowed, so a drag never
  builds a city.
- Clamped between the fit and 4x, and the zoomed map always covers its
  own box. It is clipped to that box, so it never covers the market or
  player boards.

The zoom layer sits outside the measured map slot, so the layout's
getBBox() measurement never sees it. The maths is in util/map-zoom.ts
with unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Map zoom: a faint outline and a minimap while zoomed

Asked for with older players in mind, so a zoomed map never leaves
anyone lost. Nothing changes at the fitted size. While zoomed:

- a faint white outline round the map's box, so it reads as a zoomed view;
- a small overview of the whole map in the bottom-left corner (the
  buttons are top-right), rounded, with an orange box over the part on
  screen. Tapping the overview centres the view there.

The overview is a <use> of the map slot, so it always matches the board.
It is sized in screen pixels, from 72 to 128 px on its long side, and
keeps the map's own proportions in both the desktop and portrait
layouts. Gestures never start on the overview or the buttons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Map zoom: a plain wheel scrolls the page, Ctrl+wheel zooms

Someone scrolling down to the resources or the chat must never zoom by
accident, so a plain wheel over the map always scrolls the page. It also
shows a brief hint, "Hold Ctrl and scroll to zoom" (⌘ on a Mac), the way
embedded maps do. Ctrl/⌘ + wheel and trackpad pinch zoom the map, and
the + / − tooltips mention both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 15:02:26 -08:00
.devcontainer prettier 2025-08-09 20:56:35 +00:00
.github feat(viewer): localize interface and tutorials in 15 languages 2026-09-25 16:30:05 +02:00
.husky Initial 2021-10-13 00:09:21 -03:00
ai chore: align formatting checks with generated geography data 2026-10-05 01:35:46 +02:00
art/achievements It's Chile time! (#171) 2026-11-17 12:41:45 -08:00
docs Release phase auto-pass engine 2.0.37 and viewer 2.3.32 2026-11-17 22:21:20 +00:00
engine Seed the bots in the Spain & Portugal Step 2 test (#175) 2026-11-21 09:25:51 -08:00
scripts Release phase auto-pass engine 2.0.37 and viewer 2.3.32 2026-11-17 22:21:20 +00:00
viewer Map zoom (#176) 2026-11-21 15:02:26 -08:00
.editorconfig Initial 2021-10-13 00:09:21 -03:00
.gitignore Add search supervision, paired arenas and CPU-guided inference 2026-09-30 16:31:52 +02:00
.gitpod.dockerfile Initial 2021-10-13 00:09:21 -03:00
.gitpod.yml Initial 2021-10-13 00:09:21 -03:00
.npmrc Initial 2021-10-13 00:09:21 -03:00
.prettierignore It's Chile time! (#171) 2026-11-17 12:41:45 -08:00
.prettierrc Initial 2021-10-13 00:09:21 -03:00
AGENTS.md Integrate AI research and harden analysis autoplay 2026-10-04 11:38:12 +02:00
package.json feat(viewer): localize interface and tutorials in 15 languages 2026-09-25 16:30:05 +02:00
pnpm-lock.yaml update engine-publish 2025-08-09 21:12:39 +00:00
pnpm-workspace.yaml Show platform Supporter badges and preferred player colours 2026-10-01 23:56:32 +02:00
README.md Merge commit '76988deb8a' into feat/ongoing-analysis-scenarios 2026-09-30 14:26:32 +02:00

Power Grid

Mono repo containing the viewer & the engine for Power Grid

Checkout their READMEs:

Play online at

boardgamers.space

Reach out to us if you want to contribute.

Install

Do pnpm install in the main folder

Test locally

After the installation step, you can run the viewer with:

cd viewer
npm run serve

It will use the engine in its sibling folder

Viewer releases: see uploading the complete viewer build.