This commit is contained in:
ntr 2019-05-30 12:51:12 +10:00
parent cfc3261c01
commit 6fffddd15c
5 changed files with 53 additions and 46 deletions

View File

@ -49,6 +49,8 @@
* warden
* set upkeep_at timestamp for games and instances
* log game results for analysis
## SOON
* push events

View File

@ -352,7 +352,7 @@ header {
}
/*
MENU
TEAM
*/
.menu-constructs {
@ -365,22 +365,40 @@ header {
}
.menu-constructs .list {
margin-top: 0.5em;
grid-area: list;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 1fr;
grid-gap: 0.5em;
}
.menu-construct-ctr {
/*flex: 0 0 30%;*/
.menu-construct {
height: 100%;
box-sizing: border-box;
border: 1px solid black;
display: flex;
flex-flow: column;
text-align: center;
justify-content: center;
transition-property: border;
transition-duration: 0.5s;
transition-delay: 0;
transition-timing-function: ease;
}
.spawn-btn .menu-construct {
.menu-construct:nth-child(3n) {
margin-right: 0;
}
.menu-construct:first-child, .menu-construct:nth-child(4n) {
margin-left: 0;
}
.spawn-btn.menu-construct {
border: 1px solid #333;
color: #333;
display: flex;
@ -405,17 +423,7 @@ header {
opacity: 0
}
.menu-construct {
height: 100%;
margin: 0.5em;
box-sizing: border-box;
border: 1px solid black;
transition-property: border;
transition-duration: 0.5s;
transition-delay: 0;
transition-timing-function: ease;
}
/* INSTANCE LIST */
.menu-instance-list {
flex: 1;

View File

@ -17,9 +17,7 @@ function SpawnButton({ spawn }) {
return (
<div
className="menu-construct-ctr spawn-btn">
<div
className="menu-construct"
className="menu-construct spawn-btn"
onClick={e => enabledToggle(e)} >
<h2>+</h2>
<input
@ -38,7 +36,6 @@ function SpawnButton({ spawn }) {
spawn
</button>
</div>
</div>
);
}

View File

@ -89,15 +89,12 @@ function Team(args) {
return (
<div
key={construct.id}
className="menu-construct-ctr">
<div
className="menu-construct"
style={ { 'border-color': borderColour || 'whitesmoke' } }
onClick={() => selectConstruct(construct.id)} >
{constructAvatar(construct.name, construct.id)}
<h2>{construct.name}</h2>
</div>
</div>
);
});

View File

@ -166,8 +166,11 @@ impl Game {
}
fn skill_phase_start(mut self, num_resolutions: usize) -> Game {
let phase_add_time_ms = 60000 + num_resolutions * 2500;
self.phase_start = Utc::now();
let resolution_animation_ms = num_resolutions * 2500;
let phase_add_time_ms = 60000 + resolution_animation_ms;
self.phase_start = Utc::now()
.checked_add_signed(Duration::milliseconds(resolution_animation_ms as i64))
.expect("could not set phase start");
self.phase_end = Utc::now()
.checked_add_signed(Duration::milliseconds(phase_add_time_ms as i64))
.expect("could not set phase end");