From 53ed56b62933403086dbbaa0b6e83a3f8d6ba29f Mon Sep 17 00:00:00 2001 From: Vicki Date: Mon, 15 May 2023 10:25:36 -0400 Subject: [PATCH 1/4] update Pool have an h2 with a label --- src/client/pool.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/pool.ts b/src/client/pool.ts index be5fd17..a163f72 100644 --- a/src/client/pool.ts +++ b/src/client/pool.ts @@ -9,6 +9,13 @@ 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) { + // create the

here and append it to this.node + label: this.poolHeading + this.node.prepend(label) + } get remaining() { return this._dices.filter(d => d.mandatory && !d.disabled && !d.blocked); @@ -59,7 +66,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", From a089826267417c9b3b4e706f34240c44d6e6e34a Mon Sep 17 00:00:00 2001 From: Vicki Date: Mon, 15 May 2023 10:27:08 -0400 Subject: [PATCH 2/4] include label in Pool and BonusPool instantiation --- src/client/game.ts | 2 +- src/client/round.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/game.ts b/src/client/game.ts index 1c910d4..e413bbf 100644 --- a/src/client/game.ts +++ b/src/client/game.ts @@ -5,7 +5,7 @@ const dataset = document.body.dataset; export default class Game { _node = document.querySelector("#game") as HTMLElement; - _bonusPool = new BonusPool(); + _bonusPool = new BonusPool("Special Routes"); constructor(readonly _board:Board) {} diff --git a/src/client/round.ts b/src/client/round.ts index 231f624..29b2595 100644 --- a/src/client/round.ts +++ b/src/client/round.ts @@ -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}`; From ddb69121315983d0ae563e89a261f571ae9e77ca Mon Sep 17 00:00:00 2001 From: Vicki Date: Mon, 15 May 2023 10:30:27 -0400 Subject: [PATCH 3/4] style the pool headings --- src/css/app.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/css/app.less b/src/css/app.less index df78de3..3cc6e0a 100644 --- a/src/css/app.less +++ b/src/css/app.less @@ -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; From b54fd53cf339274e4d3523eaa8acc8e89e031a18 Mon Sep 17 00:00:00 2001 From: Vicki Date: Mon, 15 May 2023 10:37:58 -0400 Subject: [PATCH 4/4] clean up --- src/client/game.ts | 2 +- src/client/pool.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/game.ts b/src/client/game.ts index e413bbf..1c910d4 100644 --- a/src/client/game.ts +++ b/src/client/game.ts @@ -5,7 +5,7 @@ const dataset = document.body.dataset; export default class Game { _node = document.querySelector("#game") as HTMLElement; - _bonusPool = new BonusPool("Special Routes"); + _bonusPool = new BonusPool(); constructor(readonly _board:Board) {} diff --git a/src/client/pool.ts b/src/client/pool.ts index a163f72..8ead13b 100644 --- a/src/client/pool.ts +++ b/src/client/pool.ts @@ -12,7 +12,6 @@ export default class Pool { poolHeading: HTMLHeadingElement = html.node("h2", {className:"heading"}); constructor(label: string) { - // create the

here and append it to this.node label: this.poolHeading this.node.prepend(label) }