diff --git a/client/assets/styles/vbox.less b/client/assets/styles/vbox.less index ea0d9fd7..c928028b 100644 --- a/client/assets/styles/vbox.less +++ b/client/assets/styles/vbox.less @@ -1,6 +1,50 @@ .vbox { - margin-bottom: 2em; + + align-content: space-between; + grid-area: vbox; + display: grid; + grid-template-rows: min-content 3.5em min-content 1em min-content 3.5em min-content; + grid-template-columns: 7em 1em 25em; + grid-template-areas: + "shop-hdr . shop" + ". . shop" + "combiner . shop" + "combiner . ." + "combiner . stash" + ". . stash" + "stash-hdr . stash"; + + margin-bottom: 1em; line-height: 0; + + .shop { + grid-area: shop; + } + + .shop-hdr { + grid-area: shop-hdr; + display: flex; + flex-direction: column; + } + + .combiner { + grid-area: combiner; + display: flex; + flex-direction: column; + + } + + .stash { + grid-area: stash; + display: flex; + flex-direction: column; + + } + + .stash-hdr { + grid-area: stash-hdr; + } + .vbox-hdr { margin-bottom: 1em; height: 2em; @@ -104,22 +148,6 @@ } } -/* VBOX */ -.vbox { - align-content: space-between; - grid-area: vbox; - display: grid; - grid-template-rows: min-content min-content min-content; - grid-template-columns: 1fr min-content 1fr; - grid-template-areas: - "vbox varrow inventory" - "vbox varrow combiner"; -} - -.vbox-inventory { - grid-area: inventory; -} - .vbox-combiner { grid-area: combiner; display: flex; @@ -127,18 +155,6 @@ justify-content: flex-end; } -.vbox-arrow, .vbox-arrow-mobile { - display: flex; - justify-content:center; - align-content:center; - flex-direction:column; - - margin: 1em 0.25em 0 0.25em; - grid-area: varrow; - font-size: 2em; - color: @gray-hint; -} - .vbox-combiner button { flex: 0; } @@ -156,9 +172,4 @@ font-size: 2em; line-height: 1em; animation: bits 1s ease-out; -} - -.arrow { - grid-area: arrow; - color: @gray-hint; -} +} \ No newline at end of file diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index 9263662d..eedb6527 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -232,15 +232,8 @@ class Vbox extends preact.Component { function vboxElement() { return ( -
e.stopPropagation()}> -
-

e.target.scrollIntoView(true)} - onMouseOver={e => hoverInfo(e, 'vbox')}> VBOX -

-
hoverInfo(e, 'bits')} >{vbox.bits}b
-
{range(0, 6).map(i => availableBtn(vbox.free[0][i], 0, i))}
@@ -248,6 +241,21 @@ class Vbox extends preact.Component { {range(0, 3).map(i => availableBtn(vbox.free[1][i], 1, i))} {range(0, 3).map(i => availableBtn(vbox.free[2][i], 2, i))}
+ + + ); + } + + function vboxHdr() { + return ( +
+

e.target.scrollIntoView(true)} + onMouseOver={e => hoverInfo(e, 'vbox')}> VBOX +

+
hoverInfo(e, 'bits')}> +

{vbox.bits}b

+
); } - // // INVENTORY // - function reclaimClick(e) { - e.stopPropagation(); - return setReclaiming(!reclaiming); - } function inventoryBtn(v, i) { const inventoryHighlight = vboxSelecting || itemUnequip.length; @@ -353,12 +357,12 @@ class Vbox extends preact.Component { let bits = 0; shopSelect.forEach(item => bits += item[0] + 1); text = bits - ? `Buy ${comboItem} - ${bits}b` - : `Combine - ${comboItem}`; + ?

Buy
{comboItem}
{bits}b

+ :

Combine
{comboItem}

; if (vbox.bits >= bits) mouseEvent = sendVboxCombine; } else if (stashSelect.length === 0 && shopSelect.length === 1) { const item = shopSelect[0]; - text = `Buy ${vbox.free[item[0]][item[1]]} ${item[0] + 1}b`; + text =

Buy
{vbox.free[item[0]][item[1]]}
{item[0] + 1}b

; mouseEvent = vboxBuySelected; } else { for (let i = 0; i < 3; i++) { @@ -370,13 +374,15 @@ class Vbox extends preact.Component { } } return ( - +
+ +
); } @@ -389,34 +395,42 @@ class Vbox extends preact.Component { return (
e.stopPropagation()} onDragOver={ev => ev.preventDefault()} onDrop={inventoryClick} > -
-

e.target.scrollIntoView(true)} - onMouseOver={e => hoverInfo(e, 'inventory')}> INVENTORY -

- -
-
- {range(0, 9).map(i => inventoryBtn(vbox.bound[i], i))} + {range(0, 6).map(i => inventoryBtn(vbox.bound[i], i))}
- {combinerBtn()}
); } + function inventoryHdr() { + return ( +
+

e.target.scrollIntoView(true)} + onMouseOver={e => hoverInfo(e, 'inventory')}> INVENTORY +

+ +
+ ); + } + + // // EVERYTHING // @@ -429,12 +443,13 @@ class Vbox extends preact.Component { return setInfo(newInfo); } - const classes = 'vbox'; return ( -
+
+ {vboxHdr()} {vboxElement()} -
+ {inventoryHdr()} {inventoryElement()} + {combinerBtn()}
); }