This commit is contained in:
libccy 2017-03-17 14:41:34 +08:00
parent a555b7ed68
commit 6bbbc1921a
7 changed files with 295 additions and 11 deletions

View File

@ -1,11 +1,11 @@
window.noname_asset_list=[
'1.9.10.7',
'1.9.10.8',
'image/background/huangtian_bg.jpg',
'image/background/september_bg.jpg',
'image/background/shengshi_bg.jpg',
'image/background/taoyuan_bg.jpg',
'image/background/xueji_bg.jpg',
'image/background/yinxiang_bg.jpg',
'image/background/zhanhuo_bg.jpg',
'image/background/zhulian_bg.jpg',
'image/background/zhulin_bg.jpg',
'image/card/bagua.png',

View File

@ -38,7 +38,7 @@ window.config={
image_character:['default'],
image_background:['default','huangyueying_bg','zhulian_bg',
'september_bg','xueji_bg','yinxiang_bg','chunhui_bg',
'zhanhuo_bg','xueji_bg','yinxiang_bg','chunhui_bg',
'grass_bg','huangtian_bg'],
image_background_filter:['default','blur','gray','sepia','invert','saturate','contrast','hue','brightness'],
background_music:['music_default','music_diaochan','music_shezhan','music_danji','music_random','music_off']

View File

@ -445,6 +445,12 @@
name:'主题',
init:'woodden',
item:{},
visualMenu:function(node,link){
if(!node.menu){
node.className='button character themebutton '+link;
node.menu=ui.create.div(node,'','<div></div><div></div><div></div><div></div>');
}
},
onclick:function(theme){
game.saveConfig('theme',theme);
ui.arena.hide();
@ -466,6 +472,126 @@
long:'新版',
long2:'手杀',
},
visualMenu:function(node,link){
node.className='button character themebutton '+lib.config.theme;
if(!node.created){
node.created=true;
node.style.overflow='hidden';
node.firstChild.style.display='none';
// node.firstChild.classList.add('shadowed');
// node.firstChild.style.width='16px';
// node.firstChild.style.height='auto';
// node.firstChild.style.padding='2px';
// node.firstChild.style.textAlign='center';
var me=ui.create.div(node);
me.style.top='auto';
if(link=='default'||link=='newlayout'){
me.style.width='calc(100% - 6px)';
me.style.left='3px';
me.style.bottom='3px';
me.style.height='25px';
}
else if(link=='long2'){
me.style.display='none';
}
else{
me.style.width='120%';
me.style.left='-10%';
me.style.bottom='0';
me.style.height='22px';
}
for(var i=0;i<4;i++){
var player=ui.create.div('.fakeplayer',node);
if(i!=3){
player.style.top='auto';
}
if(link=='default'){
player.style.height='19px';
player.style.width='38px';
}
else if(link=='mobile'||link=='newlayout'){
player.style.width='24px';
player.style.height='29px';
}
else{
player.style.width='20px';
player.style.height='34px';
}
if(i==1){
player.style.left='3px';
}
if(i==2){
player.style.left='auto';
player.style.right='3px';
}
if(i==3){
player.style.top='3px';
}
if(link=='default'){
if(i==0){
player.style.bottom='6px';
}
if(i==0||i==3){
player.style.left='calc(50% - 18px)';
}
if(i==1||i==2){
player.style.bottom='36px';
}
}
else if(link=='newlayout'){
if(i==0){
player.style.bottom='1px';
}
if(i==0||i==3){
player.style.left='calc(50% - 12px)';
}
if(i==1||i==2){
player.style.bottom='32px';
}
}
else if(link=='mobile'){
if(i==0||i==3){
player.style.left='calc(50% - 12px)';
}
if(i==1||i==2){
player.style.bottom='30px';
}
if(i==0){
player.style.borderRadius='0px';
player.style.left='-2px';
player.style.bottom='-7px';
}
}
else if(link=='long'){
if(i==0||i==3){
player.style.left='calc(50% - 10px)';
}
if(i==1||i==2){
player.style.bottom='30px';
}
if(i==0){
player.style.borderRadius='0px';
player.style.left='-2px';
player.style.width='24px';
player.style.height='29px';
player.style.bottom='-7px';
}
}
else if(link=='long2'){
if(i==0){
player.style.bottom='2px';
player.style.left='3px';
}
if(i==3){
player.style.left='calc(50% - 10px)';
}
if(i==1||i==2){
player.style.bottom='41px';
}
}
}
}
},
onclick:function(layout){
if(lib.layoutfixed.contains(lib.config.mode)){
game.saveConfig('layout',layout);
@ -579,6 +705,37 @@
default:'默认',
custom:'自定',
},
visualMenu:function(node,link,name,config){
node.className='button character';
node.style.backgroundImage='';
node.style.backgroundSize='';
if(link=='default'||link=='custom'){
if(lib.config.theme=='simple'){
node.style.backgroundImage='linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))';
}
else{
node.style.backgroundImage='none';
node.classList.add('dashedmenubutton');
}
if(link=='custom'){
game.getDB('image','background',function(fileToLoad){
if(!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function(fileLoadedEvent)
{
var data = fileLoadedEvent.target.result;
node.style.backgroundImage='url('+data+')';
node.style.backgroundSize='cover';
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
}
}
else{
node.setBackgroundImage('image/background/'+link+'.jpg');
node.style.backgroundSize='cover';
}
},
onclick:function(background){
var animate=lib.config.image_background=='default';
game.saveConfig('image_background',background);
@ -23816,6 +23973,14 @@
if(get.is.phoneLayout()&&rect.top*1.3+rect.height*1.3+20>ui.window.offsetHeight){
node.style.top=(ui.window.offsetHeight-20-rect.height*1.3)/1.3+'px';
}
else if(node.classList.contains('visual')){
node.style.top=(e.y-node.offsetHeight/2+30)+'px';
for(var i=0;i<node.childElementCount;i++){
if(node.childNodes[i].update){
node.childNodes[i].update();
}
}
}
popupContainer.classList.remove('hidden');
popupContainer.onclose=onclose;
};
@ -23969,6 +24134,9 @@
node.classList.add('pointerspan');
}
if(config.item){
if(typeof config.item=='function'){
config.item=config.item();
}
if(Array.isArray(config.init)){
}
@ -23976,12 +24144,30 @@
node.classList.add('switcher');
node.listen(clickSwitcher);
ui.create.div('',config.item[config.init],node);
node._link.menu=ui.create.div('.menu');
node._link.menu=ui.create.div('.menu');
if(config.visualMenu){
node._link.menu.classList.add('visual');
for(var i in config.item){
var visualMenu=ui.create.div();
var updateVisual=function(){
config.visualMenu(this,this._link,config.item[this._link],config);
};
ui.create.div('.name',get.verticalStr(config.item[i]),visualMenu);
visualMenu._link=i;
if(config.visualMenu(visualMenu,i,config.item[i],config)!==false){
visualMenu.listen(clickMenuItem);
}
visualMenu.update=updateVisual;
node._link.menu.appendChild(visualMenu);
}
}
else{
for(var i in config.item){
ui.create.div('',config.item[i],node._link.menu,clickMenuItem)._link=i;
}
}
node._link.menu._link=node;
node._link.current=config.init;
for(var i in config.item){
ui.create.div('',config.item[i],node._link.menu,clickMenuItem)._link=i;
}
node._link.current=config.init;
}
}
else if(config.range){

View File

@ -51,7 +51,7 @@ background.pack={
zhulin_bg:'竹林',
shengshi_bg:'盛世',
taoyuan_bg:'桃园',
september_bg:'九月',
zhanhuo_bg:'战火',
yinxiang_bg:'印象',
huangtian_bg:'黄天',
};

BIN
image/background/zhanhuo_bg.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 KiB

View File

@ -474,6 +474,10 @@
max-height: 400px;
transition-property: opacity;
}
.popup-container>.menu.visual{
padding: 5px;
max-width: 300px;
}
.popup-container>.menu>div{
padding-top:5px;
padding-bottom:5px;
@ -483,6 +487,92 @@
display: block;
transition: all 0s;
}
.popup-container>.menu.visual>.dashedmenubutton{
box-shadow: none !important;
width: 86px;
height: 86px;
border: 2px dashed rgb(40,40,40);
}
.themebutton>div{
width:50px;
height:76px;
top:7px;
right:7px;
border-radius:4px;
}
.themebutton>div>div{
width:calc(100% - 10px);
height:12px;
display:block;
margin-left:5px;
margin-top:6px;
position:relative;
border-radius:2px;
box-shadow:rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(0, 0, 0, 0.3) 0 0 5px;
transition: all 0s;
}
.themebutton>div:first-child{
z-index: 2;
}
.themebutton.woodden{
background:url('../../theme/woodden/grid.png'),linear-gradient(#6c7989, #434b55) fixed;
}
.themebutton.woodden>div:not(*:first-child){
background: url('../../theme/woodden/wood2.png');
box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.45) 0 3px 10px;
}
.themebutton.woodden>div.fakeplayer:not(*:first-child){
box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.45) 0 0px 10px;
}
.themebutton.woodden>div>div{
background: url('../../theme/woodden/wood.png');
}
.themebutton.woodden>div>div:hover,.themebutton.woodden>div>div.active{
box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(0, 133, 255, 0.4) 0 0 0 2px, rgba(0, 133, 255, 1) 0 0 5px !important;
}
.themebutton.music{
background:url('../../theme/music/grid.png'),linear-gradient(#333333, #222222) fixed;
}
.themebutton.music>div:not(*:first-child){
background: linear-gradient(#4b4b4b, #464646);
box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.2) 0 3px 10px;
}
.themebutton.music>div>div{
background: linear-gradient(#4b4b4b, #464646);
}
.themebutton.simple{
background:url('../../image/background/shengshi_bg.jpg');
background-size: cover;
}
.themebutton.simple>div:not(*:first-child){
background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));
box-shadow: rgba(0, 0, 0, 0.4) 0 0 0 1px, rgba(0, 0, 0, 0.2) 0 3px 10px;
}
.themebutton.simple>div>div{
background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));
}
.themebutton.simple>div>div:hover,
.themebutton.simple>div>div.active,
.themebutton.music>div>div:hover,
.themebutton.music>div>div.active{
background-image: linear-gradient(rgba(47,101,150,1), rgba(43, 90, 132,1));
}
.themebutton>div>div:first-child{
margin-top:5px;
}
#window:not(.nopointer) .popup-container>.menu>div{
cursor: pointer;
}
.popup-container>.menu.visual>div{
display: inline-block;
margin:5px !important;
padding: 0 !important;
width: 90px;
height: 90px;
}
.popup-container>.menu.visual>.button.character>.name{
top: 10px;
}
.popup-container>.menu>div:first-child{
margin-top:5px;
}
@ -814,7 +904,7 @@
box-shadow: rgba(51, 51, 51, 1) 0 0 0 1px, rgba(0, 0, 0, 0.2) 0 3px 10px;
}
.popup-container>.menu>div:hover{
.popup-container>.menu:not(.visual)>div:hover{
color:white;
background-image: linear-gradient(rgba(47,101,150,1), rgba(43, 90, 132,1));
box-shadow: rgba(0,0,0,0.2) 0 0 0 1px;

View File

@ -33,6 +33,11 @@ html{
color:rgba(77, 60, 51,0.8);
text-shadow:none;
}
.popup-container>.menu.visual>.dashedmenubutton{
color:rgba(77, 60, 51,0.8);
text-shadow: none;
border-color:rgba(77, 60, 51,0.8);
}
.cardbg{
background-size: initial !important;
}
@ -144,6 +149,9 @@ html{
.menubutton.round.active{
box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(0, 133, 255, 0.4) 0 0 0 2px, rgba(0, 133, 255, 1) 0 0 5px !important;
}
.themebutton{
box-shadow: rgba(0, 0, 0, 0.45) 0 0 0 1px, rgba(0, 0, 0, 0.45) 0 3px 10px !important;
}
.config.toggle>div>div{
background: url('wood.png');
box-shadow: rgba(151, 151, 151, 1) 0 0 0 1px, rgba(0, 0, 0, 0.2) 0 3px 10px;
@ -160,7 +168,7 @@ html{
line-height: 26px;
font-family: 'xinwei'
}
.popup-container>.menu>div:hover{
.popup-container>.menu:not(.visual)>div:hover{
color:white;
background-image: linear-gradient(rgb(0, 133, 255), rgb(5, 119, 220));
box-shadow: none;