From cdd45894ce8316982b6773b831ea7a255d856e05 Mon Sep 17 00:00:00 2001 From: ntr Date: Sun, 31 Mar 2019 16:23:55 +1100 Subject: [PATCH] moar styles --- html-client/cryps.css | 22 +++++++- html-client/src/components/game.component.jsx | 55 ++++++++++++------- .../src/components/instance.component.jsx | 8 +-- html-client/src/events.jsx | 2 +- 4 files changed, 58 insertions(+), 29 deletions(-) diff --git a/html-client/cryps.css b/html-client/cryps.css index ad8ae80c..3ee0091f 100755 --- a/html-client/cryps.css +++ b/html-client/cryps.css @@ -6,7 +6,7 @@ body { font-family: 'Jura'; color: whitesmoke; font-size: 16pt; - padding: 1em 2em; + padding: 0 2em; /*overflow: hidden;*/ user-select: none; } @@ -18,6 +18,7 @@ button, input { border-width: 2px; border-color: whitesmoke; border-radius: 0; + letter-spacing: 0.25em; } /*colour necesary to bash skellington*/ @@ -31,7 +32,7 @@ button:hover { MENU */ .header { - margin-bottom: 1.5em; + margin-bottom: 1em; } .menu-cryps { @@ -73,6 +74,7 @@ button:hover { .header-username { display: inline; + letter-spacing: 0.25em; } .header-status { @@ -133,6 +135,8 @@ button:hover { box-shadow: 0 0 0px black; } 100% { + background: whitesmoke; + color: black; box-shadow: 0 0 -30px black; } } @@ -201,6 +205,11 @@ button:hover { min-width: 100%; } +.cryp-list { + display: flex; + flex-flow: column; +} + /* CRYP BOX */ .cryp-box { display: flex; @@ -210,7 +219,7 @@ button:hover { this controls the size of the box as it fills the whole container */ - margin: 0 1em 1em 0; + margin: 0 0 1em 0; border: 1px solid whitesmoke; } @@ -270,3 +279,10 @@ button:hover { border-top-width: 0; } + +/* GAME */ + +.cryp-skill-btn.active { + animation: whiteblackglow 1s ease 0s 1 normal forwards; + animation-iteration-count: 1; +} \ No newline at end of file diff --git a/html-client/src/components/game.component.jsx b/html-client/src/components/game.component.jsx index 85ebbf57..97979a65 100644 --- a/html-client/src/components/game.component.jsx +++ b/html-client/src/components/game.component.jsx @@ -25,12 +25,27 @@ function GamePanel(props) { const playerTeam = game.teams.find(t => t.id === account.id); function Cryp(cryp) { - const skills = range(0, 4).map((i) => { + const skills = range(0, 4).map(i => { const s = cryp.skills[i] ? cryp.skills[i].skill : ( ); - return ; + const highlight = activeSkill + ? activeSkill.crypId === cryp.id && activeSkill.skill === s + : false; + + if (activeSkill) { + console.log(cryp.id, s, highlight); + } + + return ( + + ); }); const stats = [ @@ -45,7 +60,11 @@ function GamePanel(props) { )); return ( -
+
selectIncomingTarget(cryp.id)} + className="cryp-box" >
{molecule}
{cryp.name}
@@ -60,22 +79,11 @@ function GamePanel(props) { ); } - function PlayerCryp(cryp) { - return ( -
selectIncomingTarget(cryp.id)}> - {Cryp(cryp, setActiveSkill)} -
- ); - } - function PlayerTeam(team) { - const cryps = team.cryps.map(c => PlayerCryp(c, setActiveSkill)); + const cryps = team.cryps.map(c => Cryp(c)); return ( -
+
{cryps}
); @@ -94,7 +102,11 @@ function GamePanel(props) { )); return ( -
+
selectSkillTarget(cryp.id)} >
{molecule}
{cryp.name}
@@ -116,7 +128,7 @@ function GamePanel(props) { ); } - const logs = game.log.reverse().map((l, i) => (
{l}
)); + const logs = game.log.map((l, i) => (
{l}
)).reverse(); return (
@@ -133,10 +145,11 @@ function GamePanel(props) {
-
- {PlayerTeam(playerTeam, setActiveSkill)} + {PlayerTeam(playerTeam, setActiveSkill)} +
+
 
-
+
{otherTeams.map(OpponentTeam)}
diff --git a/html-client/src/components/instance.component.jsx b/html-client/src/components/instance.component.jsx index 6c77f900..1775fcc1 100644 --- a/html-client/src/components/instance.component.jsx +++ b/html-client/src/components/instance.component.jsx @@ -68,12 +68,12 @@ function InstanceComponent(args) { Menu
-
+
 
-
+
@@ -81,7 +81,7 @@ function InstanceComponent(args) {
-
+
{cryps}
diff --git a/html-client/src/events.jsx b/html-client/src/events.jsx index aba3afc9..5b205fec 100644 --- a/html-client/src/events.jsx +++ b/html-client/src/events.jsx @@ -29,7 +29,7 @@ function registerEvents(store) { } function setActiveSkill(skill) { - console.log('EVENT ->', 'activeSkill', skill); + store.dispatch(actions.setActiveSkill(null)); } function setMenu() {