Skip to content

Commit

Permalink
pretty up the food left counter
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaima committed Mar 25, 2018
1 parent 53020e9 commit fdbb8cd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion display/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* Full2DBoard, Full3DBoard */

.TAR {
text-align:right;
}
.game-board, .game-board-3d {
position: relative;
}
Expand Down
17 changes: 11 additions & 6 deletions games/common/components/LeaderboardDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ define([

if(includeThinkingTime) {
allColumns.push({
title: "Food Left: ----",
className: "foodLeftCell",
title: "Food Left:",
className: "TAR",
nested: [{
title: 'Thinking Time',
attribute: 'time',
className: "thinkingTime",
}]
});
this.flatColumns.push({
Expand All @@ -81,9 +82,13 @@ define([
className: 'player',
attribute: 'name',
}, ...allColumns, {
title: 'Score',
attribute: 'score',
className: 'result',
title: "----",
className: "foodLeftCell",
nested: [{
title: 'Score',
attribute: 'score',
className: 'result',
}]
}, {
title: 'show',
attribute: 'showHover',
Expand Down Expand Up @@ -194,7 +199,7 @@ define([
updateState(state) {
this.latestState = state;
try {
document.getElementsByClassName("foodLeftCell")[0].innerText = "Food Left: " + state.foodLeft
document.getElementsByClassName("foodLeftCell")[0].innerText = state.foodLeft
} catch (e) {}
this.rerenderData();
}
Expand Down

0 comments on commit fdbb8cd

Please sign in to comment.