From 33b519ed66cb1ca6158b1b55d778466482309c14 Mon Sep 17 00:00:00 2001 From: ntr Date: Mon, 8 Apr 2019 11:35:58 +1000 Subject: [PATCH 1/7] 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; } From 6213bdf421672808fae03ff877a2b7269ecb82a5 Mon Sep 17 00:00:00 2001 From: ntr Date: Mon, 8 Apr 2019 12:53:52 +1000 Subject: [PATCH 2/7] info updates --- client/cryps.css | 25 ++- client/src/components/info.component.jsx | 170 +++++++++++-------- client/src/components/info.container.jsx | 15 +- client/src/components/instance.component.jsx | 37 +++- client/src/components/instance.container.jsx | 12 +- client/src/components/vbox.container.jsx | 3 +- 6 files changed, 168 insertions(+), 94 deletions(-) diff --git a/client/cryps.css b/client/cryps.css index a9c65df9..c1a8772b 100644 --- a/client/cryps.css +++ b/client/cryps.css @@ -399,41 +399,50 @@ header { min-width: 300px; } +/* + INFO +*/ .thresholds { display: flex; flex-direction: row; justify-content: left; } -.info-skills { +.info-cryp .skills { display: flex; } -.info-skills .cryp-skill-btn { +.info-cryp .skills .cryp-skill-btn { border: 1px solid whitesmoke; } -.info-stats { +.info-cryp .stats, .info-cryp .specs { display: flex; flex-flow: row wrap; justify-content: space-around; } -.info-stats .speed { +.info-cryp .stats .speed { flex: 1 0 100%; } -.info-stats figure { +.info-cryp .stats figure { flex: 0 0 30%; border: 0; margin: 1em 0; text-align: center; } -.info-stats .stat-icon { +.info-cryp .stats .stat-icon { height: 2.5em; } +.info-cryp .specs figure { + border: 0; + margin: 1em 0; + text-align: center; +} + /* CRYP BOX */ .cryp-box { @@ -504,7 +513,7 @@ header { border-right-width: 0px; } -.skills .cryp-skill-btn:first-child { +.cryp-list .skills .cryp-skill-btn:first-child { border-top-width: 0; } @@ -701,7 +710,7 @@ header { height: 1em; } - .stats figcaption { + .cryp-list .stats figcaption { display: none; } diff --git a/client/src/components/info.component.jsx b/client/src/components/info.component.jsx index 82ebabd1..97098463 100644 --- a/client/src/components/info.component.jsx +++ b/client/src/components/info.component.jsx @@ -1,93 +1,92 @@ const preact = require('preact'); const range = require('lodash/range'); -const { ITEMS: { SKILLS, SPECS, COLOURS } } = require('./constants'); -const { COLOUR_ICONS, STATS } = require('../utils'); +const { ITEMS: { SKILLS, COLOURS } } = require('./constants'); +const { COLOUR_ICONS, STATS, SPECS } = require('../utils'); function Info(args) { const { + activeCryp, info, sendUnequip, instance, } = args; - if (!info.length) return (
 
); - let red = 0; let blue = 0; let green = 0; - instance.cryps.forEach(cryp => { - red += cryp.colours.red; - blue += cryp.colours.blue; - green += cryp.colours.green; - }); - const teamColours = { red, blue, green }; - const [type, value] = info; - if (type === 'item') { - let itemDetails; - if (SKILLS[value]) { - itemDetails = SKILLS[value]; - } else if (SPECS[value]) { - itemDetails = SPECS[value]; - } else if (COLOURS[value]) { - itemDetails = COLOURS[value]; - } - return ( -
- {value} - {itemDetails.description} -
- ); - } - if (type === 'skill') { - return ( -
-
+ function infoVar(info) { + let red = 0; let blue = 0; let green = 0; + instance.cryps.forEach(cryp => { + red += cryp.colours.red; + blue += cryp.colours.blue; + green += cryp.colours.green; + }); + const teamColours = { red, blue, green }; + const [type, value] = info; + if (type === 'item') { + let itemDetails; + if (SKILLS[value]) { + itemDetails = SKILLS[value]; + } else if (SPECS[value]) { + itemDetails = SPECS[value]; + } else if (COLOURS[value]) { + itemDetails = COLOURS[value]; + } + return ( +
+ {value} - {itemDetails.description} +
+ ); + } + + if (type === 'skill') { + return ( +
{value.skill}
{SKILLS[value.skill].description}
-
- ); - } + ); + } - function thresholds(t, spec) { - return ( - SPECS[spec].colours.map((c, i) => ( -
- {COLOUR_ICONS[c].svg(`stat-icon ${COLOUR_ICONS[c].colour}`)} -
{Math.min(teamColours[c], t)} / {t}
-
- )) - ); - } - - - if (type === 'spec') { - const breaks = SPECS[value.spec].thresholds ? SPECS[value.spec].thresholds.map((t, i) => { - const threshold = thresholds(t, value.spec); + function thresholds(t, spec) { return ( -
- {threshold} + SPECS[spec].colours.map((c, i) => ( +
+ {COLOUR_ICONS[c].svg(`stat-icon ${COLOUR_ICONS[c].colour}`)} +
{Math.min(teamColours[c], t)} / {t}
+
+ )) + ); + } + + + if (type === 'spec') { + const breaks = SPECS[value.spec].thresholds ? SPECS[value.spec].thresholds.map((t, i) => { + const threshold = thresholds(t, value.spec); + return ( +
+ {threshold} +
+ ); + }) : null; + return ( +
+
+
{value.spec}
+
{SPECS[value.spec].description}
+ {breaks} +
+
); - }) : null; - return ( -
-
-
{value.spec}
-
{SPECS[value.spec].description}
- {breaks} -
- -
- ); + } } - if (type === 'cryp') { - const cryp = value; - -// onClick={() => setInfo('skill', { skill: s, cryp })} + function infoCrypElement(cryp) { + // onClick={() => setInfo('skill', { skill: s, cryp })} const skills = range(0, 4).map(i => { const s = cryp.skills[i] ? cryp.skills[i].skill @@ -101,18 +100,45 @@ function Info(args) {
{cryp[s.stat].value}
)); + + const specs = cryp.specs.map((s, i) => ( +
+ {SPECS[s].svg(`stat-icon ${SPECS[s].colour}`)} +
{SPECS[s].caption}
+
+ )); + + return ( -
+
{cryp.name}
-
- {skills} -
-
+
{stats}
+
+ {specs} +
+
+ {skills} +
); } + + const infoCryp = activeCryp + ? infoCrypElement(activeCryp) + : null; + + const otherInfo = info.length + ? infoVar(info) + : null; + + return ( +
+ {infoCryp} + {otherInfo} +
+ ); } module.exports = Info; diff --git a/client/src/components/info.container.jsx b/client/src/components/info.container.jsx index 469061ff..1b098e82 100644 --- a/client/src/components/info.container.jsx +++ b/client/src/components/info.container.jsx @@ -6,12 +6,23 @@ const Info = require('./info.component'); const addState = connect( function receiveState(state) { - const { info, ws, instance } = state; + const { + activeCryp, + info, + ws, + instance, + } = state; + function sendUnequip(crypId, item) { return ws.sendVboxUnequip(instance.instance, crypId, item); } - return { info, sendUnequip, instance }; + return { + activeCryp, + info, + sendUnequip, + instance, + }; } /* function receiveDispatch(dispatch) { diff --git a/client/src/components/instance.component.jsx b/client/src/components/instance.component.jsx index 9826a901..f606262a 100644 --- a/client/src/components/instance.component.jsx +++ b/client/src/components/instance.component.jsx @@ -6,15 +6,28 @@ const VboxContainer = require('./vbox.container'); const InfoContainer = require('./info.container'); const molecule = require('./molecule'); -const shapes = require('./shapes'); -const { STATS, SPECS } = require('../utils'); +const { SPECS } = require('../utils'); + +function Cryp(props) { + const { + cryp, + sendVboxApply, + setInfo, + activeVar, + setActiveCryp, + } = props; -function Cryp(cryp, sendVboxApply, setInfo, activeVar) { const skills = range(0, 4).map(i => { const s = cryp.skills[i] ? cryp.skills[i].skill : ( ); - return ; + + function skillClick() { + setInfo('skill', { skill: s, cryp }); + setActiveCryp(cryp); + } + + return ; }); // needed for ondrop to fire @@ -35,9 +48,7 @@ function Cryp(cryp, sendVboxApply, setInfo, activeVar) { e.preventDefault(); if (activeVar !== null) return sendVboxApply(cryp.id, activeVar); - document.getElementsByClassName('instance-info')[0].scrollIntoView(); - - return setInfo('cryp', cryp); + return setActiveCryp(cryp); } const specs = cryp.specs.map((s, i) => ( @@ -75,19 +86,27 @@ function InstanceComponent(args) { // account, instance, quit, + // clearInfo, sendInstanceReady, sendVboxApply, setInfo, activeVar, setActiveVar, + setActiveCryp, } = args; if (!instance) return
...
; - const cryps = instance.cryps.map((c, i) => Cryp(c, sendVboxApply, setInfo, activeVar)); + const cryps = instance.cryps.map((c, i) => Cryp({ + cryp: c, sendVboxApply, setInfo, activeVar, setActiveCryp, + })); + + function onClick(e) { + setActiveVar(null); + } return ( -
setActiveVar(null)} > +
; diff --git a/server/WORKLOG.md b/server/WORKLOG.md index 18684573..71b3a841 100644 --- a/server/WORKLOG.md +++ b/server/WORKLOG.md @@ -19,6 +19,7 @@ *CLIENT* * general * icons change with % + * colour vbox icons * instance * cryp / vbox page separation From 0586c1cc81585c146aa2c8d35543aaa3eac4d74b Mon Sep 17 00:00:00 2001 From: ntr Date: Mon, 8 Apr 2019 13:40:02 +1000 Subject: [PATCH 5/7] manifest --- client/index.html | 2 +- client/manifest.webmanifest | 25 ++++++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/client/index.html b/client/index.html index b89ba345..1fc90760 100644 --- a/client/index.html +++ b/client/index.html @@ -8,7 +8,7 @@ - + diff --git a/client/manifest.webmanifest b/client/manifest.webmanifest index 6b9e672e..d1d84ebb 100644 --- a/client/manifest.webmanifest +++ b/client/manifest.webmanifest @@ -1,7 +1,22 @@ { - "short_name": "cryps.gg", - "name": "cryps.gg - mnml pvp atbs", - "start_url": "/index.html", - "display": "fullscreen", - "orientation": "portrait" + "name": "cryps.gg - mnml pvp atbs", + "description": "cryps.gg - mnml pvp atbs", + "short_name": "cryps.gg", + "icons": [ + { + "src": "./assets/molecules/726.svg", + "sizes": "32x32", + "type": "image/svg" + }, + { + "src": "./assets/molecules/726.svg", + "sizes": "512x512", + "type": "image/svg" + } + ], + "start_url": "/index.html", + "display": "fullscreen", + "orientation": "portrait", + "theme_color": "#000000", + "background_color": "#000000" } \ No newline at end of file From 29622d3c0c16d7a0a8fb488c882e00c085a28dec Mon Sep 17 00:00:00 2001 From: ntr Date: Mon, 8 Apr 2019 13:42:01 +1000 Subject: [PATCH 6/7] png icon --- client/assets/icons/726.png | Bin 0 -> 8665 bytes client/manifest.webmanifest | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 client/assets/icons/726.png diff --git a/client/assets/icons/726.png b/client/ass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(ZKEQsz(><{v1KYzCSvIw zSyf&kgXuu%H{F0$&wv(+dGS07pR$p8Rp-E@$@@oZr4cS;t8+jh_wte2oS zF-IYR&AM`kR5L`C54+3FK3PN&`_kzm=XIPF3rg_at29M-W`qFI1H784av!9Bx4?|^ zY)HRuw7k$uRo&q{aA_^`h3VYDbf!H}vNge6yC?p6Lw#HXsO!c=i1&5UJ_pljG+b;LMSAPJM-*-B1e-~gv?;r4Ewv||86i`n5XNC7-{PDGf zr1o{FpZ?pR`7h!2+jZZQ@m#}5)A$D!%fcSu95&el(A|RAE= Date: Mon, 8 Apr 2019 13:55:23 +1000 Subject: [PATCH 7/7] sw --- client/index.html | 9 +++++++++ client/service.worker.js | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 client/service.worker.js diff --git a/client/index.html b/client/index.html index 1fc90760..8f80d512 100644 --- a/client/index.html +++ b/client/index.html @@ -17,5 +17,14 @@ + \ No newline at end of file diff --git a/client/service.worker.js b/client/service.worker.js new file mode 100644 index 00000000..75575f15 --- /dev/null +++ b/client/service.worker.js @@ -0,0 +1,13 @@ +self.addEventListener('fetch', function(event) { + event.respondWith( + caches.match(event.request) + .then(function(response) { + // Cache hit - return response + if (response) { + return response; + } + return fetch(event.request); + } + ) + ); +}); \ No newline at end of file