Fix the loading screen when `lib.init.layout`.

This commit is contained in:
Tipx-L 2023-10-25 09:17:46 -07:00
parent 00072acb39
commit eee7e72992
2 changed files with 31 additions and 12 deletions

View File

@ -11184,10 +11184,10 @@
}
},
layout:function(layout,nosave){
const previousTransitionDuration=document.documentElement.style.transitionDuration;
document.documentElement.style.transitionDuration='1s';
const previousFilter=document.documentElement.style.filter,previousWebkitFilter=document.documentElement.style.webkitFilter;
document.documentElement.style.filter=document.documentElement.style.webkitFilter='brightness(0)';
const loadingScreen=ui.create.div('.loading-screen',document.body),loadingScreenStyle=loadingScreen.style;
loadingScreenStyle.animationDuration='1s';
loadingScreenStyle.animationFillMode='forwards';
loadingScreenStyle.animationName='opacity-0-1';
if(layout=='default') layout='mobile';
if(!nosave) game.saveConfig('layout',layout);
game.layout=layout;
@ -11298,14 +11298,8 @@
return new Promise(resolve=>setTimeout(resolve,500));
}).then(()=>{
ui.updatec();
if(previousFilter) document.documentElement.style.filter=previousFilter;
else document.documentElement.style.removeProperty('filter');
if(previousWebkitFilter) document.documentElement.style.webkitFilter=previousWebkitFilter;
else document.documentElement.style.removeProperty('-webkit-filter');
return new Promise(resolve=>setTimeout(resolve,1000));
}).then(()=>{
if(previousTransitionDuration) document.documentElement.style.transitionDuration=previousTransitionDuration;
else document.documentElement.style.removeProperty('transition-duration');
loadingScreenStyle.animationName='opacity-1-0';
loadingScreen.addEventListener('animationend',animationEvent=>animationEvent.target.remove());
});
},
background:function(){

View File

@ -5041,6 +5041,13 @@ div[data-decoration="bronze"]::after{
border-radius: 16px;
}
.loading-screen {
background-color: black;
height: 100%;
width: 100%;
z-index: 31415926;
}
/*--------动画--------*/
@keyframes shadow_thunder {
0% {
@ -5542,6 +5549,24 @@ div[data-decoration="bronze"]::after{
background-position: left center;
}
}
@keyframes opacity-0-1 {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes opacity-1-0 {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
/*--------其它--------*/
::-webkit-scrollbar {
display: none;