From 33b519ed66cb1ca6158b1b55d778466482309c14 Mon Sep 17 00:00:00 2001 From: ntr Date: Mon, 8 Apr 2019 11:35:58 +1000 Subject: [PATCH] info skills --- client/cryps.css | 18 +++++++++++++++++- client/src/components/info.component.jsx | 14 ++++++++++++++ client/src/components/vbox.component.jsx | 16 +++++++++------- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/client/cryps.css b/client/cryps.css index e56769fd..a9c65df9 100644 --- a/client/cryps.css +++ b/client/cryps.css @@ -10,7 +10,11 @@ html, body, .cryps { font-family: 'Jura'; color: whitesmoke; font-size: 16pt; + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; /* this is the sweet nectar to keep it full page*/ height: 99%; @@ -401,6 +405,14 @@ header { justify-content: left; } +.info-skills { + display: flex; +} + +.info-skills .cryp-skill-btn { + border: 1px solid whitesmoke; +} + .info-stats { display: flex; flex-flow: row wrap; @@ -492,7 +504,7 @@ header { border-right-width: 0px; } -.cryp-skill-btn:first-child { +.skills .cryp-skill-btn:first-child { border-top-width: 0; } @@ -581,6 +593,10 @@ header { order: 99; } + header { + font-size: 0.5em; + } + .header-username { display: none; } diff --git a/client/src/components/info.component.jsx b/client/src/components/info.component.jsx index 4f81f449..82ebabd1 100644 --- a/client/src/components/info.component.jsx +++ b/client/src/components/info.component.jsx @@ -1,4 +1,6 @@ const preact = require('preact'); +const range = require('lodash/range'); + const { ITEMS: { SKILLS, SPECS, COLOURS } } = require('./constants'); const { COLOUR_ICONS, STATS } = require('../utils'); @@ -84,6 +86,15 @@ function Info(args) { if (type === 'cryp') { const cryp = value; + +// onClick={() => setInfo('skill', { skill: s, cryp })} + const skills = range(0, 4).map(i => { + const s = cryp.skills[i] + ? cryp.skills[i].skill + : ( ); + return ; + }); + const stats = Object.values(STATS).map((s, j) => (
{s.svg(`stat-icon ${s.colour}`)} @@ -93,6 +104,9 @@ function Info(args) { return (
{cryp.name}
+
+ {skills} +
{stats}
diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index 4be9e427..3c5af8cf 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -88,14 +88,11 @@ function Vbox(args) { let boundTimer; function boundTouchStart(e, i) { - e.preventDefault(); - e.stopPropagation(); + // e.preventDefault(); + // e.stopPropagation(); boundTimer = (setTimeout(() => { - const insert = combiner.findIndex(j => j === null); - if (insert === -1) return setCombiner([i, null, null]); - combiner[insert] = i; boundTimer = null; - return setCombiner(combiner); + return setActiveVar(i); }, LONG_TOUCH_TIME)); return true; } @@ -105,7 +102,12 @@ function Vbox(args) { clearTimeout(boundTimer); if (reclaiming && i) sendVboxReclaim(i); - else if (vbox.bound[i]) setActiveVar(i); + else if (vbox.bound[i]) { + const insert = combiner.findIndex(j => j === null); + if (insert === -1) return setCombiner([i, null, null]); + combiner[insert] = i; + return setCombiner(combiner); + } } return true; }