邮件列表加载动画优化和打包拆分

This commit is contained in:
eoao
2025-08-26 23:10:55 +08:00
parent de0bb288ec
commit 01cef2355d
119 changed files with 732 additions and 330 deletions

View File

@@ -55,24 +55,33 @@ export async function init() {
document.title = setting.title;
}
const loading = document.getElementById('loading-first');
if (!setting.background) {
loading.remove();
removeLoading();
return;
}
const img = new Image();
img.src = cvtR2Url(setting.background);
img.onload = () => {
loading.remove();
removeLoading();
};
img.onerror = () => {
console.warn('背景图片加载失败:', img.src);
loading.remove();
removeLoading();
};
}
function removeLoading() {
if (window.innerWidth < 1025) {
document.documentElement.style.setProperty('--loading-hide-transition', 'none')
}
const doc = document.getElementById('loading-first');
doc.classList.add('loading-hide')
setTimeout(() => {
doc.remove()
},1000)
}