vbox rework

This commit is contained in:
ntr 2019-06-12 14:43:10 +10:00
parent e0f0634c74
commit a12e0c698f
4 changed files with 85 additions and 25 deletions

View File

@ -29,7 +29,13 @@
*$$$* *$$$*
* balances table buy supporter pack
account credited with features
char sets
emotes
* balances table (ingame currency)
id id
account account
balance balance

View File

@ -70,13 +70,15 @@
/* VBOX */ /* VBOX */
.vbox { .vbox {
align-items: flex-end; align-content: space-between;
grid-area: vbox; grid-area: vbox;
display: grid; display: grid;
grid-template-rows: min-content min-content; grid-template-rows: min-content min-content min-content;
grid-template-columns: 1fr min-content 1fr;
grid-template-areas: grid-template-areas:
"vbox combiner" "vbox varrow inventory"
"vbox inventory"; "vbox . carrow"
"vbox . combiner";
} }
.vbox-box { .vbox-box {
@ -85,14 +87,39 @@
.vbox-inventory { .vbox-inventory {
grid-area: inventory; grid-area: inventory;
margin-left: 1em;
} }
.vbox-combiner { .vbox-combiner {
margin-left: 1em;
grid-area: combiner; grid-area: combiner;
display: flex;
flex-flow: column;
justify-content: flex-end;
} }
.vbox-combiner-arrow {
color: #444;
grid-area: carrow;
display: block;
text-align: center;
font-size: 2em;
vertical-align: center;
}
.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: #444;
}
.vbox-combiner button {
flex: 0;
}
.vbox-btn:active, .vbox-btn:hover, .vbox-btn:focus { .vbox-btn:active, .vbox-btn:hover, .vbox-btn:focus {
color: white; color: white;
@ -111,8 +138,6 @@
.vbox-hdr { .vbox-hdr {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
flex: 1 0 100%;
} }
.vbox-hdr h3 { .vbox-hdr h3 {
@ -125,6 +150,11 @@
animation: bits 1s ease-out; animation: bits 1s ease-out;
} }
.arrow {
grid-area: arrow;
color: #444;
}
@keyframes action { @keyframes action {
0% { 0% {
color: palegoldenrod; color: palegoldenrod;
@ -415,3 +445,5 @@
/* Mobile Nav*/ /* Mobile Nav*/
.instance-nav { display: none; } .instance-nav { display: none; }
.vbox-arrow-mobile { display: none }

View File

@ -18,14 +18,32 @@
.vbox { .vbox {
grid-area: vbox; grid-area: vbox;
display: grid; display: grid;
grid-template-rows: min-content min-content min-content; grid-template-rows: min-content min-content min-content min-content min-content;
grid-template-columns: 1fr; grid-template-columns: 1fr;
grid-template-areas: grid-template-areas:
"vbox" "vbox"
"varrow"
"inventory" "inventory"
"carrow"
"combiner"; "combiner";
} }
.vbox-arrow {
display: none;
}
.vbox-inventory .vbox-hdr {
display: block;
}
.vbox-arrow-mobile {
display: block;
grid-area: varrow;
width: 100%;
text-align: center;
margin: 0;
}
/* constructs toggled on */ /* constructs toggled on */
.instance.constructs-visible .vbox { .instance.constructs-visible .vbox {
display: none; display: none;

View File

@ -292,18 +292,21 @@ function Vbox(args) {
<h3 onTouchStart={e => e.target.scrollIntoView(true)}>VBOX</h3> <h3 onTouchStart={e => e.target.scrollIntoView(true)}>VBOX</h3>
<div class="bits" onMouseOver={e => hoverInfo(e, 'bits')} >{vbox.bits}b</div> <div class="bits" onMouseOver={e => hoverInfo(e, 'bits')} >{vbox.bits}b</div>
</div> </div>
<button
onMouseOver={e => hoverInfo(e, 'reroll')}
onClick={() => sendVboxDiscard()}>
Reroll
</button>
<table class="vbox-table"> <table class="vbox-table">
<tbody> <tbody>
{freeRows} {freeRows}
</tbody> </tbody>
</table> </table>
<button
onMouseOver={e => hoverInfo(e, 'reroll')}
onClick={() => sendVboxDiscard()}>
Reroll
</button>
</div> </div>
<div class="vbox-arrow"></div>
<div class="vbox-arrow-mobile"></div>
<div class='vbox-inventory' onClick={() => setReclaiming(false)} onMouseOver={e => hoverInfo(e, 'inventory')} > <div class='vbox-inventory' onClick={() => setReclaiming(false)} onMouseOver={e => hoverInfo(e, 'inventory')} >
<div class="vbox-hdr">
<h3 onTouchStart={e => e.target.scrollIntoView(true)}>INVENTORY</h3> <h3 onTouchStart={e => e.target.scrollIntoView(true)}>INVENTORY</h3>
<button <button
class={reclaimClass} class={reclaimClass}
@ -311,20 +314,21 @@ function Vbox(args) {
onClick={reclaimClick}> onClick={reclaimClick}>
reclaim reclaim
</button> </button>
</div>
<table class="vbox-table"> <table class="vbox-table">
<tbody> <tbody>
{boundRows} {boundRows}
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="vbox-combiner-arrow" onTouchStart={e => e.target.scrollIntoView(true)}></div>
<div class="vbox-combiner" onMouseOver={e => hoverInfo(e, 'combiner')} > <div class="vbox-combiner" onMouseOver={e => hoverInfo(e, 'combiner')} >
<h3 onTouchStart={e => e.target.scrollIntoView(true)}>I-COMBINATOR</h3> {combinerElement}
<button <button
onMouseOver={e => hoverInfo(e, 'refine')} onMouseOver={e => hoverInfo(e, 'refine')}
onClick={() => sendVboxCombine()}> onClick={() => sendVboxCombine()}>
refine combine
</button> </button>
{combinerElement}
</div> </div>
</div> </div>
); );