From fe4abe956bd513c9d0e064852e1327574f62f501 Mon Sep 17 00:00:00 2001 From: NilsUeter Date: Tue, 9 May 2023 17:44:32 +0200 Subject: [PATCH] more colors! --- src/App.jsx | 15 +++++++++------ src/Roster.jsx | 22 ++++++++++++++++++++++ src/index.css | 2 +- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index b67c608..cc90751 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -153,7 +153,7 @@ function App() { type="checkbox" onChange={(e) => setOnePerPage(e.target.checked)} /> - One Datacard per Page when Printing + One Datacard per Page when Printing
{roster && @@ -242,12 +242,14 @@ const getPrimaryColor = (catalog) => { return "#536766"; case "Astra Militarum": return "#375441"; - case "Chaos Daemons": - return "#536766"; + case "Chaos - Daemons": + return "#383c46"; case "Chaos Space Marines": return "#1d3138"; - case "Death Guard": - return "#536766"; + case "Chaos - World Eaters": + return "#883531"; + case "Chaos - Death Guard": + return "#5c672b"; case "Drukhari": return "#536766"; case "Genestealer Cults": @@ -275,6 +277,7 @@ const getPrimaryColor = (catalog) => { case "Ynnari": return "#536766"; default: + console.log(catalog); return "#536766"; } }; diff --git a/src/Roster.jsx b/src/Roster.jsx index c29a129..9b0ba71 100644 --- a/src/Roster.jsx +++ b/src/Roster.jsx @@ -109,6 +109,8 @@ const Unit = ({ unit, index, catalog, onePerPage }) => { !weapon.name.includes("(Melee)") ); + const overridePrimary = getOverridePrimary(factions, keywords); + return (
{ border: "2px solid var(--primary-color)", backgroundColor: "#DFE0E2", marginBottom: 32, + + "--primary-color": overridePrimary, + "--primary-color-transparent": overridePrimary + ? overridePrimary + "60" + : "", }} >
); }; + +const getOverridePrimary = (factions, keywords) => { + if ( + factions.has("Khorne") && + factions.has("Tzeentch") && + factions.has("Nurgle") && + factions.has("Slaanesh") + ) + return; + if (factions.has("Khorne") || keywords.has("Khorne")) return "#883531"; + if (factions.has("Tzeentch") || keywords.has("Tzeentch")) return "#1f3d7a"; + if (factions.has("Nurgle") || keywords.has("Nurgle")) return "#5c672b"; + if (factions.has("Slaanesh") || keywords.has("Slaanesh")) return "#634c74"; + console.log(factions); +}; diff --git a/src/index.css b/src/index.css index b0cf880..eaa803d 100644 --- a/src/index.css +++ b/src/index.css @@ -170,7 +170,7 @@ button:focus-visible { @media print { .print-display-none, - .print-display-none > * { + .print-display-none * { display: none; }