Skip to content

Commit

Permalink
Added formatting for power bank.
Browse files Browse the repository at this point in the history
  • Loading branch information
DeanHinNet committed Jun 13, 2018
1 parent 9d2213e commit f05aa45
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/dist/bundle.js

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions client/dist/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ input {
margin: 2px;
}

#power-bank {
width: 125px;
}
#power-bank .power0{
background-color: green;
}
Expand All @@ -211,4 +214,24 @@ input {

#power-bank .power2 {
background-color: blue;
}

#power-bank #legend .power0{
background-color: green;

}
#power-bank #legend .power1 {
background-color: red;

}
#power-bank #legend .power2 {
background-color: blue;

}

#power-bank #legend div{
width: 120px;
padding: 1px;
color: white;
font-size: 9px;
}
21 changes: 16 additions & 5 deletions client/src/components/Game.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Game extends React.Component {
this.shuffleArray = this.shuffleArray.bind(this);
this.switchWords = this.switchWords.bind(this);

this.removeAllWords = this.removeAllWords.bind(this);
this.stopAll = this.stopAll.bind(this);
this.usePower = this.usePower.bind(this);
this.addPower = this.addPower.bind(this);
Expand Down Expand Up @@ -345,7 +346,11 @@ class Game extends React.Component {
words: list
});
}

removeAllWords(num){
this.setState({
words: []
});
}
usePower(e){
var temp;
var banked;
Expand All @@ -355,11 +360,11 @@ class Game extends React.Component {

if(this.state.bankedPowers[0] != undefined){
if(this.state.bankedPowers[0] === 'power0'){
this.removeWords(3);
this.removeAllWords();
} else if(this.state.bankedPowers[0] === 'power1'){
this.switchWords();
} else if(this.state.bankedPowers[0] === 'power2'){
this.pauseGame();
} else if(this.state.bankedPowers[0] === 'power2'){
this.removeWords();
}
banked = this.state.bankedPowers.slice();
banked.shift();
Expand Down Expand Up @@ -394,7 +399,7 @@ class Game extends React.Component {
});
}
//END OF POWERUPS

render() {
return (
<div className="game">
Expand Down Expand Up @@ -439,7 +444,13 @@ class Game extends React.Component {
{this.state.bankedPowers.map((powerup, index)=>{
return <PowerBank key={index} powerup={powerup} />
})}
<div id='legend'>
<div className='power1'>Pause (5s)</div>
<div className='power2'>Remove 1/2</div>
<div className='power0'>Remove All</div>
</div>
</div>


{/* their game: */}
<div className="play" id="their-game">
Expand Down

0 comments on commit f05aa45

Please sign in to comment.