Skip to content

Commit

Permalink
#22 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ondras committed May 16, 2023
1 parent 6803a3a commit e8e5027
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
6 changes: 6 additions & 0 deletions client/client.css
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ button:disabled {
padding: 8px 0;
border-bottom: 1px solid #000;
}
#game .pool h2 {
font-size: inherit;
width: calc(var(--tile-size) * 1px);
margin: 0;
align-self: center;
}
#game .pool .dice {
border: 1px solid #000;
border-radius: 6px;
Expand Down
9 changes: 6 additions & 3 deletions client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1651,9 +1651,12 @@ class HTMLDice extends Dice {

const MAX_BONUSES = 3;
class Pool {
constructor() {
constructor(label) {
this.node = node("div", { className: "pool" });
this._dices = [];
let heading = node("h2", { className: "heading" });
heading.append(label);
this.node.append(heading);
}
get remaining() {
return this._dices.filter(d => d.mandatory && !d.disabled && !d.blocked);
Expand Down Expand Up @@ -1698,7 +1701,7 @@ class Pool {
}
class BonusPool extends Pool {
constructor() {
super();
super("Special Routes");
this._used = 0;
this._locked = false;
this.node.classList.add("bonus");
Expand Down Expand Up @@ -1766,7 +1769,7 @@ class Round {
this._endButton = node("button");
this._placedDice = new Map();
this._lastClickTs = 0;
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
6 changes: 3 additions & 3 deletions src/client/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ 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)
let heading = html.node("h2", {className:"heading"});
heading.append(label);
this.node.append(heading);
}

get remaining() {
Expand Down
5 changes: 0 additions & 5 deletions src/css/app.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ h1, h2 {
margin-bottom: 0;
}

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

body {
font-family: sans-serif;
margin: 0;
Expand Down
7 changes: 7 additions & 0 deletions src/css/game.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
padding: 8px 0;
border-bottom: 1px solid #000;

h2 {
font-size: inherit;
width: calc(var(--tile-size) * 1px);
margin: 0;
align-self: center;
}

.dice {
border: 1px solid #000;
border-radius: 6px;
Expand Down

0 comments on commit e8e5027

Please sign in to comment.