instance cryp now grid

This commit is contained in:
Mashy 2019-05-11 15:31:52 +10:00
parent 80e1d4a358
commit b940e63a5c
4 changed files with 60 additions and 47 deletions

View File

@ -131,7 +131,6 @@ button.action {
} }
svg { svg {
flex: 1; flex: 1;
fill: none; fill: none;
@ -162,6 +161,23 @@ table td {
text-transform: uppercase; text-transform: uppercase;
} }
table td svg {
stroke-width: 2px;
height: 96%;
vertical-align: text-bottom;
}
table .highlight {
background: whitesmoke;
color: black;
font-weight: bold;
}
button[disabled] {
color: #333;
border-color: #333;
}
/* /*
COLOURS COLOURS
*/ */

View File

@ -121,17 +121,6 @@
margin: 0; margin: 0;
} }
table .highlight {
background: whitesmoke;
color: black;
font-weight: bold;
}
button[disabled] {
color: #333;
border-color: #333;
}
.vbox-btn:active, .vbox-btn:hover, .vbox-btn:focus { .vbox-btn:active, .vbox-btn:hover, .vbox-btn:focus {
color: black; color: black;
} }
@ -183,70 +172,76 @@ button[disabled] {
color: black; color: black;
} }
table td svg {
stroke-width: 2px;
height: 96%;
vertical-align: text-bottom;
}
.spacer { .spacer {
flex: 1 0 25%; flex: 1 0 25%;
} }
/* CRYP BOX */ /* CRYP BOX */
.instance-cryp { .instance-cryp {
flex: 1 1 auto; display: grid;
grid-template-columns: repeat(5, 1fr);
grid-template-rows: repeat(4, 1fr);
grid-template-areas:
"av av av sk sk"
"av av av sk sk"
"av av av sk sk"
"sp sp sp sp sp";
display: flex;
flex-flow: column;
border: 1px solid whitesmoke;
margin-left: 1em;
max-width: 350px; max-width: 350px;
max-height: 350px;
margin-left: 1em;
border: 1px solid whitesmoke;
transition-property: all; transition-property: all;
transition-duration: 0.5s; transition-duration: 0.5s;
transition-delay: 0; transition-delay: 0;
transition-timing-function: ease; transition-timing-function: ease;
} }
.instance-cryp-top { .instance-cryp .avatar {
grid-area: av;
display: flex; display: flex;
flex: 1 1 auto; flex: 1 1 auto;
width: 100%;
justify-content: center; justify-content: center;
align-items: stretch;
} }
.instance-cryp figure { .instance-cryp .avatar figure {
margin: 0; margin: 0;
flex: 0 0 50%; height: 75%;
text-align: center; text-align: center;
box-sizing: border-box; box-sizing: border-box;
display: flex;
flex-flow: column;
justify-content: flex-end;
} }
.instance-cryp .stats { .instance-cryp .avatar figcaption {
flex: 0 0 20%; font-size: 90%;
width: 100%; }
.instance-cryp .specs {
grid-area: sp;
display: flex; display: flex;
flex: 1;
justify-content: center;
border-top: 1px solid whitesmoke; border-top: 1px solid whitesmoke;
} }
.stats figure { .instance-cryp .specs figure {
flex: 1 1 0; flex: 1;
border: 0; border: 0;
align-items: center; align-items: center;
padding: 0.5em 0 0 0; padding: 0.5em 0 0 0;
text-align: center;
} }
.instance-cryp .stats figcaption { .instance-cryp .specs figcaption {
font-size: 75%; font-size: 75%;
} }
.instance-cryp .skills { .instance-cryp .skills {
grid-area: sk;
display: flex; display: flex;
flex-flow: row wrap; flex-flow: column;
flex: 1 1 50%; }
height: 100%;
.instance-cryp .skills button {
height: 100%;
width: 100%;
} }

View File

@ -76,7 +76,9 @@ function Cryp(props) {
} }
const classes = `right ${skill ? '' : 'action'}`; const classes = `right ${skill ? '' : 'action'}`;
return <button key={i} className={classes} onClick={skillClick} >{s}</button>; return (
<button key={i} className={classes} onClick={skillClick} >{s}</button>
);
}); });
function onClick(e) { function onClick(e) {
@ -133,16 +135,16 @@ function Cryp(props) {
return ( return (
<div key={cryp.id} className="instance-cryp" onClick={onClick} > <div key={cryp.id} className="instance-cryp" onClick={onClick} >
<div className="instance-cryp-top"> <div className="avatar">
<figure className="img"> <figure className="img">
{crypAvatar(cryp.name)} {crypAvatar(cryp.name)}
<figcaption>{cryp.name}</figcaption> <figcaption>{cryp.name}</figcaption>
</figure> </figure>
</div>
<div className="skills"> <div className="skills">
{skills} {skills}
</div> </div>
</div> <div className="specs">
<div className="stats">
{specs} {specs}
</div> </div>
</div> </div>

View File

@ -275,7 +275,7 @@ impl Instance {
fn next_round(&mut self) -> &mut Instance { fn next_round(&mut self) -> &mut Instance {
self.phase = InstancePhase::InProgress; self.phase = InstancePhase::InProgress;
self.phase_end = Utc::now() self.phase_end = Utc::now()
.checked_add_signed(Duration::seconds(150)) .checked_add_signed(Duration::seconds(15000))
.expect("could not set phase end"); .expect("could not set phase end");