按钮效果

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
塔防模式
修复若干bug
提升性能
1.5.5.1
修复安卓版的两个显示问题
按钮效果

View File

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

View File

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

View File

@ -275,7 +275,7 @@
xueji_bg:'雪霁',
yinxiang_bg:'印象',
chunhui_bg:'春晖',
grass_bg:'芳草',
// grass_bg:'芳草',
huangtian_bg:'黄天',
},
onclick:function(background){
@ -590,6 +590,11 @@
}
}
},
button_press:{
name:'按钮效果',
init:true,
unfrequent:true,
},
animation:{
name:'游戏特效',
init:true,
@ -4109,7 +4114,7 @@
}
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){
ui.updateh();
}
@ -6224,7 +6229,7 @@
if(!equipped){
player.node.equips.appendChild(card);
}
player.node.equips.dataset.number=player.num('e');
// player.node.equips.dataset.number=player.num('e');
return player;
},
$gain:function(card,log,init){
@ -7066,6 +7071,21 @@
node.link=item;
node.innerHTML=get.translation(item);
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(){
ui.controls.remove(this);
@ -11894,6 +11914,7 @@
game.onresume2();
}
ui.arena.classList.remove('menupaused');
ui.config2.classList.remove('pressdown2');
};
var clickMenuItem=function(){
var node=this.parentNode._link;
@ -11996,6 +12017,7 @@
for(var i=0;i<menuUpdates.length;i++){
menuUpdates[i]();
}
ui.config2.classList.add('pressdown2');
ui.arena.classList.add('menupaused');
}
else{
@ -13103,6 +13125,17 @@
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;
},
pause:function(){
@ -14152,6 +14185,7 @@
button:function(){
if(_status.dragged) return;
if(_status.clicked) return;
if(_status.tempNoButton) return;
if(this.classList.contains('noclick')) return;
_status.clicked=true;
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>div{height: 100%;position: relative;margin: 0;padding: 0;pointer-events: auto}
#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;}
#paused2{font-size: 30px;top:calc(50% - 17px);left:calc(50% - 45px);}
#sidebar,#sidebar2,#sidebar3{
@ -247,7 +247,7 @@ margin-bottom: 5px;
.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>*{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{font-size: 18px;white-space: nowrap;position: relative;overflow: hidden;opacity:0}
.control:not(.nozoom){width:0}
@ -281,7 +281,7 @@ margin-bottom: 5px;
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>.damage{
font-family: 'huangcao';
@ -852,9 +852,13 @@ div[data-color="unknownm"]{
.firetext{
color: rgb(255,119,63);
}
.thundertext{
.thundertext,
.controlthundertext{
color: rgb(117,186,255);
}
.controlthundertext{
/*transform: scale(0.95);*/
}
.poisontext{
color: rgb(104,221,127);
}

View File

@ -213,7 +213,7 @@
.menu.main>.menu-content>div>.menubutton.round{
left:335px;
top:197px;
z-index:1;
z-index:3;
transition-property: color, box-shadow;
transition-duration:0.3s;
position:absolute;
@ -367,6 +367,12 @@
.menubutton.active{
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{
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.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
if(_status.dragged) return;
_status.tempNoButton=true;
setTimeout(function(){
_status.tempNoButton=false;
},500);
if(game.zhu.name){
game.zhu.uninit();
delete game.zhu.isZhu;

View File

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