feat: 全局 UI 优化与邮件模板系统
- 新增动画系统 CSS 变量(时长、缓动函数、状态层透明度) - 新增 prefers-reduced-motion 媒体查询支持 - 优化按钮组件样式,移除渐变背景,添加涟漪效果 - 优化分享按钮错落有致的展开动画 - 优化评论区展开动画效果 - 新增设置面板 Material 3 风格分段控件 - 新增玻璃拟态(Glassmorphism)主题变体 - 新增新拟态(Neumorphism)主题变体 - 新增邮件模板系统(base.php、comment-notify.php、reply-notify.php) - 新增邮件模板后台设置(主题色、Logo、社交链接、预览功能) - 集成邮件模板到评论回复通知 - 版本更新至 1.5.0
This commit is contained in:
163
footer.php
163
footer.php
@@ -22,135 +22,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Argon 修复补丁 - 在所有脚本加载后重新注册插件 -->
|
||||
<script>
|
||||
(function() {
|
||||
if (typeof jQuery !== 'undefined') {
|
||||
var $ = jQuery;
|
||||
|
||||
// 强制重新注册 headIndex 插件
|
||||
$.fn.headIndex = function(options) {
|
||||
var defaults = {
|
||||
articleWrapSelector: '#post_content',
|
||||
indexBoxSelector: '#leftbar_catalog',
|
||||
subItemBoxClass: 'index-subItem-box',
|
||||
scrollOffset: 80,
|
||||
activeClass: 'active'
|
||||
};
|
||||
|
||||
var settings = $.extend({}, defaults, options);
|
||||
var $articleWrap = $(settings.articleWrapSelector);
|
||||
var $indexBox = $(settings.indexBoxSelector);
|
||||
|
||||
if (!$articleWrap.length || !$indexBox.length) {
|
||||
return this;
|
||||
}
|
||||
|
||||
var $headings = $articleWrap.find('h1, h2, h3, h4, h5, h6');
|
||||
|
||||
if ($headings.length === 0) {
|
||||
$indexBox.html('<div class="no-catalog">暂无目录</div>');
|
||||
return this;
|
||||
}
|
||||
|
||||
// 生成目录 HTML(不带序号)
|
||||
var catalogHtml = '<ul class="catalog-list">';
|
||||
var minLevel = 6;
|
||||
|
||||
$headings.each(function() {
|
||||
var level = parseInt(this.tagName.substring(1));
|
||||
if (level < minLevel) minLevel = level;
|
||||
});
|
||||
|
||||
$headings.each(function(index) {
|
||||
var $heading = $(this);
|
||||
var level = parseInt(this.tagName.substring(1));
|
||||
var text = $heading.text().trim();
|
||||
var id = $heading.attr('id') || 'heading-' + index;
|
||||
|
||||
if (!$heading.attr('id')) {
|
||||
$heading.attr('id', id);
|
||||
}
|
||||
|
||||
var indent = (level - minLevel) * 15;
|
||||
catalogHtml += '<li style="padding-left: ' + indent + 'px;">' +
|
||||
'<a href="#' + id + '" class="catalog-link" data-target="' + id + '">' +
|
||||
text + '</a></li>';
|
||||
});
|
||||
|
||||
catalogHtml += '</ul>';
|
||||
$indexBox.html(catalogHtml);
|
||||
|
||||
// 点击事件
|
||||
$indexBox.off('click.headIndex').on('click.headIndex', '.catalog-link', function(e) {
|
||||
e.preventDefault();
|
||||
var targetId = $(this).data('target');
|
||||
var $target = $('#' + targetId);
|
||||
|
||||
if ($target.length) {
|
||||
$('html, body').animate({
|
||||
scrollTop: $target.offset().top - settings.scrollOffset
|
||||
}, 500);
|
||||
|
||||
$indexBox.find('.catalog-link').removeClass(settings.activeClass);
|
||||
$(this).addClass(settings.activeClass);
|
||||
}
|
||||
});
|
||||
|
||||
// 滚动高亮
|
||||
var throttleTimer = null;
|
||||
$(window).off('scroll.headIndex').on('scroll.headIndex', function() {
|
||||
if (throttleTimer) clearTimeout(throttleTimer);
|
||||
|
||||
throttleTimer = setTimeout(function() {
|
||||
var scrollTop = $(window).scrollTop();
|
||||
var currentHeading = null;
|
||||
|
||||
$headings.each(function() {
|
||||
var headingTop = $(this).offset().top - settings.scrollOffset - 50;
|
||||
if (scrollTop >= headingTop) {
|
||||
currentHeading = $(this).attr('id');
|
||||
}
|
||||
});
|
||||
|
||||
if (currentHeading) {
|
||||
$indexBox.find('.catalog-link').removeClass(settings.activeClass);
|
||||
$indexBox.find('.catalog-link[data-target="' + currentHeading + '"]')
|
||||
.addClass(settings.activeClass);
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
window.argonPluginsReady = true;
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- argontheme.js 需要在 jQuery 和插件加载后执行 -->
|
||||
<script>
|
||||
(function() {
|
||||
function loadArgonTheme() {
|
||||
// 检查 jQuery 和关键插件是否都已加载
|
||||
if (typeof jQuery !== 'undefined' &&
|
||||
typeof jQuery.fn.lazyload === 'function' &&
|
||||
window.argonPluginsReady === true) {
|
||||
var script = document.createElement('script');
|
||||
script.src = '<?php echo $GLOBALS['assets_path']; ?>/argontheme.js?v<?php echo $GLOBALS['theme_version']; ?>';
|
||||
document.body.appendChild(script);
|
||||
} else {
|
||||
setTimeout(loadArgonTheme, 50);
|
||||
}
|
||||
}
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', loadArgonTheme);
|
||||
} else {
|
||||
loadArgonTheme();
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<!-- 加载主题核心 JS -->
|
||||
<script src="<?php echo $GLOBALS['assets_path']; ?>/argontheme.js?v=<?php echo $GLOBALS['theme_version']; ?>"></script>
|
||||
|
||||
<?php if (get_option('argon_math_render') == 'mathjax3') { /*Mathjax V3*/?>
|
||||
|
||||
@@ -162,7 +35,7 @@
|
||||
|
||||
inlineMath: [["$", "$"], ["\\\\(", "\\\\)"]],
|
||||
|
||||
displayMath: [['$$','$$']],
|
||||
displayMath: [['$','$']],
|
||||
|
||||
processEscapes: true,
|
||||
|
||||
@@ -190,15 +63,7 @@
|
||||
|
||||
</script>
|
||||
|
||||
<script src="<?php echo get_option('argon_mathjax_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js' : get_option('argon_mathjax_cdn_url'); ?>" id="MathJax-script" async onerror="
|
||||
var fallbackScript = document.createElement('script');
|
||||
fallbackScript.src = '<?php echo $GLOBALS['assets_path']; ?>/assets/vendor/external/mathjax3/tex-chtml-full.js';
|
||||
fallbackScript.async = true;
|
||||
document.head.appendChild(fallbackScript);
|
||||
if (typeof ArgonLogger !== 'undefined') {
|
||||
ArgonLogger.warn('MathJax 3 CDN失败,使用本地备用');
|
||||
}
|
||||
"></script>
|
||||
<script src="<?php echo get_option('argon_mathjax_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js' : get_option('argon_mathjax_cdn_url'); ?>" id="MathJax-script" async></script>
|
||||
|
||||
<?php }?>
|
||||
|
||||
@@ -214,7 +79,7 @@
|
||||
|
||||
inlineMath: [["$", "$"], ["\\\\(", "\\\\)"]],
|
||||
|
||||
displayMath: [['$$','$$']],
|
||||
displayMath: [['$','$']],
|
||||
|
||||
processEscapes: true,
|
||||
|
||||
@@ -240,24 +105,17 @@
|
||||
|
||||
</script>
|
||||
|
||||
<script src="<?php echo get_option('argon_mathjax_v2_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-AMS_HTML' : get_option('argon_mathjax_v2_cdn_url'); ?>" onerror="
|
||||
var fallbackScript = document.createElement('script');
|
||||
fallbackScript.src = '<?php echo $GLOBALS['assets_path']; ?>/assets/vendor/external/mathjax2/MathJax.js';
|
||||
document.head.appendChild(fallbackScript);
|
||||
if (typeof ArgonLogger !== 'undefined') {
|
||||
ArgonLogger.warn('MathJax 2 CDN失败,使用本地备用');
|
||||
}
|
||||
"></script>
|
||||
<script src="<?php echo get_option('argon_mathjax_v2_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-AMS_HTML' : get_option('argon_mathjax_v2_cdn_url'); ?>"></script>
|
||||
|
||||
<?php }?>
|
||||
|
||||
<?php if (get_option('argon_math_render') == 'katex') { /*Katex*/?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo get_option('argon_katex_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/katex@0.11.1/dist/' : get_option('argon_katex_cdn_url'); ?>katex.min.css" onerror="this.href='<?php echo $GLOBALS['assets_path']; ?>/assets/vendor/external/katex/katex.min.css'">
|
||||
<link rel="stylesheet" href="<?php echo get_option('argon_katex_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/katex@0.11.1/dist/' : get_option('argon_katex_cdn_url'); ?>katex.min.css">
|
||||
|
||||
<script src="<?php echo get_option('argon_katex_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/katex@0.11.1/dist/' : get_option('argon_katex_cdn_url'); ?>katex.min.js" onerror="this.src='<?php echo $GLOBALS['assets_path']; ?>/assets/vendor/external/katex/katex.min.js'"></script>
|
||||
<script src="<?php echo get_option('argon_katex_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/katex@0.11.1/dist/' : get_option('argon_katex_cdn_url'); ?>katex.min.js"></script>
|
||||
|
||||
<script src="<?php echo get_option('argon_katex_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/katex@0.11.1/dist/' : get_option('argon_katex_cdn_url'); ?>contrib/auto-render.min.js" onerror="this.src='<?php echo $GLOBALS['assets_path']; ?>/assets/vendor/external/katex/auto-render.min.js'"></script>
|
||||
<script src="<?php echo get_option('argon_katex_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/katex@0.11.1/dist/' : get_option('argon_katex_cdn_url'); ?>contrib/auto-render.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -267,7 +125,7 @@
|
||||
|
||||
delimiters: [
|
||||
|
||||
{left: "$$", right: "$$", display: true},
|
||||
{left: "$", right: "$", display: true},
|
||||
|
||||
{left: "$", right: "$", display: false},
|
||||
|
||||
@@ -308,4 +166,3 @@
|
||||
|
||||
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user