nav btns
This commit is contained in:
parent
3dc13c7b40
commit
9f294078d5
@ -311,7 +311,7 @@ header {
|
|||||||
flex-grow: 1
|
flex-grow: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-btn {
|
.menu-btn, .nav-btn {
|
||||||
flex: 1 0 25%;
|
flex: 1 0 25%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,6 +319,11 @@ header {
|
|||||||
flex: 1 0 50%;
|
flex: 1 0 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* nav hidden on desktop */
|
||||||
|
.nav-btn {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.ready-btn:hover {
|
.ready-btn:hover {
|
||||||
transition-property: all;
|
transition-property: all;
|
||||||
transition-duration: 2s;
|
transition-duration: 2s;
|
||||||
@ -642,6 +647,18 @@ header {
|
|||||||
padding: 0.2em;
|
padding: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.menu-btn {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-btn {
|
||||||
|
display: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vbox {
|
||||||
|
flex: 1 1 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.cryps {
|
.cryps {
|
||||||
font-size: 0.75em;
|
font-size: 0.75em;
|
||||||
padding: 0 0.5em;
|
padding: 0 0.5em;
|
||||||
|
|||||||
@ -138,7 +138,7 @@ function Info(args) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="info-cryp">
|
<div className="info-cryp">
|
||||||
<h5>{cryp.name}</h5>
|
<h2>{cryp.name}</h2>
|
||||||
<div className="stats">
|
<div className="stats">
|
||||||
{stats}
|
{stats}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -116,6 +116,7 @@ function InstanceComponent(args) {
|
|||||||
sendVboxApply,
|
sendVboxApply,
|
||||||
setInfo,
|
setInfo,
|
||||||
activeVar,
|
activeVar,
|
||||||
|
activeCryp,
|
||||||
setActiveVar,
|
setActiveVar,
|
||||||
setActiveCryp,
|
setActiveCryp,
|
||||||
} = args;
|
} = args;
|
||||||
@ -126,18 +127,55 @@ function InstanceComponent(args) {
|
|||||||
cryp: c, sendVboxApply, setInfo, activeVar, setActiveCryp,
|
cryp: c, sendVboxApply, setInfo, activeVar, setActiveCryp,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
function onClick(e) {
|
function showVbox(e) {
|
||||||
setActiveVar(null);
|
setActiveVar(null);
|
||||||
|
setActiveCryp(null);
|
||||||
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showTeam(e) {
|
||||||
|
setActiveCryp(instance.cryps[0]);
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
|
const vboxBtn = (
|
||||||
|
<button
|
||||||
|
className="instance-btn instance-ui-btn nav-btn left"
|
||||||
|
onClick={showVbox}>
|
||||||
|
vBox
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
|
||||||
|
const teamBtn = (
|
||||||
|
<button
|
||||||
|
className="instance-btn instance-ui-btn nav-btn right"
|
||||||
|
onClick={showTeam}>
|
||||||
|
team
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
|
||||||
|
const infoSelected = activeVar !== null || activeCryp;
|
||||||
|
|
||||||
|
const navBtn = infoSelected
|
||||||
|
? vboxBtn
|
||||||
|
: teamBtn;
|
||||||
|
|
||||||
|
const crypListClass = `cryp-list ${infoSelected ? '' : 'hidden'}`;
|
||||||
|
|
||||||
|
const menuBtn = (
|
||||||
|
<button
|
||||||
|
className="instance-btn instance-ui-btn menu-btn left"
|
||||||
|
onClick={quit}>
|
||||||
|
menu
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="instance" onClick={onClick} >
|
<main className="instance" >
|
||||||
<div className="instance-hdr">
|
<div className="instance-hdr">
|
||||||
<button
|
{navBtn}
|
||||||
className="instance-btn instance-ui-btn menu-btn left"
|
{menuBtn}
|
||||||
onClick={quit}>
|
|
||||||
Menu
|
|
||||||
</button>
|
|
||||||
<div className="spacer">
|
<div className="spacer">
|
||||||
<div> </div>
|
<div> </div>
|
||||||
</div>
|
</div>
|
||||||
@ -148,7 +186,7 @@ function InstanceComponent(args) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<VboxContainer />
|
<VboxContainer />
|
||||||
<div className="cryp-list">
|
<div className={crypListClass}>
|
||||||
{cryps}
|
{cryps}
|
||||||
</div>
|
</div>
|
||||||
<InfoContainer />
|
<InfoContainer />
|
||||||
|
|||||||
@ -6,7 +6,7 @@ const Instance = require('./instance.component');
|
|||||||
|
|
||||||
const addState = connect(
|
const addState = connect(
|
||||||
function receiveState(state) {
|
function receiveState(state) {
|
||||||
const { ws, instance, account, activeVar } = state;
|
const { ws, instance, account, activeVar, activeCryp } = state;
|
||||||
|
|
||||||
function sendInstanceReady() {
|
function sendInstanceReady() {
|
||||||
return ws.sendInstanceReady(instance.instance);
|
return ws.sendInstanceReady(instance.instance);
|
||||||
@ -16,7 +16,7 @@ const addState = connect(
|
|||||||
return ws.sendVboxApply(instance.instance, crypId, i);
|
return ws.sendVboxApply(instance.instance, crypId, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return { instance, account, sendInstanceReady, sendVboxApply, activeVar };
|
return { instance, account, sendInstanceReady, sendVboxApply, activeVar, activeCryp };
|
||||||
},
|
},
|
||||||
|
|
||||||
function receiveDispatch(dispatch) {
|
function receiveDispatch(dispatch) {
|
||||||
|
|||||||
@ -13,6 +13,7 @@ function convertVar(v) {
|
|||||||
function Vbox(args) {
|
function Vbox(args) {
|
||||||
const {
|
const {
|
||||||
activeVar,
|
activeVar,
|
||||||
|
activeCryp,
|
||||||
instance,
|
instance,
|
||||||
combiner,
|
combiner,
|
||||||
reclaiming,
|
reclaiming,
|
||||||
@ -195,7 +196,7 @@ function Vbox(args) {
|
|||||||
//
|
//
|
||||||
// EVERYTHING
|
// EVERYTHING
|
||||||
//
|
//
|
||||||
const classes = `vbox ${activeVar !== null ? 'hidden' : ''}`;
|
const classes = `vbox ${activeVar !== null || activeCryp ? 'hidden' : ''}`;
|
||||||
return (
|
return (
|
||||||
<div className={classes} onClick={() => setReclaiming(false)} >
|
<div className={classes} onClick={() => setReclaiming(false)} >
|
||||||
<div className="vbox-hdr">
|
<div className="vbox-hdr">
|
||||||
|
|||||||
@ -6,7 +6,15 @@ const Vbox = require('./vbox.component');
|
|||||||
|
|
||||||
const addState = connect(
|
const addState = connect(
|
||||||
function receiveState(state) {
|
function receiveState(state) {
|
||||||
const { ws, instance, combiner, reclaiming, activeVar, info } = state;
|
const {
|
||||||
|
ws,
|
||||||
|
instance,
|
||||||
|
combiner,
|
||||||
|
reclaiming,
|
||||||
|
activeVar,
|
||||||
|
activeCryp,
|
||||||
|
info,
|
||||||
|
} = state;
|
||||||
|
|
||||||
function sendVboxDiscard() {
|
function sendVboxDiscard() {
|
||||||
return ws.sendVboxDiscard(instance.instance);
|
return ws.sendVboxDiscard(instance.instance);
|
||||||
@ -29,6 +37,7 @@ const addState = connect(
|
|||||||
combiner,
|
combiner,
|
||||||
reclaiming,
|
reclaiming,
|
||||||
activeVar,
|
activeVar,
|
||||||
|
activeCryp,
|
||||||
info,
|
info,
|
||||||
sendVboxAccept,
|
sendVboxAccept,
|
||||||
sendVboxDiscard,
|
sendVboxDiscard,
|
||||||
|
|||||||
@ -261,7 +261,7 @@ function createSocket(events) {
|
|||||||
|
|
||||||
// if (!account) events.loginPrompt();
|
// if (!account) events.loginPrompt();
|
||||||
if (process.env.NODE_ENV !== 'production') {
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
// send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } });
|
send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } });
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user