From d50db52f9ad397e2df90868df6c15d88e357ddb2 Mon Sep 17 00:00:00 2001 From: libccy Date: Wed, 30 Sep 2015 15:24:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E6=A3=8B=E6=A8=A1=E5=BC=8F=E6=94=B9?= =?UTF-8?q?=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 42 +++++++++++++++++++++++++++++++++------ layout/default/layout.css | 1 + layout/mode/chess.css | 5 +++++ mode/chess.js | 1 + 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/game/game.js b/game/game.js index b3d91497c..d884aaa71 100755 --- a/game/game.js +++ b/game/game.js @@ -4259,16 +4259,46 @@ if(list.length) this.$draw(list); }, $fire:function(){ - game.animate.flame(this.offsetLeft+this.offsetWidth/2, - this.offsetTop+this.offsetHeight-20,700,'fire'); + var left,top; + if(lib.config.mode=='chess'){ + var rect=this.getBoundingClientRect(); + left=rect.left; + top=rect.top; + } + else{ + left=this.offsetLeft; + top=this.offsetTop; + } + game.animate.flame(left+this.offsetWidth/2, + top+this.offsetHeight-20,700,'fire'); }, $thunder:function(){ - game.animate.flame(this.offsetLeft+this.offsetWidth/2, - this.offsetTop+this.offsetHeight-30,700,'thunder'); + var left,top; + if(lib.config.mode=='chess'){ + var rect=this.getBoundingClientRect(); + left=rect.left; + top=rect.top; + } + else{ + left=this.offsetLeft; + top=this.offsetTop; + } + game.animate.flame(left+this.offsetWidth/2, + top+this.offsetHeight-30,700,'thunder'); }, $recover:function(){ - game.animate.flame(this.offsetLeft+this.offsetWidth/2, - this.offsetTop+this.offsetHeight-30,700,'recover'); + var left,top; + if(lib.config.mode=='chess'){ + var rect=this.getBoundingClientRect(); + left=rect.left; + top=rect.top; + } + else{ + left=this.offsetLeft; + top=this.offsetTop; + } + game.animate.flame(left+this.offsetWidth/2, + top+this.offsetHeight-30,700,'recover'); }, $damagepop:function(num,nature){ if(typeof num=='number'){ diff --git a/layout/default/layout.css b/layout/default/layout.css index 45cc19c92..53bf93b80 100755 --- a/layout/default/layout.css +++ b/layout/default/layout.css @@ -217,6 +217,7 @@ margin-bottom: 5px; width: 100%; text-align: center; top:calc(50% - 36px); + left:0; opacity: 0; -webkit-transform:scale(0.7); } diff --git a/layout/mode/chess.css b/layout/mode/chess.css index 3f681abb4..1fccdc72b 100755 --- a/layout/mode/chess.css +++ b/layout/mode/chess.css @@ -28,6 +28,11 @@ #arena .card.thrown{ z-index:4; } +#canvas2{ + position: absolute; + z-index: 10; + pointer-events: none; +} #handcards1{ height:120px; diff --git a/mode/chess.js b/mode/chess.js index cbb087974..c81fd5442 100755 --- a/mode/chess.js +++ b/mode/chess.js @@ -624,6 +624,7 @@ mode.chess={ ui.chessContainer.style.WebkitOverflowScrolling='touch'; ui.chess=ui.create.div('#chess',ui.chessContainer); ui.canvas2=document.createElement('canvas'); + ui.canvas2.id='canvas2'; ui.chess.appendChild(ui.canvas2); ui.ctx2=ui.canvas2.getContext('2d'); game.me=ui.create.player();