From b940e63a5c3e1f9a815a835749e1bf42509ea2a2 Mon Sep 17 00:00:00 2001 From: Mashy Date: Sat, 11 May 2019 15:31:52 +1000 Subject: [PATCH] instance cryp now grid --- client/cryps.css | 18 +++++- client/instance.css | 73 +++++++++++------------- client/src/components/instance.cryps.jsx | 14 +++-- server/src/instance.rs | 2 +- 4 files changed, 60 insertions(+), 47 deletions(-) diff --git a/client/cryps.css b/client/cryps.css index 08d4e7d8..9743f89e 100644 --- a/client/cryps.css +++ b/client/cryps.css @@ -131,7 +131,6 @@ button.action { } - svg { flex: 1; fill: none; @@ -162,6 +161,23 @@ table td { 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 */ diff --git a/client/instance.css b/client/instance.css index 9db6bbeb..3daa30bb 100644 --- a/client/instance.css +++ b/client/instance.css @@ -121,17 +121,6 @@ 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 { color: black; } @@ -183,70 +172,76 @@ button[disabled] { color: black; } -table td svg { - stroke-width: 2px; - height: 96%; - vertical-align: text-bottom; -} - .spacer { flex: 1 0 25%; } /* CRYP BOX */ .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-height: 350px; + margin-left: 1em; + border: 1px solid whitesmoke; transition-property: all; transition-duration: 0.5s; transition-delay: 0; transition-timing-function: ease; } -.instance-cryp-top { +.instance-cryp .avatar { + grid-area: av; display: flex; flex: 1 1 auto; - width: 100%; justify-content: center; - align-items: stretch; } -.instance-cryp figure { +.instance-cryp .avatar figure { margin: 0; - flex: 0 0 50%; + height: 75%; text-align: center; box-sizing: border-box; - display: flex; - flex-flow: column; - justify-content: flex-end; } -.instance-cryp .stats { - flex: 0 0 20%; - width: 100%; +.instance-cryp .avatar figcaption { + font-size: 90%; +} + +.instance-cryp .specs { + grid-area: sp; display: flex; + flex: 1; + justify-content: center; border-top: 1px solid whitesmoke; } -.stats figure { - flex: 1 1 0; +.instance-cryp .specs figure { + flex: 1; border: 0; align-items: center; padding: 0.5em 0 0 0; + text-align: center; } -.instance-cryp .stats figcaption { +.instance-cryp .specs figcaption { font-size: 75%; } .instance-cryp .skills { + grid-area: sk; display: flex; - flex-flow: row wrap; - flex: 1 1 50%; + flex-flow: column; +} + +.instance-cryp .skills button { height: 100%; -} \ No newline at end of file + width: 100%; +} diff --git a/client/src/components/instance.cryps.jsx b/client/src/components/instance.cryps.jsx index acab2baa..5e437875 100644 --- a/client/src/components/instance.cryps.jsx +++ b/client/src/components/instance.cryps.jsx @@ -76,7 +76,9 @@ function Cryp(props) { } const classes = `right ${skill ? '' : 'action'}`; - return ; + return ( + + ); }); function onClick(e) { @@ -133,16 +135,16 @@ function Cryp(props) { return (
-
+
{crypAvatar(cryp.name)}
{cryp.name}
-
- {skills} -
-
+
+ {skills} +
+
{specs}
diff --git a/server/src/instance.rs b/server/src/instance.rs index 46258fcf..f4f46c98 100644 --- a/server/src/instance.rs +++ b/server/src/instance.rs @@ -275,7 +275,7 @@ impl Instance { fn next_round(&mut self) -> &mut Instance { self.phase = InstancePhase::InProgress; self.phase_end = Utc::now() - .checked_add_signed(Duration::seconds(150)) + .checked_add_signed(Duration::seconds(15000)) .expect("could not set phase end");