1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-11-20 11:26:54 +00:00

some modal and notification changes

This commit is contained in:
exane 2015-07-04 18:30:08 +02:00
parent 0b76e18554
commit 4ed01e1035
4 changed files with 26 additions and 12 deletions

View File

@ -1,10 +1,6 @@
.bbm-wrapper
background: rgba(0,0,0,.75)
-webkit-transition: background-color .3s
.bbm-modal
background: white
box-shadow: 0 0px 6px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.9)
/* BLOCKS */

View File

@ -48,7 +48,7 @@ body {
}
.bbm-wrapper {
background: rgba(6, 13, 22, 0.9);
//background: rgba(6, 13, 22, 0.9);
padding: 7% 0 0 0;
}
@ -58,6 +58,7 @@ body {
max-width: 100%;
border-radius: 0;
margin: auto;
background: rgba(6, 13, 22, 0.9);
}
.btn-sub {
@ -79,6 +80,10 @@ body {
transform: translate(-50%, 0px);
left: 50%;
width: 500px;
background: rgba(6, 13, 22, 0.9);
//padding: 15px;
padding: 50px 0;
margin-top: -30px;
}
.card {

View File

@ -111,7 +111,9 @@ var Battle = (function(){
Promise.when(this.p1.reDraw(2), this.p2.reDraw(2))
.then(function(){
this.on("NextTurn", this.switchTurn);
this.switchTurn(Math.random() > 0.5 ? this.p1 : this.p2);
var side = Math.random() > 0.5 ? this.p1 : this.p2;
this.sendNotification(side.getName() + " begins!");
this.switchTurn(side);
}.bind(this));
}
@ -377,6 +379,12 @@ var Battle = (function(){
})
}
r.sendNotificationTo = function(side, msg) {
side.send("notification", {
message: msg
}, true)
}
return Battle;
})();

View File

@ -857,32 +857,37 @@ Battleside = (function(){
if(!left) return;
left--;
var card = self.hand.remove(id)[0];
//console.log("hand -> deck: ", card.getName());
self.deck.add(card);
self.deck.shuffle();
self.draw(1);
if(!left){
self.send("redraw:close", null, true);
//console.log("redraw finished");
self.wait();
deferred.resolve("done");
//self.socket.off("redraw:reDrawCard", h1);
self.sendNotificationTo(self.foe, self.getName() + " finished redraw phase.")
}
/*self.update(self);*/
self.battle.updateSelf(self);
})
this.receive("redraw:close_client", function(){
//console.log("redraw finished!");
self.wait();
deferred.resolve("done");
//self.socket.off("redraw:close_client", h2);
self.sendNotificationTo(self.foe, self.getName() + " finished redraw phase.")
})
return deferred;
}
r.sendNotificationTo = function(side, msg){
this.battle.sendNotificationTo(side, msg);
}
r.sendNotification = function(msg){
this.battle.sendNotification(msg);
}