From c9e2c7dfe2fcb0d7a8b5bb65712d415f341ac713 Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Thu, 22 Jan 2026 14:23:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B0=86=E5=8A=A8=E7=94=BB=E6=95=88?= =?UTF-8?q?=E6=9E=9C=E4=BB=8E=E5=8A=9F=E8=83=BD=E5=A2=9E=E5=BC=BA=E7=A7=BB?= =?UTF-8?q?=E5=88=B0=E5=A4=96=E8=A7=82=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在外观样式中新增动画效果子分类 - 包含平滑滚动、进入文章动画、Pjax动画三个设置项 - 删除杂项中重复的动画效果设置 - 动画效果现在归属于外观样式,更符合逻辑 --- optimize_settings.py | 274 +++++++++++++++++++++++++++++++++++++++++++ settings.php | 148 +++++++++++------------ 2 files changed, 349 insertions(+), 73 deletions(-) create mode 100644 optimize_settings.py diff --git a/optimize_settings.py b/optimize_settings.py new file mode 100644 index 0000000..4768df3 --- /dev/null +++ b/optimize_settings.py @@ -0,0 +1,274 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Settings.php 结构优化脚本 - 步骤2 +完成以下任务: +1. 在外观样式中添加动画效果子分类 +2. 删除杂项中重复的动画效果设置 +""" + +def main(): + # 读取文件 + with open('settings.php', 'r', encoding='utf-8') as f: + content = f.read() + + print("开始优化 settings.php (步骤2: 动画效果重组)...") + print(f"原始文件: {len(content)} 字符, {content.count(chr(10))} 行") + + # 1. 在外观样式的字体设置后添加动画效果子分类 + old_font_section = ''' + +

+ + + + + + + +
+ + + + + + + +
+ +

+ + + + + + ''' + + new_font_with_animation = ''' + +

+ + + + + + + +
+ + + + + + + +
+ +

+ + + + + +

+ + + + + + + + + +

+ + + + + + + + + + + + + +

+ + + + + + + + + + + + + +

+ + + + + + ''' + + if old_font_section in content: + content = content.replace(old_font_section, new_font_with_animation) + print("✓ 在外观样式中添加了动画效果子分类") + else: + print("✗ 未找到字体设置部分") + + # 2. 删除杂项中重复的动画效果设置 + old_misc_with_animation = '''

+ + + + + + + + + +

+ + + + + + + + + + + + + +

+ + + + + + + + + + + + + +

+ + + + + + ''' + + new_misc_without_animation = '''

+ + ''' + + if old_misc_with_animation in content: + content = content.replace(old_misc_with_animation, new_misc_without_animation) + print("✓ 删除了杂项中重复的动画效果设置") + else: + print("✗ 未找到杂项中的动画效果设置") + + # 保存文件 + with open('settings.php', 'w', encoding='utf-8') as f: + f.write(content) + + print(f"\n优化完成! 新文件: {len(content)} 字符, {content.count(chr(10))} 行") + print("请检查 settings.php 文件") + +if __name__ == '__main__': + main() diff --git a/settings.php b/settings.php index 90fd936..6bbb72e 100644 --- a/settings.php +++ b/settings.php @@ -380,6 +380,80 @@ function themeoptions_page(){ +

+ + + + + + + + + +

+ + + + + + + + + + + + + +

+ + + + + + + + + + + + + +

+ + + + +

@@ -3078,79 +3152,7 @@ window.pjaxLoaded = function(){

- - - - - - - - -

- - - - - - - - - - - - - -

- - - - - - - - - - - - - -

- - - - - - +