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);
|
||||
}
|
||||
|
||||
#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;
|
||||
animation-name: hvr-buzz-out;
|
||||
-webkit-animation-duration: 0.75s;
|
||||
|
||||
@@ -186,7 +186,8 @@ class MineSeeker extends React.Component {
|
||||
name: payload.users.blue !== '' ? payload.users.blue : payload.users.blueAnon,
|
||||
desc: this.refs.gridControl.state.webPlayer === 'blue'
|
||||
? 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});
|
||||
|
||||
@@ -429,6 +429,7 @@ class GridControl extends React.Component {
|
||||
</div>
|
||||
</div>
|
||||
<UserControl ref="userControl"
|
||||
webPlayer={this.state.webPlayer}
|
||||
bombClear={this.bombClear.bind(this)}/>
|
||||
<div className="grid-container">
|
||||
<div className="grid"> {this.state.gridFields} </div>
|
||||
|
||||
@@ -44,6 +44,7 @@ class UserControl extends React.Component {
|
||||
<div className="users">
|
||||
<User ref="blue"
|
||||
color="blue"
|
||||
webPlayer={this.props.webPlayer}
|
||||
active={this.state.activePlayer === 1}
|
||||
onClickBombSelector={this.onClickBombSelector.bind(this, 1)}/>
|
||||
<div className="active-mines-container">
|
||||
@@ -57,6 +58,7 @@ class UserControl extends React.Component {
|
||||
<div className="clear"></div>
|
||||
<User ref="red"
|
||||
color="red"
|
||||
webPlayer={this.props.webPlayer}
|
||||
active={this.state.activePlayer === 0}
|
||||
onClickBombSelector={this.onClickBombSelector.bind(this, 0)}/>
|
||||
<div className="resign">
|
||||
|
||||
@@ -24,6 +24,17 @@ class User extends React.Component {
|
||||
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() {
|
||||
let src = this.state.srcRoot;
|
||||
|
||||
@@ -64,7 +75,7 @@ class User extends React.Component {
|
||||
<div className="user-control-mines">
|
||||
{this.state.mines}
|
||||
</div>
|
||||
<div className="bomb-container" onClick={this.props.onClickBombSelector}>
|
||||
<div className={this.getBombBuzzClass(this.props.webPlayer)} onClick={this.props.onClickBombSelector}>
|
||||
<div className="bomb">
|
||||
<img src={this.getBomb()} alt="bomb"/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user