From 549fec6a53e34615a09bad04faabaa95b8676384 Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Tue, 27 Jan 2026 16:56:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E5=90=91=E5=90=8E?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E4=BB=A3=E7=A0=81=E5=B9=B6=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=BB=91=E5=B9=95=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 showLoadingOverlay 和 hideLoadingOverlay 向后兼容函数 - 直接使用 PageLoader.show() 和 PageLoader.hide() - 重构黑幕样式,添加文章内容选择器支持 - 优化夜间模式黑幕颜色(#1a1a1a) - 添加 article .entry-content 和 .article-content 选择器 - 确保黑幕在所有文章容器中正常显示 - 改进代码结构和注释 --- argontheme.js | 17 ++----- style.css | 127 +++++++++++++++++++++++++++++++++++--------------- 2 files changed, 92 insertions(+), 52 deletions(-) diff --git a/argontheme.js b/argontheme.js index de64085..2ab1232 100644 --- a/argontheme.js +++ b/argontheme.js @@ -3452,17 +3452,6 @@ const PageLoader = (function() { destroy: destroy }; })(); - -/** - * 向后兼容的函数 - */ -function showLoadingOverlay() { - PageLoader.show(); -} - -function hideLoadingOverlay() { - PageLoader.hide(); -} function startPageTransition() { document.documentElement.classList.add('page-transition-enter'); pjaxContainers.forEach(function(selector) { @@ -3510,7 +3499,7 @@ $(document).pjax( NProgress.remove(); NProgress.start(); pjaxLoading = true; - showLoadingOverlay(); + PageLoader.show(); }).on('pjax:afterGetContainers', function(e, f, g) { pjaxScrollTop = 0; if ($("html").hasClass("banner-as-cover")){ @@ -3547,7 +3536,7 @@ $(document).pjax( startPageTransition(); activatePageTransition(); setTimeout(function() { - hideLoadingOverlay(); + PageLoader.hide(); endPageTransition(); }, 320); @@ -3621,7 +3610,7 @@ $(document).pjax( NProgress.done(); }).on('pjax:error', function() { - hideLoadingOverlay(); + PageLoader.hide(); endPageTransition(); pjaxLoading = false; }).on('pjax:end', function() { diff --git a/style.css b/style.css index cde4e78..0337a2c 100644 --- a/style.css +++ b/style.css @@ -12802,67 +12802,118 @@ html.using-safari .friend-link-description:after { * 放置于这里的CSS将应用于所有皮�? * 萌娘百科仅开放Vector皮肤 * 请尊重萌娘百科版权,以下代码除非注明均是管理员手敲出来的!!!复制需要注明源自萌娘百科,并且附上URL地址 `http://zh.moegirl.org/MediaWiki:Common.css` - * 版权协定:知识共�?署名-非商业性使�?相同方式共享 3.0 - * 复制之后请把图片换成自己网站上URL地址�? - */ - -.heimu, .heimu a, a .heimu, .heimu a.new { - background-color: #252525 !important; - color: #252525 !important; - text-shadow: none !important; - transition: color var(--heimu-transition-time, .2s) ease, background-color var(--heimu-transition-time, .2s) ease; -} -.heimu a { color: inherit !important; transition: inherit; } -.heimu:hover, .heimu:active, -.heimu:hover .heimu, .heimu:active .heimu { - color: white !important; -} -.heimu:hover a, a:hover .heimu, -.heimu:active a, a:active .heimu { - color: inherit !important; -} -.heimu:hover .new, .heimu .new:hover, .new:hover .heimu, -.heimu:active .new, .heimu .new:active, .new:active .heimu { - color: #BA0000 !important; +/* ========================================================================== + 黑幕效果(Spoiler/Heimu) + ========================================================================== */ + +/* 基础黑幕样式 */ +.heimu, +.heimu a, +a .heimu, +.heimu a.new { + background-color: #252525 !important; + color: #252525 !important; + text-shadow: none !important; + transition: color 0.2s ease, background-color 0.2s ease; + cursor: pointer; +} +.heimu a { + color: inherit !important; + transition: inherit; } -/* Fix macro styles in dark mode */ -html.darkmode .heimu a, -html.darkmode .color-curtain a { - color: inherit !important; +/* 悬停和激活状态 */ +.heimu:hover, +.heimu:active, +.heimu:hover .heimu, +.heimu:active .heimu { + color: white !important; + background-color: transparent !important; +} +.heimu:hover a, +a:hover .heimu, +.heimu:active a, +a:active .heimu { + color: inherit !important; +} +.heimu:hover .new, +.heimu .new:hover, +.new:hover .heimu, +.heimu:active .new, +.heimu .new:active, +.new:active .heimu { + color: #BA0000 !important; } +/* 文章内容中的黑幕 */ +article .post-content .heimu, +article .entry-content .heimu, +.article-content .heimu { + background-color: #252525 !important; + color: #252525 !important; +} +article .post-content .heimu:hover, +article .entry-content .heimu:hover, +.article-content .heimu:hover, +article .post-content .heimu:active, +article .entry-content .heimu:active, +.article-content .heimu:active { + color: white !important; + background-color: transparent !important; +} + +/* 夜间模式 */ +html.darkmode .heimu, +html.darkmode .heimu a, +html.darkmode a .heimu, +html.darkmode .heimu a.new { + background-color: #1a1a1a !important; + color: #1a1a1a !important; +} +html.darkmode .heimu:hover, +html.darkmode .heimu:active { + color: #e0e0e0 !important; + background-color: transparent !important; +} +html.darkmode .heimu a { + color: inherit !important; +} html.darkmode .heimu:hover a, html.darkmode .color-curtain:hover a { - color: inherit !important; + color: inherit !important; } -/* Ensure heimu/color-curtain visibility in dark mode comment sections */ +/* 评论区黑幕 */ html.darkmode .comment-content .heimu, html.darkmode .comment-content .color-curtain { - background-color: #252525 !important; - color: #252525 !important; + background-color: #1a1a1a !important; + color: #1a1a1a !important; } - html.darkmode .comment-content .heimu:hover, html.darkmode .comment-content .heimu:active, html.darkmode .comment-content .color-curtain:hover, html.darkmode .comment-content .color-curtain:active { - color: #fff !important; + color: #e0e0e0 !important; + background-color: transparent !important; } -/* Disable global underline effect for links in macros to prevent animation conflicts */ +/* 禁用链接下划线动画(防止冲突) */ article .post-content .heimu a:before, +article .entry-content .heimu a:before, +.article-content .heimu a:before, article .post-content .color-curtain a:before, article .post-content .text-blur a:before, article .post-content .huhua a:before { - display: none !important; - content: none !important; + display: none !important; + content: none !important; } -/* Ensure links in macros inherit transition properties */ -.heimu a, .color-curtain a, .text-blur a, .huhua a { - transition: inherit !important; +/* 确保宏内链接继承过渡属性 */ +.heimu a, +.color-curtain a, +.text-blur a, +.huhua a { + transition: inherit !important; }