This commit is contained in:
ntr 2019-05-20 17:55:28 +10:00
parent 9ef8de59f3
commit 9c586fe9f7
5 changed files with 52 additions and 27 deletions

View File

@ -35,7 +35,7 @@
} }
.instance .info { .instance .info {
font-size: 75%; /*font-size: 75%;*/
margin-left: 1em; margin-left: 1em;
grid-area: info; grid-area: info;
display: flex; display: flex;
@ -44,6 +44,10 @@
white-space: pre-wrap; white-space: pre-wrap;
} }
.instance .info h2 {
text-transform: uppercase;
}
.instance .cryps { .instance .cryps {
grid-area: cryps; grid-area: cryps;
} }
@ -391,22 +395,22 @@ button.equip {
.thresholds { .thresholds {
display: flex; display: flex;
flex-flow: column; flex-flow: row-wrap;
align-items: center; /*align-items: center;*/
/*justify-content: space-around;*/ justify-content: space-around;
} }
.spec-goals figure { .spec-goals {
margin: 1em 0;
} }
.spec-goals figure svg { .spec-goals figure svg {
height: 1em; height: 2em;
} }
.spec-goals .unmet { .spec-goals .unmet {
opacity: 0.5; opacity: 0.5;
} }
/* Mobile Nav*/ /* Mobile Nav*/
#toggle-vbox { display: none; } #toggle-vbox { display: none; }
#toggle-vbox-label { display: none; } #toggle-vbox-label { display: none; }

View File

@ -17,7 +17,6 @@ function Info(args) {
function Info() { function Info() {
if (!info) return false; if (!info) return false;
const fullInfo = itemInfo.items.find(i => i.item === info) || INFO[info]; const fullInfo = itemInfo.items.find(i => i.item === info) || INFO[info];
console.log(INFO);
if (!fullInfo) return false; if (!fullInfo) return false;
const isSkill = fullInfo.skill; const isSkill = fullInfo.skill;
const isSpec = fullInfo.spec; const isSpec = fullInfo.spec;

View File

@ -67,6 +67,7 @@ function Cryp(props) {
setItemEquip, setItemEquip,
setVboxHighlight, setVboxHighlight,
itemInfo, itemInfo,
setInfo,
} = props; } = props;
function setHighlight(type) { function setHighlight(type) {
@ -83,6 +84,11 @@ function Cryp(props) {
return setActiveCryp(cryp); return setActiveCryp(cryp);
} }
function hoverInfo(e, info) {
e.stopPropagation();
return setInfo(info);
}
const { vbox } = player; const { vbox } = player;
const skillList = itemInfo.items.filter(v => v.skill).map(v => v.item); const skillList = itemInfo.items.filter(v => v.skill).map(v => v.item);
const specList = itemInfo.items.filter(v => v.spec).map(v => v.item); const specList = itemInfo.items.filter(v => v.spec).map(v => v.item);
@ -105,7 +111,13 @@ function Cryp(props) {
const equip = skillList.includes(vbox.bound[itemEquip]) && !skill ? 'equip' : ''; const equip = skillList.includes(vbox.bound[itemEquip]) && !skill ? 'equip' : '';
const classes = `right ${action} ${equip}`; const classes = `right ${action} ${equip}`;
return ( return (
<button key={i} className={classes} onClick={skillClick} >{s}</button> <button
key={i}
className={classes}
onClick={skillClick}
onMouseOver={e => hoverInfo(e, s)} >
{s}
</button>
); );
}); });
@ -128,7 +140,7 @@ function Cryp(props) {
} }
return ( return (
<figure key={i} onClick={specClick}> <figure key={i} onClick={specClick} onMouseOver={e => hoverInfo(e, s)} >
{SPECS[s].svg(`stat-icon ${SPECS[s].colour}`)} {SPECS[s].svg(`stat-icon ${SPECS[s].colour}`)}
<figcaption>{SPECS[s].caption}</figcaption> <figcaption>{SPECS[s].caption}</figcaption>
</figure> </figure>
@ -157,14 +169,15 @@ function Cryp(props) {
// return 4; // return 4;
// }; // };
// const border = { border: `${thickness(cTotal)}px solid rgba(${colours.red}, ${colours.green}, ${colours.blue}, ${alpha})` }; // const border = { border: `${thickness(cTotal)}px solid rgba(${colours.red}, ${colours.green}, ${colours.blue}, ${alpha})` };
return ( return (
<div key={cryp.id} className={crypClass} onClick={onClick} > <div key={cryp.id} className={crypClass} onClick={onClick} >
{crypAvatar(cryp.name)} {crypAvatar(cryp.name)}
<h2 className="name" >{cryp.name}</h2> <h2 className="name" >{cryp.name}</h2>
<div className="skills"> <div className="skills" onMouseOver={e => hoverInfo(e, 'crypSkills')} >
{skills} {skills}
</div> </div>
<div className="specs"> <div className="specs" onMouseOver={e => hoverInfo(e, 'crypSpecs')} >
{specs} {specs}
</div> </div>
<div className="stats"> <div className="stats">

View File

@ -74,6 +74,11 @@ function Equipment(props) {
return sendUnequip(activeCryp.id, itemUnequip); return sendUnequip(activeCryp.id, itemUnequip);
} }
function hoverInfo(e, info) {
e.stopPropagation();
return setInfo(info);
}
const skillClass = isSkill ? 'skills highlight' : 'skills'; const skillClass = isSkill ? 'skills highlight' : 'skills';
const specClass = isSpec ? 'specs highlight' : 'specs'; const specClass = isSpec ? 'specs highlight' : 'specs';
@ -84,7 +89,7 @@ function Equipment(props) {
const item = convertItem(vbox.bound[i]); const item = convertItem(vbox.bound[i]);
if (skillList.includes(item)) { if (skillList.includes(item)) {
return ( return (
<button key={i} onClick={e => boundClick(e, i)}> <button key={i} onClick={e => boundClick(e, i)} onMouseOver={e => hoverInfo(e, item)}>
{item} {item}
</button> </button>
); );
@ -95,7 +100,7 @@ function Equipment(props) {
const item = convertItem(vbox.bound[i]); const item = convertItem(vbox.bound[i]);
if (specList.includes(item)) { if (specList.includes(item)) {
return ( return (
<figure key={i} onClick={e => boundClick(e, i)}> <figure key={i} onClick={e => boundClick(e, i)} onMouseOver={e => hoverInfo(e, item)} >
{SPECS[item].svg(`equip-icon ${SPECS[item].colour}`)} {SPECS[item].svg(`equip-icon ${SPECS[item].colour}`)}
<figcaption>{SPECS[item].caption}</figcaption> <figcaption>{SPECS[item].caption}</figcaption>
</figure> </figure>
@ -103,11 +108,6 @@ function Equipment(props) {
} return false; } return false;
}); });
function hoverInfo(e, info) {
e.stopPropagation();
return setInfo(info);
}
return ( return (
<div className="equip" > <div className="equip" >
<div className={skillClass} onClick={e => unequipClick(e)} onMouseOver={e => hoverInfo(e, 'equipSkills')} > <div className={skillClass} onClick={e => unequipClick(e)} onMouseOver={e => hoverInfo(e, 'equipSkills')} >

View File

@ -9,36 +9,45 @@ module.exports = {
INFO: { INFO: {
vbox: { vbox: {
item: 'VBOX', item: 'VBOX',
description: 'Contains items that are available for you to buy.\nDouble-click to purchase.', description: 'Contains ITEMS that are available for you to buy.\nDouble-click to purchase.',
}, },
inventory: { inventory: {
item: 'INVENTORY', item: 'INVENTORY',
description: 'Holds purchased items.', description: 'Holds purchased ITEMS.\nClick to add ITEM to I-COMBINATOR.',
}, },
combiner: { combiner: {
item: 'I-COMBINATOR', item: 'I-COMBINATOR',
description: 'Combines purchased items into more powerful variants. Hover over an item to see recipes.', description: 'Combines purchased ITEMS into more powerful variants. Hover over an ITEM to see recipes.',
}, },
reclaim: { reclaim: {
item: 'RECLAIM', item: 'RECLAIM',
description: 'Reclaim items for half the purchase cost of their combined items.\nClick to enable and click item to reclaim.', description: 'Reclaim ITEMS for half the purchase cost of their combined ITEMS.\nClick to enable and click ITEM to reclaim.',
}, },
refine: { refine: {
item: 'REFINE', item: 'REFINE',
description: 'Refine items currently in I-COMBINATOR into more powerful variants', description: 'Refine ITEMS currently in I-COMBINATOR into more powerful variants',
}, },
reroll: { reroll: {
item: 'REROLL', item: 'REROLL',
description: 'Refill the VBOX with new items.\nCosts 5b.', description: 'Refill the VBOX with new ITEMS.\nCosts 5b.',
}, },
equipSkills: { equipSkills: {
item: 'QUICK ACCESS - SKILLS', item: 'QUICK ACCESS - SKILLS',
description: 'Click to select \nClick target Cryp to equip', description: 'Click to select \nClick target CRYP to equip',
}, },
equipSpecs: { equipSpecs: {
item: 'QUICK ACCESS - SPECS', item: 'QUICK ACCESS - SPECS',
description: 'Click to select \nClick target Cryp to equip', description: 'Click to select \nClick target CRYP to equip',
}, },
crypSkill: {
item: 'SKILLS',
description: 'Skills are used by Cryps in-game.\nClick a SKILL above and select a CRYP to equip.',
},
crypSpecs: {
item: 'SPECS',
description: 'SPECS increase the STATS of a CRYP.\nSPECS have increased effect once they reach a THRESHOLD across your whole team.\nClick a SPEC above and select a CRYP to equip.',
},
}, },
ITEMS: { ITEMS: {