From b5ade7f012526574d4ba2f3b203686a5a2e3d713 Mon Sep 17 00:00:00 2001 From: Mashy Date: Fri, 22 Nov 2019 09:56:29 +1000 Subject: [PATCH] combo preview styling --- client/assets/styles/instance.less | 26 +++++++++++++++-------- client/assets/styles/styles.mobile.less | 10 +++------ client/src/components/info.component.jsx | 20 +++++++++-------- client/src/components/info.thresholds.jsx | 11 ++++++++-- 4 files changed, 40 insertions(+), 27 deletions(-) diff --git a/client/assets/styles/instance.less b/client/assets/styles/instance.less index cb7e062c..d9bf96c8 100644 --- a/client/assets/styles/instance.less +++ b/client/assets/styles/instance.less @@ -35,34 +35,36 @@ margin-left: 1em; grid-area: info; display: grid; - grid-template-rows: 1fr; - grid-template-columns: 20em 1fr; + grid-template-columns: 1fr min-content; grid-template-areas: - "combos item"; + "item combos"; + .info-item { + grid-area: item; + } .combos { - - margin-right: 1em; display: grid; grid-area: combos; + margin-left: 0.5em; grid-template-rows: min-content min-content; grid-template-areas: "comboHeader" "comboList"; .combo-header { - font-size: 1.25em; + text-align: center; } .combo-list { display: grid; grid-template-rows: min-content min-content min-content; - grid-template-columns: 1fr 1fr; - grid-gap: 1em; + grid-template-columns: min-content min-content; + grid-gap: 0.5em; + margin-top: 0.5em; + .table-button { display: grid; text-align: center; align-content: center; - grid-template-areas: "item" "ingr"; @@ -79,11 +81,17 @@ flex: 1; grid-area: item; font-weight: bold; + div { + width: 5em; + } } + div { border-left: 2px solid #222; border-right: 2px solid #222; + height: 1.75em; + width: 7.5em; svg { vertical-align: middle; } diff --git a/client/assets/styles/styles.mobile.less b/client/assets/styles/styles.mobile.less index 6e1b8cba..2eba09ac 100644 --- a/client/assets/styles/styles.mobile.less +++ b/client/assets/styles/styles.mobile.less @@ -10,14 +10,10 @@ .instance { font-size: 7.5pt; - grid-template-columns: 1fr; - grid-template-rows: min-content 1fr; - - grid-template-areas: - "vbox" - "constructs"; .info { - display: none; + .combos { + display: none; + } } svg { stroke-width: 1.25em; diff --git a/client/src/components/info.component.jsx b/client/src/components/info.component.jsx index c711429a..f60b658e 100644 --- a/client/src/components/info.component.jsx +++ b/client/src/components/info.component.jsx @@ -132,7 +132,7 @@ class InfoComponent extends preact.Component { const Combos = () => { if (tutorial && instance.time_control === 'Practice' && instance.rounds.length === 1) return false; - const generalNotes = ( +/* const generalNotes = (

General

@@ -140,12 +140,12 @@ class InfoComponent extends preact.Component { Click the READY button to start the GAME PHASE.

- ); - if (!player) return generalNotes; - if (!info) return generalNotes; + );*/ + if (!player) return false; + if (!info) return false; const vboxCombos = itemInfo.combos.filter(c => c.components.includes(info)); - if (vboxCombos.length > 6 || vboxCombos.length === 0) return generalNotes; + if (vboxCombos.length > 6 || vboxCombos.length === 0) return false; const comboTable = vboxCombos.map((c, i) => { const mouseOver = e => { @@ -157,7 +157,7 @@ class InfoComponent extends preact.Component {
{convertItem(c.components[2])}
] : c.components.map((u, j) =>
{convertItem(u)}
); return ( -
setInfo(c.item)}> +
{convertItem(c.item)}
@@ -165,12 +165,14 @@ class InfoComponent extends preact.Component {
); }); + const comboList = comboTable.length > 0 ?
{comboTable}
: false; return (
-
COMBOS
-
- {comboTable} +
+

COMBOS

+ Combine colours and items.
+ {comboList}
); }; diff --git a/client/src/components/info.thresholds.jsx b/client/src/components/info.thresholds.jsx index 7136a855..930882bd 100644 --- a/client/src/components/info.thresholds.jsx +++ b/client/src/components/info.thresholds.jsx @@ -87,9 +87,16 @@ function specThresholds(player, fullInfo, info) { ); }); return ( -
- {thresholds} +
+
+ {thresholds[0]} + {thresholds[1]} +
+
+ {thresholds[2]} +
+ ); }