mirror of
https://github.com/mue/mue.git
synced 2026-07-19 06:54:10 +02:00
feat: hot reload and fixes for weather, quicklinks and quote
This commit is contained in:
@@ -72,7 +72,30 @@ export default class SettingsFunctions {
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
static loadSettings(noeasteregg) {
|
||||
static loadSettings(hotreload) {
|
||||
document.getElementById('widgets').style.zoom = localStorage.getItem('widgetzoom') + '%';
|
||||
|
||||
const theme = localStorage.getItem('theme');
|
||||
switch (theme) {
|
||||
case 'dark':
|
||||
document.body.classList.add('dark');
|
||||
break;
|
||||
case 'auto':
|
||||
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
document.body.classList.add('dark');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
document.body.classList.remove('dark');
|
||||
}
|
||||
|
||||
const tabName = localStorage.getItem('tabName') || window.language.tabname;
|
||||
document.title = tabName;
|
||||
|
||||
if (hotreload === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
const css = localStorage.getItem('customcss');
|
||||
if (css) {
|
||||
document.head.insertAdjacentHTML('beforeend', '<style>' + css + '</style>');
|
||||
@@ -106,7 +129,7 @@ export default class SettingsFunctions {
|
||||
<style>
|
||||
${url}
|
||||
* {
|
||||
font-family: '${font}', 'Lexend Deca' !important;
|
||||
font-family: '${font}', 'Lexend Deca', 'Roboto' !important;
|
||||
${fontweight}
|
||||
${fontstyle}
|
||||
}
|
||||
@@ -118,34 +141,6 @@ export default class SettingsFunctions {
|
||||
experimentalInit();
|
||||
}
|
||||
|
||||
const widgetzoom = localStorage.getItem('widgetzoom');
|
||||
document.getElementById('root').style.zoom = widgetzoom + '%';
|
||||
|
||||
const theme = localStorage.getItem('theme');
|
||||
switch (theme) {
|
||||
case 'dark':
|
||||
document.body.classList.add('dark');
|
||||
break;
|
||||
case 'auto':
|
||||
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
document.body.classList.add('dark');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
document.body.classList.remove('dark');
|
||||
}
|
||||
|
||||
const tabName = localStorage.getItem('tabName');
|
||||
if (tabName !== window.language.tabname) {
|
||||
document.title = tabName;
|
||||
} else {
|
||||
document.title = window.language.tabname;
|
||||
}
|
||||
|
||||
if (noeasteregg === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
// easter egg
|
||||
console.log(`
|
||||
█████████████████████████████████████████████████████████████
|
||||
|
||||
Reference in New Issue
Block a user