Compare commits

...

10 Commits

Author SHA1 Message Date
e34bfe5047 docs: 补充评论系统完整实现细节 2026-02-02 00:05:46 +08:00
5c362b1075 docs: 细化 Argon 主题培训文档
- 补充全局配置对象的详细说明和实际代码示例
- 细化 CSS 变量系统,包含主题色、动画、卡片样式等完整变量
- 扩展夜间模式章节,详细说明四种切换方案和 AMOLED 模式
- 重写 PJAX 章节,补充完整的事件流程和重新初始化逻辑
- 细化瀑布流布局,包含完整算法、响应式适配和性能优化
- 新增主题初始化流程章节,详细说明服务器端和客户端初始化过程
- 补充资源加载策略和强制刷新机制的实现细节
- 所有代码示例均来自实际项目文件,确保准确性
2026-01-31 18:49:02 +08:00
c9cebf0c14 fix: 为所有卡片添加毛玻璃效果
- 修改 .card 基础样式,添加 backdrop-filter 支持
- 使用 rgba 背景色配合 var(--card-opacity) 实现透明度控制
- 所有卡片(文章、评论、侧边栏等)现在都会应用毛玻璃模糊和饱和度效果
- 夜间模式下使用深色半透明背景
2026-01-27 23:49:32 +08:00
a12af3c4df fix: 从后台设置读取透明度和毛玻璃效果参数
- 在 header.php 中读取后台设置的透明度和毛玻璃参数
- 输出 CSS 变量:--bg-opacity、--card-opacity、--card-blur、--card-saturate、--toolbar-blur
- 顶栏模糊度自动计算为卡片模糊度的 60%
- 移除 style.css 中的硬编码默认值,完全由后台设置控制
- 确保毛玻璃效果(backdrop-filter)正常工作
2026-01-27 23:43:55 +08:00
731f573b2c feat: 统一透明度与毛玻璃效果的 CSS 变量控制
- 新增 CSS 变量:--bg-opacity (0.90)、--card-opacity (0.60)、--card-blur (20px)、--card-saturate (180%)、--toolbar-blur (12px)
- 顶栏毛玻璃效果:使用 var(--toolbar-blur) 和 var(--card-blur) 控制
- 卡片透明度:使用 var(--card-opacity) 统一控制所有卡片背景透明度
- 毛玻璃模糊:使用 var(--card-blur) 统一控制模糊半径
- 毛玻璃饱和度:使用 var(--card-saturate) 统一控制色彩饱和度
- 背景透明度:使用 var(--bg-opacity) 控制页面背景和下拉菜单等元素
- 移动端适配:自动计算适合移动端的模糊值(如 calc(var(--card-blur) / 3))
- 统一替换所有硬编码的 blur() 值为变量驱动
- 支持通过后台设置动态调整所有透明度和毛玻璃效果
2026-01-27 23:36:45 +08:00
549fec6a53 fix: 移除向后兼容代码并修复黑幕样式
- 移除 showLoadingOverlay 和 hideLoadingOverlay 向后兼容函数
- 直接使用 PageLoader.show() 和 PageLoader.hide()
- 重构黑幕样式,添加文章内容选择器支持
- 优化夜间模式黑幕颜色(#1a1a1a)
- 添加 article .entry-content 和 .article-content 选择器
- 确保黑幕在所有文章容器中正常显示
- 改进代码结构和注释
2026-01-27 16:56:32 +08:00
1eb5d85eaf feat: 全新设计的现代化页面加载系统
设计亮点:
- SVG 圆环进度指示器,实时显示加载进度
- 智能进度算法:自动递增 + 缓动效果
- 中心旋转图标 + 脉冲动画
- 延迟显示骨架屏(避免快速加载时闪烁)
- 最小显示时间控制(400ms)防止闪烁

加载逻辑优化:
- 智能进度管理:0-90% 自动递增,完成时跳转 100%
- 缓动函数:越接近完成速度越慢,更自然
- 定时器管理:防止内存泄漏和状态冲突
- 骨架屏延迟 150ms 显示,快速加载不显示

视觉设计:
- 渐变背景 + 毛玻璃效果
- 弹性入场动画(scale + translateY)
- 流畅的光影扫过效果
- 完整的响应式适配
- 支持无障碍访问(prefers-reduced-motion)
2026-01-27 16:52:11 +08:00
73103ea853 refactor: 重构加载动画代码,提升可维护性
JavaScript 重构:
- 创建 LoadingOverlay 模块化管理器(IIFE 模式)
- 封装元素创建、显示、隐藏和销毁逻辑
- 添加定时器管理,防止内存泄漏
- 提供向后兼容的函数接口
- 使用常量管理配置项(ID、类名、动画时长)
- 改进代码注释和 JSDoc 文档

CSS 重构:
- 统一类名前缀为 loading-*,语义更清晰
- 移除 ID 选择器依赖,改用类选择器
- 分离关注点:基础旋转器、进度条、遮罩层、骨架屏
- 添加结构化注释,便于定位和修改
- 优化选择器层级,提升性能
- 独立动画关键帧定义

代码改进:
- 减少重复代码,提高复用性
- 更好的错误处理和边界情况处理
- 支持多次调用不会重复创建元素
- 清晰的模块边界和职责划分
2026-01-27 16:46:13 +08:00
67d1465014 feat: 全面优化加载动画视觉效果
- 重新设计骨架屏布局:卡片式设计,包含缩略图、头像、标题、文本和标签
- 添加光影流动效果(shimmer)增强视觉吸引力
- 优化旋转器设计:双环结构 + 弹跳点动画
- 改进文字提示:更友好的加载文案
- 增强动画效果:缩放 + 位移的入场动画
- 完善响应式设计:适配平板和手机屏幕
- 优化夜间模式:更深的背景和更柔和的阴影
- 提升整体视觉层次感和现代感
2026-01-27 16:41:53 +08:00
7f79a14e3e fix: 修复 jQuery 选择器语法错误并优化加载动画
- 增强 jQuery 选择器验证,防止空选择器和中文标点导致的语法错误
- 修复 'Syntax error, unrecognized expression' 报错
- 优化加载动画:动态创建 overlay 元素,无需在 HTML 中预定义
- 改进加载动画显示逻辑,添加骨架屏和加载提示文字
- 添加详细的函数注释说明
2026-01-27 16:35:36 +08:00
4 changed files with 4719 additions and 207 deletions

View File

@@ -44,6 +44,31 @@ if (typeof jQuery !== 'undefined') {
return x === 1 ? 1 : 1 - Math.pow(2, -10 * x);
};
}
if (!$.fn._argonInit) {
$.fn._argonInit = $.fn.init;
$.fn.init = function(selector, context, root) {
// 修复空选择器、特殊字符和中文标点导致的语法错误
if (typeof selector === 'string') {
let trimmed = selector.trim();
// 检查是否为空或只有 # 符号
if (trimmed === '' || trimmed === '#') {
return new $.fn._argonInit();
}
// 检查是否包含中文标点(可能导致语法错误)
if (/[;,。:!?]/.test(trimmed)) {
console.warn('[Argon] Invalid selector with Chinese punctuation:', selector);
return new $.fn._argonInit();
}
// 检查 ID 选择器是否有效(#后面必须有内容)
if (/^#\s*$/.test(trimmed)) {
return new $.fn._argonInit();
}
}
return $.fn._argonInit.call(this, selector, context, root);
};
$.fn.init.prototype = $.fn;
}
// 确保 zoomify 插件存在
if (typeof $.fn.zoomify === 'undefined') {
@@ -2336,17 +2361,34 @@ $(document).on("submit" , ".post-password-form" , function(){
/*URL 和# 根据 ID 定位*/
function gotoHash(hash, durtion, easing = 'easeOutExpo'){
if (hash.length == 0){
if (!hash || hash === "#"){
return;
}
if ($(hash).length == 0){
var target = null;
var decodedId = "";
try {
decodedId = decodeURIComponent(hash.slice(1));
} catch (err) {
decodedId = hash.slice(1);
}
if (decodedId) {
target = document.getElementById(decodedId);
}
if (!target) {
try {
target = document.querySelector(hash);
} catch (err) {
return;
}
}
if (!target){
return;
}
if (durtion == null){
durtion = 200;
}
$("body,html").stop().animate({
scrollTop: $(hash).offset().top - 80
scrollTop: $(target).offset().top - 80
}, durtion, easing);
}
function getHash(url){
@@ -2565,6 +2607,16 @@ function loadImageOptimized(img, effect) {
requestAnimationFrame(function() {
img.src = src;
img.removeAttribute('data-src');
let srcset = img.getAttribute('data-srcset');
if (srcset) {
img.setAttribute('srcset', srcset);
img.removeAttribute('data-srcset');
}
let sizes = img.getAttribute('data-sizes');
if (sizes) {
img.setAttribute('sizes', sizes);
img.removeAttribute('data-sizes');
}
img.classList.remove('lazyload');
// 移除所有lazyload-style-* 类
@@ -2579,6 +2631,16 @@ function loadImageOptimized(img, effect) {
requestAnimationFrame(function() {
img.src = src;
img.removeAttribute('data-src');
let srcset = img.getAttribute('data-srcset');
if (srcset) {
img.setAttribute('srcset', srcset);
img.removeAttribute('data-srcset');
}
let sizes = img.getAttribute('data-sizes');
if (sizes) {
img.setAttribute('sizes', sizes);
img.removeAttribute('data-sizes');
}
img.classList.remove('lazyload');
img.className = img.className.replace(/\blazyload-style-\d+\b/g, '').trim();
@@ -2688,6 +2750,16 @@ function loadAllImagesImmediately() {
if (src) {
img.src = src;
img.removeAttribute('data-src');
let srcset = img.getAttribute('data-srcset');
if (srcset) {
img.setAttribute('srcset', srcset);
img.removeAttribute('data-srcset');
}
let sizes = img.getAttribute('data-sizes');
if (sizes) {
img.setAttribute('sizes', sizes);
img.removeAttribute('data-sizes');
}
img.classList.remove('lazyload');
img.className = img.className.replace(/\blazyload-style-\d+\b/g, '').trim();
}
@@ -3085,6 +3157,9 @@ function executeInlineScripts(container) {
// 需求 4.3: 按照脚本在 DOM 中的顺序执行
scripts.forEach((script, index) => {
if (script.getAttribute('data-pjax-executed') === 'true') {
return;
}
// 需求 4.2: 只执行内联脚本(没有 src 属性的脚本)
if (!script.src) {
// 跳过空脚本
@@ -3098,6 +3173,7 @@ function executeInlineScripts(container) {
// 需求 4.4: 错误隔离 - 单个脚本失败不影响其他脚本
const success = executeScript(script);
if (success) {
script.setAttribute('data-pjax-executed', 'true');
successCount++;
} else {
failedCount++;
@@ -3118,9 +3194,288 @@ function executeInlineScripts(container) {
return result;
}
var pjaxContainerSelectors = ['#primary', '#leftbar_part1_menu', '#leftbar_part2_inner', '.page-information-card-container', '#rightbar', '#wpadminbar'];
var pjaxContainers = pjaxContainerSelectors.filter(function(selector) {
return document.querySelector(selector);
});
// ==========================================================================
// 现代化页面加载系统
// ==========================================================================
/**
* 页面加载管理器 - 提供智能加载动画和进度追踪
*/
const PageLoader = (function() {
// 配置常量
const CONFIG = {
OVERLAY_ID: 'page-loader',
MIN_DISPLAY_TIME: 400, // 最小显示时间(避免闪烁)
FADE_DURATION: 350, // 淡出动画时长
PROGRESS_STEP: 0.1, // 进度条步进
PROGRESS_INTERVAL: 200, // 进度更新间隔
SKELETON_DELAY: 150 // 骨架屏延迟显示
};
// 状态管理
let state = {
element: null,
isVisible: false,
startTime: 0,
progress: 0,
progressTimer: null,
hideTimer: null,
skeletonTimer: null
};
/**
* 创建加载动画 HTML
*/
function createHTML() {
return `
<div class="page-loader-backdrop"></div>
<div class="page-loader-content">
<!-- 进度环 -->
<div class="loader-ring-container">
<svg class="loader-ring" viewBox="0 0 100 100">
<circle class="loader-ring-bg" cx="50" cy="50" r="45"></circle>
<circle class="loader-ring-progress" cx="50" cy="50" r="45"></circle>
</svg>
<div class="loader-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2v4m0 12v4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83M2 12h4m12 0h4M4.93 19.07l2.83-2.83m8.48-8.48l2.83-2.83"/>
</svg>
</div>
</div>
<!-- 加载文字 -->
<div class="loader-text">
<div class="loader-title">加载中</div>
<div class="loader-subtitle">正在为您准备内容</div>
</div>
<!-- 骨架屏(延迟显示) -->
<div class="loader-skeleton">
<div class="skeleton-card">
<div class="skeleton-image"></div>
<div class="skeleton-content">
<div class="skeleton-title"></div>
<div class="skeleton-line"></div>
<div class="skeleton-line short"></div>
</div>
</div>
</div>
</div>
`;
}
/**
* 创建加载器元素
*/
function createElement() {
const el = document.createElement('div');
el.id = CONFIG.OVERLAY_ID;
el.className = 'page-loader';
el.innerHTML = createHTML();
return el;
}
/**
* 获取或创建元素
*/
function getElement() {
if (!state.element) {
state.element = document.getElementById(CONFIG.OVERLAY_ID);
if (!state.element) {
state.element = createElement();
document.body.appendChild(state.element);
}
}
return state.element;
}
/**
* 更新进度环
*/
function updateProgress(progress) {
const el = state.element;
if (!el) return;
const circle = el.querySelector('.loader-ring-progress');
if (circle) {
const circumference = 2 * Math.PI * 45;
const offset = circumference - (progress / 100) * circumference;
circle.style.strokeDashoffset = offset;
}
state.progress = progress;
}
/**
* 自动递增进度
*/
function startProgressAnimation() {
stopProgressAnimation();
state.progress = 0;
updateProgress(0);
state.progressTimer = setInterval(function() {
if (state.progress < 90) {
// 使用缓动函数,越接近 90% 越慢
const increment = CONFIG.PROGRESS_STEP * (1 - state.progress / 100);
state.progress = Math.min(90, state.progress + increment * 10);
updateProgress(state.progress);
}
}, CONFIG.PROGRESS_INTERVAL);
}
/**
* 停止进度动画
*/
function stopProgressAnimation() {
if (state.progressTimer) {
clearInterval(state.progressTimer);
state.progressTimer = null;
}
}
/**
* 完成进度到 100%
*/
function completeProgress() {
stopProgressAnimation();
updateProgress(100);
}
/**
* 显示加载器
*/
function show() {
// 清理之前的定时器
if (state.hideTimer) {
clearTimeout(state.hideTimer);
state.hideTimer = null;
}
if (state.skeletonTimer) {
clearTimeout(state.skeletonTimer);
state.skeletonTimer = null;
}
const el = getElement();
state.startTime = Date.now();
state.isVisible = true;
// 移除隐藏类,添加显示类
el.classList.remove('is-hiding');
void el.offsetWidth; // 强制重排
el.classList.add('is-visible');
// 启动进度动画
startProgressAnimation();
// 延迟显示骨架屏(避免快速加载时闪烁)
state.skeletonTimer = setTimeout(function() {
if (state.isVisible && el) {
el.classList.add('show-skeleton');
}
}, CONFIG.SKELETON_DELAY);
}
/**
* 隐藏加载器
*/
function hide() {
if (!state.isVisible) return;
const el = state.element;
if (!el) return;
// 完成进度
completeProgress();
// 计算已显示时间
const elapsedTime = Date.now() - state.startTime;
const remainingTime = Math.max(0, CONFIG.MIN_DISPLAY_TIME - elapsedTime);
// 确保最小显示时间后再隐藏
state.hideTimer = setTimeout(function() {
el.classList.add('is-hiding');
el.classList.remove('show-skeleton');
// 动画结束后清理
setTimeout(function() {
el.classList.remove('is-visible', 'is-hiding');
state.isVisible = false;
stopProgressAnimation();
}, CONFIG.FADE_DURATION);
}, remainingTime);
}
/**
* 设置进度(手动控制)
*/
function setProgress(progress) {
progress = Math.max(0, Math.min(100, progress));
stopProgressAnimation();
updateProgress(progress);
}
/**
* 销毁加载器
*/
function destroy() {
stopProgressAnimation();
if (state.hideTimer) {
clearTimeout(state.hideTimer);
state.hideTimer = null;
}
if (state.skeletonTimer) {
clearTimeout(state.skeletonTimer);
state.skeletonTimer = null;
}
if (state.element && state.element.parentNode) {
state.element.parentNode.removeChild(state.element);
}
state.element = null;
state.isVisible = false;
}
// 公开 API
return {
show: show,
hide: hide,
setProgress: setProgress,
destroy: destroy
};
})();
function startPageTransition() {
document.documentElement.classList.add('page-transition-enter');
pjaxContainers.forEach(function(selector) {
var c = document.querySelector(selector);
if (c) c.classList.add('page-transition-content');
});
}
function activatePageTransition() {
requestAnimationFrame(function() {
document.documentElement.classList.add('page-transition-active');
});
}
function endPageTransition() {
document.documentElement.classList.remove('page-transition-active');
document.documentElement.classList.remove('page-transition-enter');
pjaxContainers.forEach(function(selector) {
var c = document.querySelector(selector);
if (c) c.classList.remove('page-transition-content');
});
}
$.pjax.defaults.timeout = 10000;
$.pjax.defaults.container = ['#primary', '#leftbar_part1_menu', '#leftbar_part2_inner', '.page-information-card-container', '#rightbar', '#wpadminbar'];
$.pjax.defaults.fragment = ['#primary', '#leftbar_part1_menu', '#leftbar_part2_inner', '.page-information-card-container', '#rightbar', '#wpadminbar'];
$.pjax.defaults.container = pjaxContainers;
$.pjax.defaults.fragment = pjaxContainers;
/*
* PJAX 事件处理优化说明:
@@ -3134,15 +3489,17 @@ $.pjax.defaults.fragment = ['#primary', '#leftbar_part1_menu', '#leftbar_part2_i
* - pjax:complete: 需求 1.5, 1.6 (模块初始化和错误隔离)
* - pjax:end: 需求 1.7 (特定任务处理)
*/
$(document).pjax("a[href]:not([no-pjax]):not(.no-pjax):not([target='_blank']):not([download]):not(.reference-link):not(.reference-list-backlink)")
if (argonConfig.disable_pjax != true && argonConfig.disable_pjax != 'true') {
$(document).pjax(
"a[href]:not([no-pjax]):not(.no-pjax):not([target='_blank']):not([download]):not(.reference-link):not(.reference-list-backlink):not([href^='#'])",
pjaxContainers.length ? pjaxContainers[0] : '#primary',
{ fragment: (pjaxContainers.length ? pjaxContainers : ['#primary']), timeout: $.pjax.defaults.timeout }
)
.on('pjax:click', function(e, f, g){
if (argonConfig.disable_pjax == true){
e.preventDefault();
return;
}
NProgress.remove();
NProgress.start();
pjaxLoading = true;
PageLoader.show();
}).on('pjax:afterGetContainers', function(e, f, g) {
pjaxScrollTop = 0;
if ($("html").hasClass("banner-as-cover")){
@@ -3152,6 +3509,7 @@ $(document).pjax("a[href]:not([no-pjax]):not(.no-pjax):not([target='_blank']):no
}
}).on('pjax:send', function() {
NProgress.set(0.618);
startPageTransition();
}).on('pjax:beforeReplace', function(e, dom) {
// ========== 需求 1.1-1.4: 清理旧页面的所有资源 ==========
// 调用统一的资源清理管理器
@@ -3175,10 +3533,21 @@ $(document).pjax("a[href]:not([no-pjax]):not(.no-pjax):not([target='_blank']):no
// ========== 需求 1.5, 1.6: 重新初始化所有功能模块 ==========
pjaxLoading = false;
NProgress.inc();
startPageTransition();
activatePageTransition();
setTimeout(function() {
PageLoader.hide();
endPageTransition();
}, 320);
// ========== 需求 4.1-4.5: 执行新页面中的内联脚本 ==========
try {
executeInlineScripts(document);
pjaxContainers.forEach(function(selector) {
var container = document.querySelector(selector);
if (container) {
executeInlineScripts(container);
}
});
} catch (err) {
ArgonDebug.error('executeInlineScripts failed:', err);
}
@@ -3240,6 +3609,10 @@ $(document).pjax("a[href]:not([no-pjax]):not(.no-pjax):not([target='_blank']):no
}
NProgress.done();
}).on('pjax:error', function() {
PageLoader.hide();
endPageTransition();
pjaxLoading = false;
}).on('pjax:end', function() {
// ========== 需求 1.7: 执行特定任务 ==========
@@ -3255,6 +3628,7 @@ $(document).pjax("a[href]:not([no-pjax]):not(.no-pjax):not([target='_blank']):no
// GT4: PJAX 后确保评论页验证码已初始化
resetGT4Captcha();
});
}
window.addEventListener('hashchange', function() {
handleHashNavigation();
@@ -3270,7 +3644,14 @@ if (document.readyState === 'loading') {
/*Reference 跳转*/
$(document).on("click", ".reference-link , .reference-list-backlink" , function(e){
e.preventDefault();
$target = $($(this).attr("href"));
var href = $(this).attr("href");
if (!href || href === "#" ) { return; }
var $target;
try {
$target = $(href);
} catch (err) {
return;
}
$("body,html").animate({
scrollTop: $target.offset().top - document.body.clientHeight / 2 - 75
}, 500, 'easeOutExpo')
@@ -3283,7 +3664,7 @@ $(document).on("click", ".reference-link , .reference-list-backlink" , function(
}, 1);
});
/*Tags Dialog pjax 加载后自动关闭/
/*Tags Dialog pjax 加载后自动关闭 */
$(document).on("click" , "#blog_tags .tag" , function(){
$("#blog_tags button.close").trigger("click");
});
@@ -4591,10 +4972,29 @@ void 0;
if (progress >= 90) { clearInterval(interval); progress = 90; }
bar.style.width = progress + '%';
}, 100);
var overlay = document.getElementById('article-loading-overlay');
if (!overlay) {
overlay = document.createElement('div');
overlay.id = 'article-loading-overlay';
var inner = document.createElement('div');
inner.className = 'overlay-content';
inner.innerHTML = '<div class="overlay-title"></div><div class="overlay-thumb"></div><div class="overlay-row" style="width:85%"></div><div class="overlay-row" style="width:70%"></div><div class="overlay-row" style="width:90%"></div><div class="overlay-grid"><div class="overlay-grid-item"></div><div class="overlay-grid-item"></div></div><div class="center-spinner"><div class="loading-spinner"></div><div class="overlay-row" style="width:120px;height:14px;margin:0"></div></div>';
overlay.appendChild(inner);
document.body.appendChild(overlay);
}
overlay.classList.remove('is-hiding');
requestAnimationFrame(function() {
overlay.classList.add('is-visible');
});
window.addEventListener('load', function() {
clearInterval(interval);
bar.style.width = '100%';
setTimeout(function() { bar.style.opacity = '0'; setTimeout(function() { bar.remove(); }, 300); }, 200);
if (overlay) {
overlay.classList.remove('is-visible');
overlay.classList.add('is-hiding');
setTimeout(function() { if (overlay && overlay.parentNode) overlay.parentNode.removeChild(overlay); }, 360);
}
});
}
@@ -4607,12 +5007,32 @@ void 0;
if (!bar) { bar = document.createElement('div'); bar.id = 'page-loading-bar'; document.body.appendChild(bar); }
bar.style.opacity = '1'; bar.style.width = '30%';
setTimeout(function() { bar.style.width = '60%'; }, 200);
var overlay = document.getElementById('article-loading-overlay');
if (!overlay) {
overlay = document.createElement('div');
overlay.id = 'article-loading-overlay';
var inner = document.createElement('div');
inner.className = 'overlay-content';
inner.innerHTML = '<div class="overlay-title"></div><div class="overlay-thumb"></div><div class="overlay-row" style="width:85%"></div><div class="overlay-row" style="width:70%"></div><div class="overlay-row" style="width:90%"></div><div class="overlay-grid"><div class="overlay-grid-item"></div><div class="overlay-grid-item"></div></div><div class="center-spinner"><div class="loading-spinner"></div><div class="overlay-row" style="width:120px;height:14px;margin:0"></div></div>';
overlay.appendChild(inner);
document.body.appendChild(overlay);
}
overlay.classList.remove('is-hiding');
requestAnimationFrame(function() {
overlay.classList.add('is-visible');
});
});
jQuery(document).on('pjax:end', function() {
jQuery('#primary').removeClass('pjax-loading');
var bar = document.getElementById('page-loading-bar');
if (bar) { bar.style.width = '100%'; setTimeout(function() { bar.style.opacity = '0'; setTimeout(function() { bar.remove(); }, 300); }, 200); }
setTimeout(function() { initImageLoadAnimation(); initScrollAnimations(); initSmoothScroll(); }, 100);
var overlay = document.getElementById('article-loading-overlay');
if (overlay) {
overlay.classList.remove('is-visible');
overlay.classList.add('is-hiding');
setTimeout(function() { if (overlay && overlay.parentNode) overlay.parentNode.removeChild(overlay); }, 360);
}
});
}

3654
doc/argon-theme-training.md Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -726,18 +726,33 @@
$card_opacity = get_option('argon_post_background_opacity', '0.7');
$card_blur = get_option('argon_card_blur', '20');
$card_saturate = get_option('argon_card_saturate', '180');
$bg_opacity = get_option('argon_page_background_opacity', '1');
// 顶栏模糊度为卡片模糊度的 60%12px / 20px = 0.6
$toolbar_blur = round($card_blur * 0.6);
// 如果透明度为空或为1使用推荐默认值
if ($card_opacity == '' || $card_opacity == '1') {
$card_opacity = '0.7';
}
if ($bg_opacity == '') {
$bg_opacity = '1';
}
?>
<style id="theme_card_effect_css">
:root {
--bg-opacity: <?php echo $bg_opacity; ?>;
--card-opacity: <?php echo $card_opacity; ?>;
--card-blur: <?php echo $card_blur; ?>px;
--card-saturate: <?php echo $card_saturate; ?>%;
--toolbar-blur: <?php echo $toolbar_blur; ?>px;
--page-background-opacity: <?php echo $bg_opacity; ?>;
--banner-mask-height: 120px;
--banner-mask-opacity-top: 0.25;
--banner-mask-opacity-mid: 0.15;
--banner-mask-stop-mid: 35%;
--banner-title-shadow: 0 5px 15px rgba(0, 0, 0, .2);
}
</style>
@@ -1168,11 +1183,7 @@ if ($card_opacity == '' || $card_opacity == '1') {
background-size: cover;
background-repeat: no-repeat;
opacity: <?php echo (get_option('argon_page_background_opacity') == '' ? '1' : get_option('argon_page_background_opacity')); ?>;
transition: opacity .5s ease;
opacity: var(--page-background-opacity);
}
html.darkmode #content:before{
@@ -1217,7 +1228,7 @@ if ($card_opacity == '' || $card_opacity == '1') {
html.darkmode #content:after {
opacity: <?php echo (get_option('argon_page_background_opacity') == '' ? '1' : get_option('argon_page_background_opacity')); ?>;
opacity: var(--page-background-opacity);
}
@@ -1246,9 +1257,9 @@ if ($card_opacity == '' || $card_opacity == '1') {
.post-navigation.card,
.related-posts.card,
.card.bg-white {
background-color: rgba(255, 255, 255, <?php echo $post_bg_opacity_inline; ?>) !important;
backdrop-filter: blur(<?php echo $card_blur_inline; ?>px) saturate(<?php echo $card_saturate_inline; ?>%);
-webkit-backdrop-filter: blur(<?php echo $card_blur_inline; ?>px) saturate(<?php echo $card_saturate_inline; ?>%);
background-color: rgba(255, 255, 255, var(--card-opacity)) !important;
backdrop-filter: blur(var(--card-blur)) saturate(var(--card-saturate));
-webkit-backdrop-filter: blur(var(--card-blur)) saturate(var(--card-saturate));
background-clip: padding-box;
-webkit-transform: translateZ(0);
transform: translateZ(0);
@@ -1264,13 +1275,13 @@ if ($card_opacity == '' || $card_opacity == '1') {
html.darkmode .post-navigation.card,
html.darkmode .related-posts.card,
html.darkmode .card.bg-white {
background-color: rgba(66, 66, 66, <?php echo $post_bg_opacity_inline; ?>) !important;
background-color: rgba(66, 66, 66, var(--card-opacity)) !important;
}
#leftbar .card,
#leftbar_part1,
#leftbar_part2 {
backdrop-filter: blur(<?php echo $card_blur_inline; ?>px) saturate(<?php echo $card_saturate_inline; ?>%);
-webkit-backdrop-filter: blur(<?php echo $card_blur_inline; ?>px) saturate(<?php echo $card_saturate_inline; ?>%);
backdrop-filter: blur(var(--card-blur)) saturate(var(--card-saturate));
-webkit-backdrop-filter: blur(var(--card-blur)) saturate(var(--card-saturate));
}
</style>
@@ -1298,9 +1309,9 @@ if (apply_filters('argon_page_background_url', get_option('argon_page_background
.post-navigation.card,
.related-posts.card,
.card.bg-white {
background-color: rgba(255, 255, 255, <?php echo $post_bg_opacity_standalone; ?>) !important;
backdrop-filter: blur(<?php echo $card_blur_standalone; ?>px) saturate(<?php echo $card_saturate_standalone; ?>%);
-webkit-backdrop-filter: blur(<?php echo $card_blur_standalone; ?>px) saturate(<?php echo $card_saturate_standalone; ?>%);
background-color: rgba(255, 255, 255, var(--card-opacity)) !important;
backdrop-filter: blur(var(--card-blur)) saturate(var(--card-saturate));
-webkit-backdrop-filter: blur(var(--card-blur)) saturate(var(--card-saturate));
background-clip: padding-box;
-webkit-transform: translateZ(0);
transform: translateZ(0);
@@ -1316,13 +1327,13 @@ if (apply_filters('argon_page_background_url', get_option('argon_page_background
html.darkmode .post-navigation.card,
html.darkmode .related-posts.card,
html.darkmode .card.bg-white {
background-color: rgba(66, 66, 66, <?php echo $post_bg_opacity_standalone; ?>) !important;
background-color: rgba(66, 66, 66, var(--card-opacity)) !important;
}
#leftbar .card,
#leftbar_part1,
#leftbar_part2 {
backdrop-filter: blur(<?php echo $card_blur_standalone; ?>px) saturate(<?php echo $card_saturate_standalone; ?>%);
-webkit-backdrop-filter: blur(<?php echo $card_blur_standalone; ?>px) saturate(<?php echo $card_saturate_standalone; ?>%);
backdrop-filter: blur(var(--card-blur)) saturate(var(--card-saturate));
-webkit-backdrop-filter: blur(var(--card-blur)) saturate(var(--card-saturate));
}
</style>
<?php endif; ?>
@@ -1344,9 +1355,9 @@ if (apply_filters('argon_page_background_url', get_option('argon_page_background
top: 0;
height: 120px;
height: var(--banner-mask-height);
background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.15) 35%, rgba(0,0,0,0) 100%);
background: linear-gradient(180deg, rgba(0,0,0,var(--banner-mask-opacity-top)) 0%, rgba(0,0,0,var(--banner-mask-opacity-mid)) var(--banner-mask-stop-mid), rgba(0,0,0,0) 100%);
display: block;
@@ -1356,7 +1367,7 @@ if (apply_filters('argon_page_background_url', get_option('argon_page_background
.banner-title {
text-shadow: 0 5px 15px rgba(0, 0, 0, .2);
text-shadow: var(--banner-title-shadow);
}

773
style.css

File diff suppressed because it is too large Load Diff