This commit is contained in:
ntr 2019-05-02 16:16:50 +10:00
parent a3b34dc41d
commit 2716d05b07
3 changed files with 49 additions and 58 deletions

View File

@ -596,19 +596,6 @@ table td svg {
transition-timing-function: ease; transition-timing-function: ease;
} }
.cryp-box-top {
display: flex;
flex: 1 1 75%;
width: 100%;
justify-content: center;
align-items: stretch;
}
.cryp-box .particle {
position: fixed;
z-index: -10;
}
.cryp-box figure { .cryp-box figure {
margin: 0; margin: 0;
flex: 0 0 50%; flex: 0 0 50%;
@ -678,11 +665,23 @@ table td svg {
margin-right: 0.5em; margin-right: 0.5em;
} }
.cryp-skill-btn {
color: #333333;
}
.cryp-skill-btn.active {
color: whitesmoke;
}
.cryp-skill-btn[disabled] { .cryp-skill-btn[disabled] {
color: #333333; color: #333333;
font-size: 14pt; font-size: 14pt;
} }
.cryp-skill-btn:hover {
color: whitesmoke;
}
.cryp-box.ko { .cryp-box.ko {
animation: none; animation: none;
opacity: 0.5; opacity: 0.5;
@ -690,6 +689,10 @@ table td svg {
filter: grayscale(100%); filter: grayscale(100%);
} }
.cryp-box.ko .cryp-skill-btn:hover {
color: #333;
}
.cryp-box.unfocus { .cryp-box.unfocus {
/*opacity: 0.65;*/ /*opacity: 0.65;*/
filter: blur(5px); filter: blur(5px);
@ -728,20 +731,6 @@ table td svg {
align-items: flex-end; align-items: flex-end;
} }
/*.logs {
flex: 0 0 100%;
}
*/
.selected-skills {
flex: 1 1 25%;
display: flex;
flex-flow: column;
height: 95%;
padding: 0 2em 0 2em;
justify-content: center;
}
.stack-line { .stack-line {
display: flex; display: flex;
align-items: center; align-items: center;
@ -842,11 +831,6 @@ CRYP DAMAGE
/* /*
MOBILE MOBILE
*/ */
@media (max-width: 1000px) {
.selected-skills {
display: none;
}
}
@media (max-width: 800px) { @media (max-width: 800px) {
h2 { h2 {
@ -856,11 +840,13 @@ CRYP DAMAGE
main { main {
flex: 1 1 auto; flex: 1 1 auto;
flex-flow: column; flex-flow: column;
overflow: hidden;
} }
main.game { main.game {
flex-flow: column-reverse; flex-flow: column-reverse;
justify-content: space-between; justify-content: space-between;
height: 100%;
} }
main.game .instance-hdr { main.game .instance-hdr {
@ -912,11 +898,6 @@ CRYP DAMAGE
height: unset; height: unset;
} }
.cryp-box-top figure {
flex: 1;
font-size: 60%;
}
.menu-instance-btn { .menu-instance-btn {
font-size: 1em; font-size: 1em;
} }
@ -947,6 +928,7 @@ CRYP DAMAGE
.cryp-box { .cryp-box {
margin: 0 0.2em; margin: 0 0.2em;
flex-flow: column-reverse;
} }
.spawn-btn button { .spawn-btn button {
@ -959,8 +941,13 @@ CRYP DAMAGE
display: none; display: none;
} }
.selected-skills { .mobile-spacer {
flex: 1 1 25%;
flex-flow: column;
display: block; display: block;
height: 95%;
padding: 0 2em 0 2em;
justify-content: center;
} }
.mobile-skills { .mobile-skills {
@ -977,21 +964,13 @@ CRYP DAMAGE
.cryp-skill-btn { .cryp-skill-btn {
flex: 1; flex: 1;
font-size: 16pt; font-size: 16pt;
border-width: 1px;
padding: 0; padding: 0;
margin: 0; margin: 0;
border-bottom-width: 0px; border-width: 0px;
border-left-width: 1px;
border-top-width: 1px;
border-right-width: 0px;
} }
.cryp-skill-btn:first-child { .cryp-box .stats {
border-top-width: 1px; flex-flow: row;
border-left-width: 0px;
}
.cryp-box .stats figure {
padding: 0.2em 0; padding: 0.2em 0;
} }

View File

@ -179,10 +179,6 @@ function GamePanel(props) {
); );
} }
const selectedSkills = resolution
? <div>&nbsp;</div>
: playerTeam.cryps.map((c, i) => stackElement(c, i));
const mobileSkills = activeCryp && activeCryp.green_life.value const mobileSkills = activeCryp && activeCryp.green_life.value
? range(0, 3).map(i => <SkillBtn key={i} cryp={activeCryp} i={i} mobile={true} />) ? range(0, 3).map(i => <SkillBtn key={i} cryp={activeCryp} i={i} mobile={true} />)
: (<div/>); : (<div/>);
@ -195,9 +191,7 @@ function GamePanel(props) {
<div className="mobile-skills"> <div className="mobile-skills">
{mobileSkills} {mobileSkills}
</div> </div>
<div className="selected-skills"> <div className="mobile-spacer">&nbsp;</div>
{selectedSkills}
</div>
{otherTeams.map(OpponentTeam)} {otherTeams.map(OpponentTeam)}
</main> </main>
); );

View File

@ -7,10 +7,12 @@ const addState = connect(
function receiveState(state) { function receiveState(state) {
const { const {
activeSkill, activeSkill,
game,
} = state; } = state;
return { return {
activeSkill, activeSkill,
game,
}; };
}, },
@ -27,6 +29,7 @@ const addState = connect(
function Skill(props) { function Skill(props) {
const { const {
cryp, cryp,
game,
i, i,
mobile, mobile,
activeSkill, activeSkill,
@ -63,13 +66,28 @@ function Skill(props) {
return setActiveSkill(cryp.id, s.skill); return setActiveSkill(cryp.id, s.skill);
} }
function findCryp(id) {
const team = game.players.find(t => t.cryps.find(c => c.id === id));
if (team) return team.cryps.find(c => c.id === id);
return null;
}
const [target] = game.stack.filter(stack => stack.source_cryp_id === cryp.id && stack.skill === s.skill)
.map(stack => findCryp(stack.target_cryp_id));
const targetText = target
? `-> ${target.name}`
: '';
console.log(target);
return ( return (
<button <button
disabled={!!cdText || ko} disabled={!!cdText || ko}
className={`cryp-skill-btn ${side} ${highlight ? 'active' : ''}`} className={`cryp-skill-btn ${side} ${(target || highlight) ? 'active' : ''}`}
type="submit" type="submit"
onClick={onClick}> onClick={onClick}>
{s.skill} {cdText} {s.skill} {cdText} {targetText}
</button> </button>
); );
} }