1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-11-23 19:36:53 +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 .bbm-modal
background: white background: white
box-shadow: 0 0px 6px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.9)
/* BLOCKS */ /* BLOCKS */

View File

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

View File

@ -111,7 +111,9 @@ var Battle = (function(){
Promise.when(this.p1.reDraw(2), this.p2.reDraw(2)) Promise.when(this.p1.reDraw(2), this.p2.reDraw(2))
.then(function(){ .then(function(){
this.on("NextTurn", this.switchTurn); 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)); }.bind(this));
} }
@ -377,6 +379,12 @@ var Battle = (function(){
}) })
} }
r.sendNotificationTo = function(side, msg) {
side.send("notification", {
message: msg
}, true)
}
return Battle; return Battle;
})(); })();

View File

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