按钮效果

This commit is contained in:
libccy 2015-11-14 23:48:04 +08:00
parent dbbc942828
commit 2ae6a68159
8 changed files with 68 additions and 16 deletions

View File

@ -1,4 +1,3 @@
1.5.5 1.5.5.1
塔防模式 修复安卓版的两个显示问题
修复若干bug 按钮效果
提升性能

View File

@ -201,8 +201,8 @@ card.standard={
if(player.hasSkillTag('pretao')) return 5; if(player.hasSkillTag('pretao')) return 5;
return 2; return 2;
}, },
useful:[8,6], useful:[8,6.5],
value:[8,6], value:[8,6.5],
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){

View File

@ -238,6 +238,7 @@ window.config={
paused:false, paused:false,
title:false, title:false,
right_sidebar:false, right_sidebar:false,
button_press:true,
modeconfig:false, modeconfig:false,
gameconfig:false, gameconfig:false,

View File

@ -275,7 +275,7 @@
xueji_bg:'雪霁', xueji_bg:'雪霁',
yinxiang_bg:'印象', yinxiang_bg:'印象',
chunhui_bg:'春晖', chunhui_bg:'春晖',
grass_bg:'芳草', // grass_bg:'芳草',
huangtian_bg:'黄天', huangtian_bg:'黄天',
}, },
onclick:function(background){ onclick:function(background){
@ -590,6 +590,11 @@
} }
} }
}, },
button_press:{
name:'按钮效果',
init:true,
unfrequent:true,
},
animation:{ animation:{
name:'游戏特效', name:'游戏特效',
init:true, init:true,
@ -4109,7 +4114,7 @@
} }
this.node.count.innerHTML=numh; this.node.count.innerHTML=numh;
} }
this.node.equips.dataset.number=this.num('e'); // this.node.equips.dataset.number=this.num('e');
if(this==game.me){ if(this==game.me){
ui.updateh(); ui.updateh();
} }
@ -6224,7 +6229,7 @@
if(!equipped){ if(!equipped){
player.node.equips.appendChild(card); player.node.equips.appendChild(card);
} }
player.node.equips.dataset.number=player.num('e'); // player.node.equips.dataset.number=player.num('e');
return player; return player;
}, },
$gain:function(card,log,init){ $gain:function(card,log,init){
@ -7066,6 +7071,21 @@
node.link=item; node.link=item;
node.innerHTML=get.translation(item); node.innerHTML=get.translation(item);
node.addEventListener(lib.config.touchscreen?'touchend':'click',ui.click.control); node.addEventListener(lib.config.touchscreen?'touchend':'click',ui.click.control);
if(lib.config.button_press){
node.addEventListener(lib.config.touchscreen?'touchstart':'mousedown',function(e){
node.classList.add('controlthundertext');
node.parentNode.classList.add('controlpressdown');
});
node.addEventListener(lib.config.touchscreen?'touchend':'mouseup',function(e){
node.classList.remove('controlthundertext');
node.parentNode.classList.remove('controlpressdown');
});
node.addEventListener(lib.config.touchscreen?'touchmove':'mousemove',function(e){
node.classList.remove('controlthundertext');
node.parentNode.classList.remove('controlpressdown');
});
}
}, },
close:function(){ close:function(){
ui.controls.remove(this); ui.controls.remove(this);
@ -11894,6 +11914,7 @@
game.onresume2(); game.onresume2();
} }
ui.arena.classList.remove('menupaused'); ui.arena.classList.remove('menupaused');
ui.config2.classList.remove('pressdown2');
}; };
var clickMenuItem=function(){ var clickMenuItem=function(){
var node=this.parentNode._link; var node=this.parentNode._link;
@ -11996,6 +12017,7 @@
for(var i=0;i<menuUpdates.length;i++){ for(var i=0;i<menuUpdates.length;i++){
menuUpdates[i](); menuUpdates[i]();
} }
ui.config2.classList.add('pressdown2');
ui.arena.classList.add('menupaused'); ui.arena.classList.add('menupaused');
} }
else{ else{
@ -13103,6 +13125,17 @@
func.call(this,e); func.call(this,e);
}); });
} }
if(lib.config.button_press){
node.addEventListener(lib.config.touchscreen?'touchstart':'mousedown',function(e){
node.classList.add('pressdown');
});
node.addEventListener(lib.config.touchscreen?'touchend':'mouseup',function(e){
node.classList.remove('pressdown');
});
node.addEventListener(lib.config.touchscreen?'touchmove':'mousemove',function(e){
node.classList.remove('pressdown');
});
}
return node; return node;
}, },
pause:function(){ pause:function(){
@ -14152,6 +14185,7 @@
button:function(){ button:function(){
if(_status.dragged) return; if(_status.dragged) return;
if(_status.clicked) return; if(_status.clicked) return;
if(_status.tempNoButton) return;
if(this.classList.contains('noclick')) return; if(this.classList.contains('noclick')) return;
_status.clicked=true; _status.clicked=true;
var custom=_status.event.custom; var custom=_status.event.custom;

View File

@ -46,7 +46,7 @@ table{table-layout: fixed;}
#system{padding: 6px;width: calc(100% - 12px);white-space: nowrap;z-index: 3;pointer-events: none} #system{padding: 6px;width: calc(100% - 12px);white-space: nowrap;z-index: 3;pointer-events: none}
#system>div{height: 100%;position: relative;margin: 0;padding: 0;pointer-events: auto} #system>div{height: 100%;position: relative;margin: 0;padding: 0;pointer-events: auto}
#system>div:last-child{text-align: right;float:right} #system>div:last-child{text-align: right;float:right}
#system>div>div{position: relative;padding-top: 6px;padding-bottom: 6px;padding-left: 8px;padding-right: 8px;text-align: center;margin:4px} #system>div>div{position: relative;padding-top: 6px;padding-bottom: 6px;padding-left: 8px;padding-right: 8px;text-align: center;margin:4px;transition: all 0.1s}
#paused,#click{left: 0;top:0;width: 100%;height: 100%;z-index: 5;} #paused,#click{left: 0;top:0;width: 100%;height: 100%;z-index: 5;}
#paused2{font-size: 30px;top:calc(50% - 17px);left:calc(50% - 45px);} #paused2{font-size: 30px;top:calc(50% - 17px);left:calc(50% - 45px);}
#sidebar,#sidebar2,#sidebar3{ #sidebar,#sidebar2,#sidebar3{
@ -247,7 +247,7 @@ margin-bottom: 5px;
.button.character>.identity{top:-6px;left:72px;} .button.character>.identity{top:-6px;left:72px;}
/*--------确认--------*/ /*--------确认--------*/
#control{text-align: center;z-index: 2;top: calc(200% / 3);left: calc(5% + 240px);width: calc(90% - 480px);pointer-events: none} #control{text-align: center;z-index: 2;top: calc(200% / 3);left: calc(5% + 240px);width: calc(90% - 480px);pointer-events: none}
#control>*{pointer-events: auto} #control>*{pointer-events: auto;}
.control{padding-top: 2px;padding-bottom: 2px;padding-left: 4px;padding-right: 4px;margin-left: 4px;margin-right: 4px;} .control{padding-top: 2px;padding-bottom: 2px;padding-left: 4px;padding-right: 4px;margin-left: 4px;margin-right: 4px;}
.control{font-size: 18px;white-space: nowrap;position: relative;overflow: hidden;opacity:0} .control{font-size: 18px;white-space: nowrap;position: relative;overflow: hidden;opacity:0}
.control:not(.nozoom){width:0} .control:not(.nozoom){width:0}
@ -281,7 +281,7 @@ margin-bottom: 5px;
filter:grayscale(1); filter:grayscale(1);
-webkit-filter:grayscale(1); -webkit-filter:grayscale(1);
} }
.player>.name{left: 18px;top:36px;font-family: 'huangcao';font-size:20px} .player>.name{left: 16px;top:36px;font-family: 'huangcao';font-size:20px}
.player>.intro{top:87px;left: 18px;} .player>.intro{top:87px;left: 18px;}
.player>.damage{ .player>.damage{
font-family: 'huangcao'; font-family: 'huangcao';
@ -852,9 +852,13 @@ div[data-color="unknownm"]{
.firetext{ .firetext{
color: rgb(255,119,63); color: rgb(255,119,63);
} }
.thundertext{ .thundertext,
.controlthundertext{
color: rgb(117,186,255); color: rgb(117,186,255);
} }
.controlthundertext{
/*transform: scale(0.95);*/
}
.poisontext{ .poisontext{
color: rgb(104,221,127); color: rgb(104,221,127);
} }

View File

@ -213,7 +213,7 @@
.menu.main>.menu-content>div>.menubutton.round{ .menu.main>.menu-content>div>.menubutton.round{
left:335px; left:335px;
top:197px; top:197px;
z-index:1; z-index:3;
transition-property: color, box-shadow; transition-property: color, box-shadow;
transition-duration:0.3s; transition-duration:0.3s;
position:absolute; position:absolute;
@ -367,6 +367,12 @@
.menubutton.active{ .menubutton.active{
background-image: linear-gradient(rgba(47,101,150,1), rgba(43, 90, 132,1)); background-image: linear-gradient(rgba(47,101,150,1), rgba(43, 90, 132,1));
} }
#system>div>.pressdown,.controlpressdown{
transform: scale(0.95);
}
#system>div>.pressdown2{
background-image: linear-gradient(rgba(47,101,150,1), rgba(43, 90, 132,1));
}
.menubutton.highlight{ .menubutton.highlight{
background-image: linear-gradient(rgba(150, 47, 47, 1), rgba(132, 43, 43, 1)); background-image: linear-gradient(rgba(150, 47, 47, 1), rgba(132, 43, 43, 1));
} }

View File

@ -292,6 +292,10 @@ mode.identity={
td.innerHTML=get.translation(list[i]+'2'); td.innerHTML=get.translation(list[i]+'2');
td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){ td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
if(_status.dragged) return; if(_status.dragged) return;
_status.tempNoButton=true;
setTimeout(function(){
_status.tempNoButton=false;
},500);
if(game.zhu.name){ if(game.zhu.name){
game.zhu.uninit(); game.zhu.uninit();
delete game.zhu.isZhu; delete game.zhu.isZhu;

View File

@ -30,19 +30,23 @@ html{
.popup.thunder{ .popup.thunder{
color: rgb(117,186,255); color: rgb(117,186,255);
} }
.control .thundertext{ .control .thundertext,
.control .controlthundertext{
color: rgba(29, 63, 137, 1); color: rgba(29, 63, 137, 1);
} }
.player,.card,.button,.dialog>.bar, .player,.card,.button,.dialog>.bar,
#arena.mobile:not(.chess) .player[data-position='0'] .equips{ #arena.mobile:not(.chess) .player[data-position='0'] .equips{
background: url('wood.jpg'); background: url('wood.jpg');
} }
.control,#system>div>div,.menubutton{ .control,#system>div>div,.menubutton,#system>div>.pressdown2{
background: url('wood2.jpg'); background: url('wood2.jpg');
color:rgba(77, 60, 51,0.8); color:rgba(77, 60, 51,0.8);
text-shadow:none; text-shadow:none;
border-radius:4px; border-radius:4px;
} }
#system>div>.pressdown2{
box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(0, 133, 255, 0.8) 0 0 0 2px, rgba(0, 133, 255, 1) 0 0 5px !important;
}
.judges>div,.marks>div{ .judges>div,.marks>div{
border-radius:4px; border-radius:4px;
} }