mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 17:40:55 +08:00
fix: 修復 aside 最後一個 沒有 margin-bottom 的 bug
feat: 適配 fortawesome v7 improvement: 優化 loading 加載
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user