From 89b3626c84a8fbf63db4a1b612d0e4e2d9c6d4dd Mon Sep 17 00:00:00 2001 From: Jerry Date: Sun, 27 Jul 2025 15:26:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=20=E4=BF=AE=E5=BE=A9=20aside=20?= =?UTF-8?q?=E6=9C=80=E5=BE=8C=E4=B8=80=E5=80=8B=20=E6=B2=92=E6=9C=89=20mar?= =?UTF-8?q?gin-bottom=20=E7=9A=84=20bug=20feat:=20=E9=81=A9=E9=85=8D=20for?= =?UTF-8?q?tawesome=20v7=20improvement:=20=E5=84=AA=E5=8C=96=20loading=20?= =?UTF-8?q?=E5=8A=A0=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/includes/loading/fullpage-loading.pug | 11 ++++++++++- package.json | 2 +- plugins.yml | 14 +++++++------- source/css/_global/function.styl | 2 +- source/css/_global/index.styl | 4 ++++ source/css/_layout/aside.styl | 4 ++-- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/layout/includes/loading/fullpage-loading.pug b/layout/includes/loading/fullpage-loading.pug index a3d0098..503e988 100644 --- a/layout/includes/loading/fullpage-loading.pug +++ b/layout/includes/loading/fullpage-loading.pug @@ -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') diff --git a/package.json b/package.json index 8787d82..294a2f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "5.4.2", + "version": "5.4.3", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": { diff --git a/plugins.yml b/plugins.yml index b9a5132..9984a9a 100644 --- a/plugins.yml +++ b/plugins.yml @@ -9,7 +9,7 @@ activate_power_mode: algolia_search: name: algoliasearch file: dist/lite/builds/browser.umd.js - version: 5.30.0 + version: 5.34.1 aplayer_css: name: aplayer file: dist/APlayer.min.css @@ -80,12 +80,12 @@ egjs_infinitegrid: fancybox: name: '@fancyapps/ui' file: dist/fancybox/fancybox.umd.js - version: 6.0.7 + version: 6.0.17 other_name: fancyapps-ui fancybox_css: name: '@fancyapps/ui' file: dist/fancybox/fancybox.css - version: 6.0.7 + version: 6.0.17 other_name: fancyapps-ui fireworks: name: butterfly-extsrc @@ -111,7 +111,7 @@ instantpage: instantsearch: name: instantsearch.js file: dist/instantsearch.production.min.js - version: 4.79.0 + version: 4.79.2 katex: name: katex file: dist/katex.min.css @@ -137,7 +137,7 @@ medium_zoom: mermaid: name: mermaid file: dist/mermaid.min.js - version: 11.8.0 + version: 11.9.0 meting_js: name: butterfly-extsrc file: metingjs/dist/Meting.min.js @@ -203,9 +203,9 @@ waline_css: name: '@waline/client' file: dist/waline.css other_name: waline - version: 3.5.7 + version: 3.6.0 waline_js: name: '@waline/client' file: dist/waline.js other_name: waline - version: 3.5.7 + version: 3.6.0 diff --git a/source/css/_global/function.styl b/source/css/_global/function.styl index e1a173c..c2aa551 100644 --- a/source/css/_global/function.styl +++ b/source/css/_global/function.styl @@ -11,7 +11,7 @@ .fontawesomeIcon display: inline-block font-weight: 600 - font-family: 'Font Awesome 6 Free' + font-family: 'Font Awesome 7 Free', 'Font Awesome 6 Free' text-rendering: auto -webkit-font-smoothing: antialiased diff --git a/source/css/_global/index.styl b/source/css/_global/index.styl index 212f654..ca17ad3 100644 --- a/source/css/_global/index.styl +++ b/source/css/_global/index.styl @@ -222,3 +222,7 @@ blockquote & > :last-child margin-bottom: 0 !important + +.fa-fw + width: 1.25em + text-align: center \ No newline at end of file diff --git a/source/css/_layout/aside.styl b/source/css/_layout/aside.styl index 5495097..1bf056a 100644 --- a/source/css/_layout/aside.styl +++ b/source/css/_layout/aside.styl @@ -23,8 +23,8 @@ &:not(#card-toc) display: none - &:last-child - margin-bottom: 0 + // &:last-child + // margin-bottom: 0 .card-info .author-info