icons wip
This commit is contained in:
parent
e14cf22b2f
commit
5c35c2d195
@ -192,29 +192,29 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.construct-list .skills {
|
.construct-list .skills {
|
||||||
|
padding: 0 0.5em;
|
||||||
grid-area: skills;
|
grid-area: skills;
|
||||||
display: flex;
|
|
||||||
border-width: 0px;
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
grid-gap: 0 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.construct-list .skills button {
|
.construct-list .skills button.empty {
|
||||||
flex: 1;
|
border-style: dashed;
|
||||||
/*border: 1px solid #222;*/
|
|
||||||
border: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.construct-list .specs {
|
.construct-list .specs {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
grid-area: specs;
|
grid-area: specs;
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
display: grid;
|
||||||
justify-content: center;
|
grid-template-columns: repeat(3, 1fr);
|
||||||
border-width: 0px;
|
grid-gap: 0 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.construct-list .specs figure {
|
.construct-list .specs figure {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
border: 0;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
@ -294,19 +294,6 @@
|
|||||||
flex: 1 0 100%;
|
flex: 1 0 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.equip .skills {
|
|
||||||
flex: 1;
|
|
||||||
border: 2px solid #222;
|
|
||||||
}
|
|
||||||
|
|
||||||
.equip .skills button {
|
|
||||||
color: whitesmoke;
|
|
||||||
font-size: 1em;
|
|
||||||
padding: 0.2em;
|
|
||||||
border-width: 0px;
|
|
||||||
margin-bottom: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.equipping {
|
.equipping {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@ -349,11 +336,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.equip .specs figure {
|
|
||||||
border: 0;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.equip-spec {
|
.equip-spec {
|
||||||
position: relative;
|
position: relative;
|
||||||
stroke: #333;
|
stroke: #333;
|
||||||
@ -372,10 +354,6 @@
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.equip .specs figcaption {
|
|
||||||
font-size: 75%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thresholds {
|
.thresholds {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column;
|
flex-flow: column;
|
||||||
|
|||||||
@ -15,17 +15,17 @@
|
|||||||
.vbox-colours {
|
.vbox-colours {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(6, 1fr);
|
grid-template-columns: repeat(6, 1fr);
|
||||||
grid-gap: 1em 2em;
|
grid-gap: 0.5em 1em;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vbox-items {
|
.vbox-items {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
grid-gap: 1em 2em;
|
grid-gap: 0.5em 1em;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 0.5em;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -38,6 +38,8 @@
|
|||||||
background-color: @gray;
|
background-color: @gray;
|
||||||
border-width: 0;
|
border-width: 0;
|
||||||
|
|
||||||
|
height: 3em;
|
||||||
|
|
||||||
:active, :hover, :focus {
|
:active, :hover, :focus {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
@ -62,9 +64,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
height: 3em;
|
height: 4em;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
|
text-transform: none;
|
||||||
|
|
||||||
&.empty {
|
&.empty {
|
||||||
border-style: dashed;
|
border-style: dashed;
|
||||||
}
|
}
|
||||||
@ -79,4 +83,15 @@
|
|||||||
svg {
|
svg {
|
||||||
stroke: none;
|
stroke: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// figures don't scale well
|
||||||
|
figure {
|
||||||
|
svg {
|
||||||
|
height: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
figcaption {
|
||||||
|
line-height: initial;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,7 +125,7 @@ function Construct(props) {
|
|||||||
|
|
||||||
// const action = skill ? '' : 'action';
|
// const action = skill ? '' : 'action';
|
||||||
const equip = skillList.includes(vbox.bound[itemEquip]) && !skill ? 'equipping' : '';
|
const equip = skillList.includes(vbox.bound[itemEquip]) && !skill ? 'equipping' : '';
|
||||||
const classes = `${equip}`;
|
const classes = `${equip} ${!skill ? 'empty' : ''}`;
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
key={i}
|
key={i}
|
||||||
@ -171,14 +171,13 @@ function Construct(props) {
|
|||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<figure
|
<button
|
||||||
key={i}
|
key={i}
|
||||||
onClick={specClick}
|
onClick={specClick}
|
||||||
onDblClick={specDblClick}
|
onDblClick={specDblClick}
|
||||||
onMouseOver={e => hoverInfo(e, s)} >
|
onMouseOver={e => hoverInfo(e, s)} >
|
||||||
{shapes[s]()}
|
{shapes[s]()}
|
||||||
<figcaption>{s}</figcaption>
|
</button>
|
||||||
</figure>
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,9 @@
|
|||||||
const { connect } = require('preact-redux');
|
const { connect } = require('preact-redux');
|
||||||
const preact = require('preact');
|
const preact = require('preact');
|
||||||
const { Fragment } = require('preact');
|
|
||||||
|
|
||||||
const { postData } = require('../utils');
|
|
||||||
console.log(postData);
|
|
||||||
const actions = require('../actions');
|
const actions = require('../actions');
|
||||||
const AccountStatus = require('./account.status');
|
const AccountStatus = require('./account.status');
|
||||||
|
|
||||||
const testGame = process.env.NODE_ENV === 'development' && require('./../test.game');
|
|
||||||
const testInstance = process.env.NODE_ENV === 'development' && require('./../test.instance');
|
|
||||||
|
|
||||||
const addState = connect(
|
const addState = connect(
|
||||||
function receiveState(state) {
|
function receiveState(state) {
|
||||||
const {
|
const {
|
||||||
@ -115,15 +109,6 @@ function Nav(args) {
|
|||||||
return <button key={i.id} onClick={() => joinInstance(i)} >{`${phase} ${score.wins} / ${score.losses}`}</button>
|
return <button key={i.id} onClick={() => joinInstance(i)} >{`${phase} ${score.wins} / ${score.losses}`}</button>
|
||||||
});
|
});
|
||||||
|
|
||||||
const haxSection = process.env.NODE_ENV === 'development'
|
|
||||||
? (
|
|
||||||
<Fragment>
|
|
||||||
<h2>Hax</h2>
|
|
||||||
<button onClick={() => setTestGame(account.id)}>Test Game</button>
|
|
||||||
<button onClick={() => setTestInstance(account.id)}>Test Instance</button>
|
|
||||||
</Fragment>)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
const canJoin = team.some(c => !c);
|
const canJoin = team.some(c => !c);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -134,7 +119,6 @@ function Nav(args) {
|
|||||||
<button class="play-btn" disabled={canJoin} onClick={() => navTo('list')}>Play</button>
|
<button class="play-btn" disabled={canJoin} onClick={() => navTo('list')}>Play</button>
|
||||||
<hr />
|
<hr />
|
||||||
{joined}
|
{joined}
|
||||||
{haxSection}
|
|
||||||
</nav>
|
</nav>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
const preact = require('preact');
|
||||||
|
|
||||||
const circle = require('./svgs/circle');
|
const circle = require('./svgs/circle');
|
||||||
const diamond = require('./svgs/diamond');
|
const diamond = require('./svgs/diamond');
|
||||||
const hexagon = require('./svgs/hexagon');
|
const hexagon = require('./svgs/hexagon');
|
||||||
@ -20,6 +22,10 @@ module.exports = {
|
|||||||
saw,
|
saw,
|
||||||
vboxColour,
|
vboxColour,
|
||||||
|
|
||||||
|
Red: () => vboxColour('red'),
|
||||||
|
Green: () => vboxColour('green'),
|
||||||
|
Blue: () => vboxColour('blue'),
|
||||||
|
|
||||||
// stats
|
// stats
|
||||||
RedLife: () => square(['red']),
|
RedLife: () => square(['red']),
|
||||||
GreenLife: () => square(['green']),
|
GreenLife: () => square(['green']),
|
||||||
@ -29,11 +35,27 @@ module.exports = {
|
|||||||
BluePower: () => circle(['blue']),
|
BluePower: () => circle(['blue']),
|
||||||
Speed: () => triangle(['white']),
|
Speed: () => triangle(['white']),
|
||||||
|
|
||||||
|
|
||||||
// specs
|
// specs
|
||||||
// Base
|
// Base
|
||||||
Power: () => circle(['white']),
|
Power: () =>
|
||||||
Life: () => square(['white']),
|
<figure>
|
||||||
// Speed,
|
{circle(['white'])}
|
||||||
|
<figcaption>Power</figcaption>
|
||||||
|
</figure>,
|
||||||
|
|
||||||
|
Life: () =>
|
||||||
|
<figure>
|
||||||
|
{square(['white'])}
|
||||||
|
<figcaption>Life</figcaption>
|
||||||
|
</figure>,
|
||||||
|
|
||||||
|
// Speed:
|
||||||
|
// <figure>
|
||||||
|
// {triangle(['white'])}
|
||||||
|
// <figcaption>Speed</figcaption>
|
||||||
|
// </figure>,
|
||||||
|
|
||||||
|
|
||||||
// Lifes Upgrades
|
// Lifes Upgrades
|
||||||
LifeGG: () => square(['green']),
|
LifeGG: () => square(['green']),
|
||||||
@ -52,7 +74,12 @@ module.exports = {
|
|||||||
PowerRB: () => circle(['red', 'blue']),
|
PowerRB: () => circle(['red', 'blue']),
|
||||||
|
|
||||||
// Speed Upgrades
|
// Speed Upgrades
|
||||||
SpeedGG: () => triangle(['green']),
|
SpeedGG: () =>
|
||||||
|
<figure>
|
||||||
|
{triangle(['green'])}
|
||||||
|
<figcaption>Speed</figcaption>
|
||||||
|
</figure>,
|
||||||
|
|
||||||
SpeedRR: () => triangle(['red']),
|
SpeedRR: () => triangle(['red']),
|
||||||
SpeedBB: () => triangle(['blue']),
|
SpeedBB: () => triangle(['blue']),
|
||||||
SpeedRG: () => triangle(['red', 'green']),
|
SpeedRG: () => triangle(['red', 'green']),
|
||||||
|
|||||||
@ -171,12 +171,12 @@ function Vbox(args) {
|
|||||||
return setVboxSelected([group, index]);
|
return setVboxSelected([group, index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (['Red', 'Green', 'Blue'].includes(v)) {
|
if (shapes[v]) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
onMouseOver={e => vboxHover(e, v)}
|
onMouseOver={e => vboxHover(e, v)}
|
||||||
onClick={onClick}>
|
onClick={onClick}>
|
||||||
{shapes.vboxColour(v.toLowerCase())}
|
{shapes[v]()}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -271,13 +271,13 @@ function Vbox(args) {
|
|||||||
const highlighted = combiner.indexOf(i) > -1;
|
const highlighted = combiner.indexOf(i) > -1;
|
||||||
const classes = `${highlighted ? 'highlight' : ''}`;
|
const classes = `${highlighted ? 'highlight' : ''}`;
|
||||||
|
|
||||||
if (['Red', 'Green', 'Blue'].includes(v)) {
|
if (shapes[v]) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
class={classes}
|
class={classes}
|
||||||
onMouseOver={e => vboxHover(e, v)}
|
onMouseOver={e => vboxHover(e, v)}
|
||||||
onClick={onClick}>
|
onClick={onClick}>
|
||||||
{shapes.vboxColour(v.toLowerCase())}
|
{shapes[v]()}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,7 +88,7 @@ impl Vbox {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let dist = WeightedIndex::new(items.iter().map(|item| item.1)).unwrap();
|
let dist = WeightedIndex::new(items.iter().map(|item| item.1)).unwrap();
|
||||||
iter::repeat_with(|| {
|
iter::repeat_with(|| {
|
||||||
items[dist.sample(&mut rng)].0}).take(match item_type {
|
items[dist.sample(&mut rng)].0}).take(match item_type {
|
||||||
ItemType::Colours => 6,
|
ItemType::Colours => 6,
|
||||||
_ => 3,
|
_ => 3,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user