Skip to content

Commit

Permalink
Merge pull request #22 from VickiLanger/add-headings-to-dice-pools
Browse files Browse the repository at this point in the history
Add headings to dice pools
  • Loading branch information
ondras authored May 16, 2023
2 parents 07df8c0 + b54fd53 commit 6803a3a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/client/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ const MAX_BONUSES = 3;
export default class Pool {
node: HTMLElement = html.node("div", {className:"pool"});
_dices: HTMLDice[] = [];
poolHeading: HTMLHeadingElement = html.node("h2", {className:"heading"});

constructor(label: string) {
label: this.poolHeading
this.node.prepend(label)
}

get remaining() {
return this._dices.filter(d => d.mandatory && !d.disabled && !d.blocked);
Expand Down Expand Up @@ -59,7 +65,7 @@ export class BonusPool extends Pool {
_locked = false;

constructor() {
super();
super("Special Routes");
this.node.classList.add("bonus");

["cross-road-road-rail-road", "cross-road-rail-rail-rail", "cross-road",
Expand Down
2 changes: 1 addition & 1 deletion src/client/round.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class Round {
_lastClickTs = 0;

constructor(readonly number: number, readonly _board: Board, readonly _bonusPool: BonusPool) {
this._pool = new Pool();
this._pool = new Pool(`Round #${this.number} Routes`);
this.node = this._pool.node;

this._endButton.textContent = `End round #${this.number}`;
Expand Down
5 changes: 5 additions & 0 deletions src/css/app.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ h1, h2 {
margin-bottom: 0;
}

h2 {
font-size: inherit;
width: calc(var(--tile-size) * 1px);
}

body {
font-family: sans-serif;
margin: 0;
Expand Down

0 comments on commit 6803a3a

Please sign in to comment.