Demo

Parts, before there is a game to put them in

These pages render the pieces a multiplayer game needs - the cards as a board draws them, plus the furniture no game here has needed yet: a cribbage board, chips, seats, presence. Nothing on them opens a socket or holds a game, so they can be loaded, screenshotted and cut up for assets without a room to play in.

The demos

Each one is a table laid for a game that has not been built yet.

The deck

Every face comes from public/cards.svg, addressed by fragment - a card is a div with data-name and data-suit on it and no contents at all. The demos use the same element the board does, so a face that is wrong here is wrong in a game.

Clubsdata-suit="Clubs"
Diamondsdata-suit="Diamonds"
Heartsdata-suit="Hearts"
Spadesdata-suit="Spades"

Ranks

The names are the ones the engine sends - words, not numbers - because they address the sprite directly.

Spades, ace through kingdata-name="Ace" | "Two" | "Three" | "Four" | "Five" | "Six" | "Seven" | "Eight" | "Nine" | "Ten" | "Jack" | "Queen" | "King"

States a card can be in

All four are set by the server and read by the stylesheet. A card never decides any of this for itself.

Face updata-faced="up"
Face downdata-faced="down"
Highlightedthe rank a game is asking about
Matcheda pair taken, in Memory

Fans

A pile draws its cards in the same place, one on top of the last, and a fan is what spreads them out again. The step is a share of a card's own width, so it holds at any size. A pile only has to show its top card; a hand is held to be read, and shows a corner of each. Either way a fan that would run past its slot closes up until it fits - which is how a waste pile of twenty stays the width of one of three.

A pilefanned-right-upcard
A handthe same three, plus is-hand
Thirteen in a handclosed up to fit its spread
Face downa back fans like anything else

Colours

Taken from globals.scss. The felt is the page background on every route.

Felt#006300table background, dark stripe
Felt light#006600table background, light stripe
Playable slot#00cc00an empty pile cards may go to
Accent#a3e635your seat, whose turn it is, primary actions
Card back#606dbcface-down stripe
Card back dark#465298face-down stripe
Bar#1f2937game bar, seats, panels
Danger#ef4444give up, refusals, bust

Sizes

One card is 72 by 110, which is the sprite's own size. Everything else is a multiple of it.

Card, sprite size
72 x 110
Card aspect ratio
72 / 110
Card in hand
calc(110px * var(--scale-size) * 1.5)
Card in a seat row
calc(110px * var(--scale-size) * 0.7)
--scale-size
1.5
Card corner radius
calc(.25em * var(--scale-size))
Fanned pile, step per card
18% of card width
Fanned hand, step per card
55% of card width
Fanned column, step per card
25% of card height
Fanned column, face-down card
5% of card height
A fan may run past its slot by
1 card width, 4 in a hand
Panel radius
0.75rem