bugfix opponent bomb btn buzz on hover #10
This commit is contained in:
@@ -387,7 +387,7 @@ main {
|
|||||||
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
|
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#mine-wrapper .game-wrapper .users .user-container .user-control .bomb-container:hover {
|
#mine-wrapper .game-wrapper .users .user-container .user-control .bomb-container.buzz:hover {
|
||||||
-webkit-animation-name: hvr-buzz-out;
|
-webkit-animation-name: hvr-buzz-out;
|
||||||
animation-name: hvr-buzz-out;
|
animation-name: hvr-buzz-out;
|
||||||
-webkit-animation-duration: 0.75s;
|
-webkit-animation-duration: 0.75s;
|
||||||
|
|||||||
@@ -186,7 +186,8 @@ class MineSeeker extends React.Component {
|
|||||||
name: payload.users.blue !== '' ? payload.users.blue : payload.users.blueAnon,
|
name: payload.users.blue !== '' ? payload.users.blue : payload.users.blueAnon,
|
||||||
desc: this.refs.gridControl.state.webPlayer === 'blue'
|
desc: this.refs.gridControl.state.webPlayer === 'blue'
|
||||||
? this.refs.gridControl.state.desc.you
|
? this.refs.gridControl.state.desc.you
|
||||||
: this.refs.gridControl.state.desc.buddy
|
: this.refs.gridControl.state.desc.buddy,
|
||||||
|
active: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.refs.gridControl.setState({overlay: false});
|
this.refs.gridControl.setState({overlay: false});
|
||||||
|
|||||||
@@ -429,6 +429,7 @@ class GridControl extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<UserControl ref="userControl"
|
<UserControl ref="userControl"
|
||||||
|
webPlayer={this.state.webPlayer}
|
||||||
bombClear={this.bombClear.bind(this)}/>
|
bombClear={this.bombClear.bind(this)}/>
|
||||||
<div className="grid-container">
|
<div className="grid-container">
|
||||||
<div className="grid"> {this.state.gridFields} </div>
|
<div className="grid"> {this.state.gridFields} </div>
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class UserControl extends React.Component {
|
|||||||
<div className="users">
|
<div className="users">
|
||||||
<User ref="blue"
|
<User ref="blue"
|
||||||
color="blue"
|
color="blue"
|
||||||
|
webPlayer={this.props.webPlayer}
|
||||||
active={this.state.activePlayer === 1}
|
active={this.state.activePlayer === 1}
|
||||||
onClickBombSelector={this.onClickBombSelector.bind(this, 1)}/>
|
onClickBombSelector={this.onClickBombSelector.bind(this, 1)}/>
|
||||||
<div className="active-mines-container">
|
<div className="active-mines-container">
|
||||||
@@ -57,6 +58,7 @@ class UserControl extends React.Component {
|
|||||||
<div className="clear"></div>
|
<div className="clear"></div>
|
||||||
<User ref="red"
|
<User ref="red"
|
||||||
color="red"
|
color="red"
|
||||||
|
webPlayer={this.props.webPlayer}
|
||||||
active={this.state.activePlayer === 0}
|
active={this.state.activePlayer === 0}
|
||||||
onClickBombSelector={this.onClickBombSelector.bind(this, 0)}/>
|
onClickBombSelector={this.onClickBombSelector.bind(this, 0)}/>
|
||||||
<div className="resign">
|
<div className="resign">
|
||||||
|
|||||||
@@ -24,6 +24,17 @@ class User extends React.Component {
|
|||||||
return this.state.srcRoot + 'bg-flag-' + color + '-outbg.png';
|
return this.state.srcRoot + 'bg-flag-' + color + '-outbg.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getBombBuzzClass(webPlayer) {
|
||||||
|
let activePlayer = this.state.color === 1 ? 'blue' : 'red';
|
||||||
|
|
||||||
|
return "bomb-container" +
|
||||||
|
(
|
||||||
|
this.state.active && (activePlayer === webPlayer) && this.state.haveBomb && this.state.enabledBomb
|
||||||
|
? ' buzz'
|
||||||
|
: ''
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
getBomb() {
|
getBomb() {
|
||||||
let src = this.state.srcRoot;
|
let src = this.state.srcRoot;
|
||||||
|
|
||||||
@@ -64,7 +75,7 @@ class User extends React.Component {
|
|||||||
<div className="user-control-mines">
|
<div className="user-control-mines">
|
||||||
{this.state.mines}
|
{this.state.mines}
|
||||||
</div>
|
</div>
|
||||||
<div className="bomb-container" onClick={this.props.onClickBombSelector}>
|
<div className={this.getBombBuzzClass(this.props.webPlayer)} onClick={this.props.onClickBombSelector}>
|
||||||
<div className="bomb">
|
<div className="bomb">
|
||||||
<img src={this.getBomb()} alt="bomb"/>
|
<img src={this.getBomb()} alt="bomb"/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user