no time control for practice

This commit is contained in:
ntr
2019-06-09 17:38:25 +10:00
parent 39501c167a
commit 1070d3482a
8 changed files with 117 additions and 40 deletions
+13 -4
View File
@@ -333,11 +333,11 @@
height: 2px;
transform-origin: center;
background-color: whitesmoke;
animation: equipping-skill 2s infinite ease alternate;
animation: equipping-skill 2s infinite ease-out alternate;
opacity: 0;
}
.equipping::after, .equip-spec::after {
.equipping::after {
content: '';
position: absolute;
bottom: 2px;
@@ -346,7 +346,7 @@
height: 2px;
transform-origin: center;
background-color: whitesmoke;
animation: equipping-skill 2s infinite ease alternate;
animation: equipping-skill 2s infinite ease-out alternate;
opacity: 0;
animation-delay: 0.75s
}
@@ -373,7 +373,16 @@
}
.equip-spec::after {
animation-delay: 0;
content: '';
position: absolute;
bottom: 2px;
left: 50%;
width: 100%;
height: 2px;
transform-origin: center;
background-color: whitesmoke;
animation: equipping-skill 2s infinite ease-out alternate;
opacity: 0;
}
.equip .specs figcaption {
+8 -6
View File
@@ -108,7 +108,7 @@ function GameFooter(props) {
const now = Date.now();
const end = Date.parse(game.phase_end);
const timerPct = ((now - zero) / (end - zero) * 100);
const displayPct = resolution || game.phase === 'Finish'
const displayPct = resolution || game.phase === 'Finish' || !game.phase_end
? 0
: Math.min(timerPct, 100);
@@ -123,11 +123,13 @@ function GameFooter(props) {
background: displayColour,
};
const timer = (
<div class="timer-container">
<div class="timer" style={timerStyles} >&nbsp;</div>
</div>
);
const timer = game.phase_end
? (
<div class="timer-container">
<div class="timer" style={timerStyles} >&nbsp;</div>
</div>
)
: null;
return (
<footer>
@@ -67,7 +67,7 @@ class InstanceCreateForm extends Component {
placeholder="game name"
onInput={this.nameInput}
/>
<label htmlFor="pveSelect">Practice Mode - Bo10, vs CPU, 2x turn time</label>
<label htmlFor="pveSelect">Practice Mode - Bo10, vs CPU, no time control</label>
<input id="pveSelect"
type="checkbox"
disabled={disabled}
+3 -1
View File
@@ -94,7 +94,9 @@ function Instance(args) {
const zero = Date.parse(instance.phase_start);
const now = Date.now();
const end = Date.parse(instance.phase_end);
const timerPct = ((now - zero) / (end - zero) * 100);
const timerPct = instance.phase_end
? ((now - zero) / (end - zero) * 100)
: 0;
const displayColour = player.ready
? 'forestgreen'