fix: 移除向后兼容代码并修复黑幕样式

- 移除 showLoadingOverlay 和 hideLoadingOverlay 向后兼容函数
- 直接使用 PageLoader.show() 和 PageLoader.hide()
- 重构黑幕样式,添加文章内容选择器支持
- 优化夜间模式黑幕颜色(#1a1a1a)
- 添加 article .entry-content 和 .article-content 选择器
- 确保黑幕在所有文章容器中正常显示
- 改进代码结构和注释
This commit is contained in:
2026-01-27 16:56:32 +08:00
parent 1eb5d85eaf
commit 549fec6a53
2 changed files with 92 additions and 52 deletions

View File

@@ -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() {

123
style.css
View File

@@ -12802,67 +12802,118 @@ html.using-safari .friend-link-description:after {
* 放置于这里的CSS将应用于所有皮<E69C89>?
* 萌娘百科仅开放Vector皮肤
* 请尊重萌娘百科版权以下代码除非注明均是管理员手敲出来的复制需要注明源自萌娘百科并且附上URL地址 `http://zh.moegirl.org/MediaWiki:Common.css`
* 版权协定知识共<E8AF86>?署名-非商业性使<E680A7>?相同方式共享 3.0
* 复制之后请把图片换成自己网站上URL地址<E59CB0>?
*/
/* ==========================================================================
黑幕效果Spoiler/Heimu
========================================================================== */
.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,
.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; }
.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;
.heimu a {
color: inherit !important;
transition: inherit;
}
/* Fix macro styles in dark mode */
/* 悬停和激活状态 */
.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 .color-curtain a {
color: inherit !important;
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;
}