[mobile] for bug 57560
This commit is contained in:
parent
1595ba125b
commit
16f0e09949
|
@ -92,6 +92,10 @@ body.theme-type-dark {
|
|||
animation: flickerAnimation 2s infinite ease-in-out;
|
||||
}
|
||||
|
||||
.framework7-initializing .page-content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@keyframes flickerAnimation {
|
||||
0% { opacity:0.1; }
|
||||
50% { opacity:1; }
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
|
||||
let obj = !localStorage ? {id: 'theme-light', type: 'light'} : JSON.parse(localStorage.getItem("ui-theme"));
|
||||
if ( !obj ) {
|
||||
obj = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ?
|
||||
{id: 'theme-dark', type: 'dark'} : {id: 'theme-light', type: 'light'};
|
||||
localStorage && localStorage.setItem("ui-theme", JSON.stringify(obj));
|
||||
}
|
||||
|
||||
document.body.classList.add(`theme-type-${obj.type}`);
|
||||
|
||||
const load_stylesheet = reflink => {
|
||||
let link = document.createElement( "link" );
|
||||
link.href = reflink;
|
||||
link.type = "text/css";
|
||||
// link.type = "text/css";
|
||||
link.rel = "stylesheet";
|
||||
|
||||
document.getElementsByTagName("head")[0].appendChild(link);
|
||||
};
|
||||
|
||||
if ( !localStorage && localStorage.getItem('mode-direction') === 'rtl' ) {
|
||||
document.body.classList.add('rtl');
|
||||
load_stylesheet('./css/framework7-rtl.css')
|
||||
document.body.classList.add('rtl');
|
||||
} else {
|
||||
load_stylesheet('./css/framework7.css')
|
||||
}
|
||||
|
||||
let obj = !localStorage ? {id: 'theme-light', type: 'light'} : JSON.parse(localStorage.getItem("ui-theme"));
|
||||
if ( !obj ) {
|
||||
obj = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ?
|
||||
{id: 'theme-dark', type: 'dark'} : {id: 'theme-light', type: 'light'};
|
||||
localStorage && localStorage.setItem("ui-theme", JSON.stringify(obj));
|
||||
}
|
||||
|
||||
document.body.classList.add(`theme-type-${obj.type}`);
|
||||
|
|
Loading…
Reference in a new issue