DOMSOLO / V0.18.13BATTLEFIELD
BUI GAME BOARD DESIGN SYSTEM

One board UI.
Every game.

The keys, cards, overlays, bursts and layouts we dialled in on DOM Battlefield, made portable. A new board reuses all of it exactly. The only thing a game changes is its palette.

PALETTE
BOARD
01 PRINCIPLES

Ten rules. No exceptions.

Everything else on this page follows from these. If a board needs something new, it goes in the spec first.

  1. 01

    3D keys

    Everything you can press is a face over a hard base straight below it. Never a side shadow on the board.

  2. 02

    One travel

    Face and base move together on one curve: 120ms ease-out, 50ms on press. Nothing snaps.

  3. 03

    Colour is the job

    One colour per job, the same on desktop and phone, dark and light.

  4. 04

    Locked reads down

    On rests pressed in the lock colour and breathes. Tap again to release.

  5. 05

    Call reads up

    The next key to press stays up and sends a ring from the bottom of its base.

  6. 06

    The ink rim

    Keys, stickers and cards share one ink rim in both themes: neon caps on ink.

  7. 07

    Short, loud words

    Mono caps. FIRST WORD bold · detail. Explanations go to the comms toast.

  8. 08

    Overlay ritual

    Grey dim, a sticker that slams and presses in, two keys at the map’s bottom.

  9. 09

    The field first

    Cards move away from your team, shrink to a key and never cover each other.

  10. 10

    Embed-safe, small

    One root class, one AbortSignal, reduced motion respected, a budget in CI.

02 PALETTE

The only thing a game changes.

One colour per job. Pass any subset as hex; the rest keep their defaults, and every base, glow and lock colour is derived. Try the switcher above: every demo on this page repaints.

  • sys--k-sysNavigation, camera, pager, tips, focus
  • cmd--k-cmdCommand, planning, every locked order
  • fire--k-fireThe main action
  • aim--k-aimAim modes, dim when off
  • attack--k-attackOffensive order
  • advance--k-advancePush to objective
  • fallin--k-fallinForm up on the player
  • flag--k-flagWhite flag: pause, surrender
  • go--k-goStart and confirm
  • teamA--team-aSide A (retreat = your team)
  • teamB--team-bSide B
import { applyPalette } from "board-ui";
applyPalette(boardRoot, { sys: "#06c4ff", cmd: "#8573ee", teamA: "#4bce82", teamB: "#f4457a" });
// or in an embed config: palette: { cmd: "#8573ee" }   (hex only; anything else is ignored)
03 THE 3D KEY

A face over its own base.

Families only set variables (--c, --py, --lock); the state rules do all the motion. Press them: they are the real thing.

Restbase --py below
Hoverlift --hy (fine pointers)
Pressface onto the base
Lockeddown, lock colour, breath
Callring from the base
Disabledflat, 45%
Focusring wraps the base
TRY · tap to lock, tap again to release
VariableBaseArcadeStickerMeaning
--py3u4u5ubase height
--hy1u2u2uhover lift
--edge--line--c 45% into rim#f6f3ffbase colour
--lockrole or --k-cmdcolour when locked
04 KEY FAMILIES

One family, many jobs.

Orders lock in the command colour. Aim keys rest dim and light up when on. The shortcut always sits on the right edge.

ORDERS · fall in · retreat · advance · attack
AIM · auto / lock · and the flag
PLATOON · radios · health · lost
NAVIGATION · pager · segmented · icon keys
PLANNING · round step keys · count badge · caption
05 LABELS

FIRST WORD bold · detail.

Mono caps, spaced, muted, with the first word in ink. Each layout keeps the same grammar at its own length.

GroupDesktop barCompact desktopFull-screen cardPhone
per unitRADIO · EACH TANKRADIOtitle RADIO · EACH TANKrail key
squadRADIO · WHOLE SQUADWHOLE SQUADWHOLE SQUADORDERS · WHOLE SQUAD
rosterPLATOON · RADIOSPLATOONPLATOONPLATOON
aimAIM · AUTO / LOCKAIMtitle AIMrail keys
RADIO · EACH TANK
RADIO · WHOLE SQUAD
PLATOON · RADIOS
AIM · AUTO / LOCK
06 CARDS

Float, fold, step back.

Cards float over the field on the side away from your team. The grip drags them, the icon key shrinks them, the back tab goes one step back. A unit card's status pill sits on the top edge opposite the back tab, flat, breathing with the selected key's glow, in radio talk. Two cards never cover each other (10px buffer).

ROGER · GRID 0412

TANK 2 · MEDIUM

Pick an order beside the tank: Attack HQ, Follow, or Command.

RADIOEACH TANKWHOLE SQUAD
07 OVERLAYS

Dim. Slam. Two keys.

Grey dim that blocks the board, a sticker that slams down and presses in a little above centre, at most two keys centred at the map’s bottom. The explanation goes to the toast. Try Surrender: the white flag whites out, waves, and blows up.

OverlayKicker / wordKeys
PauseBATTLE PAUSED / GIVE UP?KEEP FIGHTING · SURRENDER
LostINSERT COIN / GAME OVERREMATCH · NEW CAMPAIGN
WonSTAGE CLEAR / MISSION COMPLETEREMATCH · NEW CAMPAIGN
Stale pageSOMETHING WENT WRONG / REFRESHREFRESH BROWSER
08 LAUNCH

Press, invert, shatter.

Every key that starts or ends a game presses into its base, flips to its inverse, then breaks into spinning chunks with a flash, a shock ring and falling square debris. The action runs in the click; the burst lives on the page body.

  1. 0–90ms an inert copy presses into its base and inverts (light for dark, same hues)
  2. 90ms six chunks fly out, spin and fall
  3. 90–410ms flash, core in the key’s ink, round shock ring
  4. 90–730ms twelve square bits radiate and drop
  5. 760ms the layer is gone; the key stays hidden if the action removed it
09 COMMS & TIPS

Say it once, where it reads.

One comms line carries every explanation. It never sits under the header or slides under a card. Button tips dim the page and ring each group's keys.

Tank 2: tap a square to send it, or Attack HQ.

10 LAYOUTS

Four shapes, one set of keys.

The same keys rearrange for each screen. The thresholds are measured, not guessed: the roster needs 52u per unit and never wraps.

Phone cockpitLandscape + full screen gates. Left rail: menu, pause, readouts, Command, camera, stick. Right rail: orders, Auto, Lock, Fire. Notch-safe; Command slides the right rail away and Fire becomes a small ✕.
Desktop barRADIO (Command) · RADIO · WHOLE SQUAD · PLATOON · RADIOS (centre) · AIM · Surrender far right. Labels when it all fits on one line.
Compact desktopIcon keys when the bar can't fit (and with more than 4 units below 1750px). In battle the roster moves to a card under the mini-map (below 1180px, or more than 4 units below 1160px).
Full screenHeader hidden. RADIO and AIM float as dock cards (54u header row, list / grid switch), the roster card sits under the mini-map. Full screen survives new games.
11 MOTION & SOUND

Snappy keys, theatrical moments.

Keys never spring. Springs are for pop-ins only. Reduced motion keeps every end state and drops the motion.

MotionTimingNotes
Key travel120ms ease-out · press 50mstransform + box-shadow together
Locked breath1.8s ease-in-out ∞glow ring in the lock colour
Call ring1.4s ease-out ∞from the bottom of the base
Sticker slam1100msdrop · hit 36% · settle · hold · press in
Launch burst760mspress + invert 90ms · 6 chunks · flash · ring · 12 bits
Surrender16 × 18ms + wave 120ms × 4white-out, then the burst at 480ms
Boot doors620ms after 120msrotateY ±100°; the boot runs from t0 = 0.65s
Pop-ins380ms springcubic-bezier(.34,1.7,.5,1), never on key travel
Sound cueCharacter
starttwo rising notes
fireshort zap
hitsquare thud
hurtsaw drop (surrender press)
wonthree notes up
gameoverthe end cue
12 BUILD A BOARD

A new game in an hour.

Swap the game logic and the board; keep everything above. The spec has the full checklist, every exact value and the lessons we already paid for.

ISOLATION · SHADOW DOM

On someone else's site, mount the board in a shadow root: mount(host, css, { palette }). This box sits under a page rule that turns every button red with a dashed border. The board inside doesn't see it.

  1. Wrap the board in <div class="bui" data-theme data-side> and include the kit.
  2. Pass the palette; check every face reads with ink text on it.
  3. Map each action to a role colour; write labels as WORD · detail.
  4. Bar groups: per-unit radio · squad orders · roster · aim / mode · flag far right.
  5. Overlays: pause, result, stale page, with the sticker copy above.
  6. Launch keys use launch(); a reset never cancels the burst.
  7. Cards: grip, fold key, back tab, the placement rules.
  8. Comms toast placement per stage; tips mode.
  9. Boot screen and door hand-off if it ships as a full-game cartridge.
  10. Test 844×390, 1100, 1400, 1750, 1920 and full screen, both themes, both sides, 4 and 12 units.
  11. Reduced motion, keyboard and screen reader names; a size budget in CI.
SPEC · GITHUBBOARD-UI.md: the full spec for humans and agentsExact tokens, states, timings, DOM, layouts, lessons and the checklist