From 2b4f7de097f4958a67076233698883114c03e90d Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 28 Mar 2019 17:25:00 +1100 Subject: [PATCH] vbox accept --- html-client/cryps.css | 124 ++++++++++-------- html-client/src/components/vbox.component.jsx | 27 ++-- html-client/src/components/vbox.container.jsx | 5 + 3 files changed, 91 insertions(+), 65 deletions(-) diff --git a/html-client/cryps.css b/html-client/cryps.css index 544ffc06..64cdc5da 100644 --- a/html-client/cryps.css +++ b/html-client/cryps.css @@ -1,3 +1,6 @@ +/* + GLOBAL +*/ body { background-color: #000000; font-family: 'Jura'; @@ -22,6 +25,66 @@ button:hover { border-color: whitesmoke; } +/* + MENU +*/ +.header { + margin-bottom: 2em; +} + +.home-cryp { +} + +.background { + min-height: 100%; + min-width: 100%; + position: absolute; + z-index: -1000; + background-color: #000000 +} + +.cryps-title { + font-size: 200%; + display: inline; +} + +.login { + display: inline; + margin-right: 0; +} + +.header-username { + display: inline; +} + +.header-status { + text-align: right; +} + +.ping-svg { + background-color: black; + height: 1em; + margin-right: 1em; +} + +.ping-path { + stroke: #f5f5f5; + fill: none; + stroke-width: 4; + stroke-dasharray: 121, 242; + animation: pulse 2s infinite linear; +} + +@keyframes pulse { + 0% { + stroke-dashoffset: 363; + } + 100% { + stroke-dashoffset: 0; + } +} + + @keyframes whiteglow { 0% { box-shadow: 0 0 0px whitesmoke; @@ -57,6 +120,9 @@ button:hover { } } +/* + INSTANCE +*/ .green-btn:hover { animation: greenglow 2s ease 0s 1 normal forwards; animation-iteration-count: 1; @@ -81,6 +147,7 @@ button:hover { padding: 0.5em; background-color: whitesmoke; color: black; + user-select: none; } .vbox-btn:hover { @@ -88,39 +155,6 @@ button:hover { animation: whiteblackglow 2s ease 0s 1 normal forwards; } -.header { - margin-bottom: 2em; -} - -.home-cryp { -} - -.background { - min-height: 100%; - min-width: 100%; - position: absolute; - z-index: -1000; - background-color: #000000 -} - -.cryps-title { - font-size: 200%; - display: inline; -} - -.login { - display: inline; - margin-right: 0; -} - -.header-username { - display: inline; -} - -.header-status { - text-align: right; -} - .vbox-table { table-layout: fixed; width: 100%; @@ -131,35 +165,13 @@ button:hover { padding: 0.5em; text-align: center; height: 40px; + cursor: pointer; } .vbox-table th:first-child, td:first-child { padding: 0.5em; } -.ping-svg { - background-color: black; - height: 1em; - margin-right: 1em; -} - -.ping-path { - stroke: #f5f5f5; - fill: none; - stroke-width: 4; - stroke-dasharray: 121, 242; - animation: pulse 2s infinite linear; -} - -@keyframes pulse { - 0% { - stroke-dashoffset: 363; - } - 100% { - stroke-dashoffset: 0; - } -} - .spacer { min-width: 100%; } \ No newline at end of file diff --git a/html-client/src/components/vbox.component.jsx b/html-client/src/components/vbox.component.jsx index 15c1d000..20e32d02 100644 --- a/html-client/src/components/vbox.component.jsx +++ b/html-client/src/components/vbox.component.jsx @@ -9,6 +9,7 @@ function Vbox(args) { const { instance, combiner, + sendVboxAccept, sendVboxDiscard, sendVboxReclaim, sendVboxCombine, @@ -18,17 +19,25 @@ function Vbox(args) { if (!instance.vbox) return false; const free = []; - for (let i = 0 ; i < vbox.free[0].length; i++) { + for (let i = 0 ; i < 6; i++) { free.push([vbox.free[0][i], vbox.free[1][i], vbox.free[2][i]]); } - const freeRows = free.map((row, i) => ( - - {convertVar(row[0])} - {convertVar(row[1])} - {convertVar(row[2])} - - )); + const freeRows = free.map((row, i) => { + const cells = row.map((c, j) => ( + c && sendVboxAccept(j, i)} > + {convertVar(c)} + + )); + + return ( + + {cells} + + ); + }); const boundRows = [ @@ -62,7 +71,7 @@ function Vbox(args) { return (
- vBox +

vBox - {vbox.bits}b