css fixes for score containers

This commit is contained in:
Lurkars
2017-04-22 09:54:06 +02:00
parent 1fb2baed25
commit d57d531e53
3 changed files with 51 additions and 20 deletions
+4 -6
View File
@@ -162,22 +162,20 @@ Interface.prototype.setPlaying = function(playing) {
Interface.prototype.setPlayer = function(player) { Interface.prototype.setPlayer = function(player) {
this.playerScore.innerHTML = player.score; this.playerScore.innerHTML = player.score;
var zilchs = " "; var zilchs = '';
for (var i = 0; i < player.zilch; i++) { for (var i = 0; i < player.zilch; i++) {
zilchs += "&#x25FE;" zilchs += '<div class="point"></div>';
} }
zilchs += "&nbsp;";
this.playerZilch.innerHTML = zilchs; this.playerZilch.innerHTML = zilchs;
}; };
Interface.prototype.setCpu = function(cpu) { Interface.prototype.setCpu = function(cpu) {
this.cpuScore.innerHTML = cpu.score; this.cpuScore.innerHTML = cpu.score;
var zilchs = "&nbsp;"; var zilchs = '';
for (var i = 0; i < cpu.zilch; i++) { for (var i = 0; i < cpu.zilch; i++) {
zilchs += "&#x25FE;" zilchs += '<div class="point"></div>';
} }
zilchs += "&nbsp;";
this.cpuZilch.innerHTML = zilchs; this.cpuZilch.innerHTML = zilchs;
}; };
+41 -10
View File
@@ -69,20 +69,18 @@ hr {
} }
.top { .top {
position: relative;
text-align: center; text-align: center;
height: 75px; height: 75px;
margin-bottom: 25px; margin-bottom: 25px;
} }
.top .button { .top .button {
position: relative; margin-top: 18px;
top: -18px;
margin: 0 88px;
} }
.score-container { .score-container {
color: gray; color: gray;
position: relative;
display: inline-block; display: inline-block;
width: 85px; width: 85px;
height: 75px; height: 75px;
@@ -91,6 +89,18 @@ hr {
text-align: center; text-align: center;
} }
#player-score-container {
position: absolute;
top: 0;
left: 0;
}
#cpu-score-container {
position: absolute;
top: 0;
right: 0;
}
.score-container .label { .score-container .label {
font-size: 13px; font-size: 13px;
line-height: 13px; line-height: 13px;
@@ -109,13 +119,22 @@ hr {
} }
.score-container .zilch { .score-container .zilch {
color: gray; display: block;
font-size: 18px; width: 100%;
line-height: 25px; height: 25px;
text-align: center;
} }
.score-container.active .zilch { .score-container .zilch .point {
color: #f9f6f2; background-color: gray;
display: inline-block;
width: 8px;
height: 8px;
margin: 0px 3px;
}
.score-container.active .zilch .point {
background-color: #f9f6f2;
} }
.dices-container { .dices-container {
@@ -289,11 +308,24 @@ hr {
} }
.action { .action {
position: relative;
margin-top: 25px; margin-top: 25px;
height: 75px; height: 75px;
text-align: center; text-align: center;
} }
#points-button {
position: absolute;
top: 18px;
left: 0px;
}
#dices-button {
position: absolute;
top: 18px;
right: 0px;
}
.pointsContainer { .pointsContainer {
position: relative; position: relative;
display: inline-block; display: inline-block;
@@ -303,7 +335,6 @@ hr {
color: #776e65; color: #776e65;
border-radius: 3px; border-radius: 3px;
text-align: center; text-align: center;
margin: 0 48px;
} }
.pointsContainer .label { .pointsContainer .label {
+6 -4
View File
@@ -15,7 +15,7 @@
padding: 0 3px; padding: 0 3px;
} }
.top .button { .top .button {
margin: 0 5px; margin-top: 10px;
} }
.score-container { .score-container {
width: 75px; width: 75px;
@@ -48,13 +48,15 @@
height: 75px; height: 75px;
text-align: center; text-align: center;
} }
.action .button { #points-button {
margin-top: 15px; top: 10px;
}
#dices-button {
top: 10px;
} }
.pointsContainer { .pointsContainer {
width: 75px; width: 75px;
height: 60px; height: 60px;
margin: 0 5px;
} }
.pointsContainer .points { .pointsContainer .points {
font-size: 20px; font-size: 20px;