diff --git a/html-client/cryps.css b/html-client/cryps.css index 09931dec..ba806305 100644 --- a/html-client/cryps.css +++ b/html-client/cryps.css @@ -63,16 +63,15 @@ button:hover { text-align: right; } -.ping-svg { - background-color: black; - height: 1em; +.header-status svg { margin-left: 1em; + height: 1em; + background-color: black; } .ping-path { - stroke: #f5f5f5; fill: none; - stroke-width: 4; + stroke-width: 4px; stroke-dasharray: 121, 242; animation: pulse 2s infinite linear; } @@ -194,7 +193,11 @@ button:hover { .cryp-box { display: flex; flex-wrap: wrap; - padding: 0; + /* + this controls the size of the box + as it fills the whole container + */ + padding: 0 2em 0 0; margin: 0 0 2em 0; } @@ -208,20 +211,33 @@ button:hover { width: 50%; } -.cryp-skill-btn:first-child { - margin: 0 0 0 -1px; -} - .cryp-skill-btn { font-size: 125%; border-width: 1px; width: 100%; height: 25%; padding: 0; - margin: -1px 0 0 -1px; + margin: 0; + border-left-width: 0px; + border-bottom-width: 0px; +} + +.cryp-skill-btn:last-child { + border-bottom-width: 1px; } .cryp-box .stats { + display: flex; width: 100%; + text-align: center; } +.cryp-box .stats figure { + border-top-width: 0; + flex: 1 1 0; +} + +.cryp-box .stats svg { + height: 1em; + stroke-width: 2px; +} diff --git a/html-client/src/components/instance.component.jsx b/html-client/src/components/instance.component.jsx index 98269b8d..9364f044 100644 --- a/html-client/src/components/instance.component.jsx +++ b/html-client/src/components/instance.component.jsx @@ -1,24 +1,33 @@ const preact = require('preact'); // const key = require('keymaster'); +const range = require('lodash/range'); const VboxContainer = require('./vbox.container'); const molecule = require('./molecule'); +const saw = require('./saw.component'); function Cryp(cryp) { - const skills = cryp.skills.map((s, i) => ( - - )); + const skills = range(0, 4).map((i) => { + const s = cryp.skills[i] + ? cryp.skills[i].skill + : ( ); + + return ; + }); const stats = [ - 'hp', - 'green_damage', - 'red_shield', - 'red_damage', - 'blue_damage', - 'blue_shield', - 'speed', + { stat: 'hp', colour: '#1FF01F' }, + { stat: 'green_damage', colour: '#1FF01F' }, + { stat: 'red_shield', colour: '#a52a2a' }, + { stat: 'red_damage', colour: '#a52a2a' }, + { stat: 'blue_shield', colour: '#3498db' }, + { stat: 'blue_damage', colour: '#3498db' }, + { stat: 'speed', colour: '#FFD123' }, ].map((s, i) => ( - {cryp[s].stat} {cryp[s].value} +
+ {saw(s.colour)} +
{cryp[s.stat].value}
+
)); return ( @@ -46,7 +55,7 @@ function InstanceComponent(args) { if (!instance) return
...
; - let cryps = instance.cryps.map(Cryp); + const cryps = instance.cryps.map(Cryp); return (
diff --git a/html-client/src/components/login.component.jsx b/html-client/src/components/login.component.jsx index 68b05fdf..475f5fa4 100755 --- a/html-client/src/components/login.component.jsx +++ b/html-client/src/components/login.component.jsx @@ -1,14 +1,13 @@ // eslint-disable-next-line const preact = require('preact'); +const saw = require('./saw.component'); + function renderLogin({ account, submitLogin, submitRegister }) { if (account) return (

{account.name}

- - - - + {saw('whitesmoke')}
); diff --git a/html-client/src/components/saw.component.jsx b/html-client/src/components/saw.component.jsx new file mode 100644 index 00000000..e9ba3aa8 --- /dev/null +++ b/html-client/src/components/saw.component.jsx @@ -0,0 +1,10 @@ +const preact = require('preact'); + +module.exports = function saw(colour) { + return ( + + + + + ); +}