fix: 修復 aside 最後一個 沒有 margin-bottom 的 bug

feat: 適配 fortawesome v7
improvement: 優化 loading 加載
This commit is contained in:
Jerry
2025-07-27 15:26:28 +08:00
Unverified
parent a61e216452
commit 89b3626c84
6 changed files with 25 additions and 12 deletions

View File

@@ -14,6 +14,7 @@ script.
const $body = document.body
const preloader = {
endLoading: () => {
if ($loadingBox.classList.contains('loaded')) return
$body.style.overflow = ''
$loadingBox.classList.add('loaded')
},
@@ -24,7 +25,15 @@ script.
}
preloader.initLoading()
window.addEventListener('load', preloader.endLoading)
if (document.readyState === 'complete') {
preloader.endLoading()
} else {
window.addEventListener('load', preloader.endLoading)
document.addEventListener('DOMContentLoaded', preloader.endLoading)
// Add timeout protection: force end after 7 seconds
setTimeout(preloader.endLoading, 7000)
}
if (!{theme.pjax && theme.pjax.enable}) {
btf.addGlobalFn('pjaxSend', preloader.initLoading, 'preloader_init')