feat: 将动画效果从功能增强移到外观样式

- 在外观样式中新增动画效果子分类
- 包含平滑滚动、进入文章动画、Pjax动画三个设置项
- 删除杂项中重复的动画效果设置
- 动画效果现在归属于外观样式,更符合逻辑
This commit is contained in:
2026-01-22 14:23:43 +08:00
parent e667a22b1a
commit c9e2c7dfe2
2 changed files with 349 additions and 73 deletions

View File

@@ -380,6 +380,80 @@ function themeoptions_page(){
</tr>
<tr><th class="subtitle"><h3 id="subsection-animation"><?php _e('动画效果', 'argon');?></h3></th></tr>
<tr>
<th><label><?php _e('是否启用平滑滚动', 'argon');?></label></th>
<td>
<select name="argon_enable_smoothscroll_type">
<?php $enable_smoothscroll_type = get_option('argon_enable_smoothscroll_type'); ?>
<option value="1" <?php if ($enable_smoothscroll_type=='1'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 1 (平滑) (推荐)', 'argon');?></option>
<option value="1_pulse" <?php if ($enable_smoothscroll_type=='1_pulse'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 1 (脉冲式滚动) (仿 Edge) (推荐)', 'argon');?></option>
<option value="2" <?php if ($enable_smoothscroll_type=='2'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 2 (较稳)', 'argon');?></option>
<option value="3" <?php if ($enable_smoothscroll_type=='3'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 3', 'argon');?></option>
<option value="disabled" <?php if ($enable_smoothscroll_type=='disabled'){echo 'selected';} ?>><?php _e('不使用平滑滚动', 'argon');?></option>
</select>
<p class="description"><?php _e('能增强浏览体验,但可能出现一些小问题,如果有问题请切换方案或关闭平滑滚动', 'argon');?></p>
</td>
</tr>
<tr>
<th><label><?php _e('是否启用进入文章动画', 'argon');?></label></th>
<td>
<select name="argon_enable_into_article_animation">
<?php $argon_enable_into_article_animation = get_option('argon_enable_into_article_animation'); ?>
<option value="false" <?php if ($argon_enable_into_article_animation=='false'){echo 'selected';} ?>><?php _e('不启用', 'argon');?></option>
<option value="true" <?php if ($argon_enable_into_article_animation=='true'){echo 'selected';} ?>><?php _e('启用', 'argon');?></option>
</select>
<p class="description"><?php _e('从首页或分类目录进入文章时,使用平滑过渡(可能影响加载文章时的性能)', 'argon');?></p>
</td>
</tr>
<tr>
<th><label><?php _e('禁用 Pjax 加载后的页面滚动动画', 'argon');?></label></th>
<td>
<select name="argon_disable_pjax_animation">
<?php $argon_disable_pjax_animation = get_option('argon_disable_pjax_animation'); ?>
<option value="false" <?php if ($argon_disable_pjax_animation=='false'){echo 'selected';} ?>><?php _e('不禁用', 'argon');?></option>
<option value="true" <?php if ($argon_disable_pjax_animation=='true'){echo 'selected';} ?>><?php _e('禁用', 'argon');?></option>
</select>
<p class="description"><?php _e('Pjax 替换页面内容后会平滑滚动到页面顶部,如果你不喜欢,可以禁用这个选项', 'argon');?></p>
</td>
</tr>
<!-- ========== 3. 页面布局 ========== -->
<tr><th class="subtitle"><h2 id="section-layout"><?php _e('页面布局', 'argon');?></h2></th></tr>
@@ -3078,79 +3152,7 @@ window.pjaxLoaded = function(){
<tr><th class="subtitle"><h3 id="subsection-misc"><?php _e('杂项', 'argon');?></h3></th></tr>
<tr>
<th><label><?php _e('是否启用平滑滚动', 'argon');?></label></th>
<td>
<select name="argon_enable_smoothscroll_type">
<?php $enable_smoothscroll_type = get_option('argon_enable_smoothscroll_type'); ?>
<option value="1" <?php if ($enable_smoothscroll_type=='1'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 1 (平滑) (推荐)', 'argon');?></option>
<option value="1_pulse" <?php if ($enable_smoothscroll_type=='1_pulse'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 1 (脉冲式滚动) (仿 Edge) (推荐)', 'argon');?></option>
<option value="2" <?php if ($enable_smoothscroll_type=='2'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 2 (较稳)', 'argon');?></option>
<option value="3" <?php if ($enable_smoothscroll_type=='3'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 3', 'argon');?></option>
<option value="disabled" <?php if ($enable_smoothscroll_type=='disabled'){echo 'selected';} ?>><?php _e('不使用平滑滚动', 'argon');?></option>
</select>
<p class="description"><?php _e('能增强浏览体验,但可能出现一些小问题,如果有问题请切换方案或关闭平滑滚动', 'argon');?></p>
</td>
</tr>
<tr>
<th><label><?php _e('是否启用进入文章动画', 'argon');?></label></th>
<td>
<select name="argon_enable_into_article_animation">
<?php $argon_enable_into_article_animation = get_option('argon_enable_into_article_animation'); ?>
<option value="false" <?php if ($argon_enable_into_article_animation=='false'){echo 'selected';} ?>><?php _e('不启用', 'argon');?></option>
<option value="true" <?php if ($argon_enable_into_article_animation=='true'){echo 'selected';} ?>><?php _e('启用', 'argon');?></option>
</select>
<p class="description"><?php _e('从首页或分类目录进入文章时,使用平滑过渡(可能影响加载文章时的性能)', 'argon');?></p>
</td>
</tr>
<tr>
<th><label><?php _e('禁用 Pjax 加载后的页面滚动动画', 'argon');?></label></th>
<td>
<select name="argon_disable_pjax_animation">
<?php $argon_disable_pjax_animation = get_option('argon_disable_pjax_animation'); ?>
<option value="false" <?php if ($argon_disable_pjax_animation=='false'){echo 'selected';} ?>><?php _e('不禁用', 'argon');?></option>
<option value="true" <?php if ($argon_disable_pjax_animation=='true'){echo 'selected';} ?>><?php _e('禁用', 'argon');?></option>
</select>
<p class="description"><?php _e('Pjax 替换页面内容后会平滑滚动到页面顶部,如果你不喜欢,可以禁用这个选项', 'argon');?></p>
</td>
</tr>
<!-- ========== 14. 评论设置 ========== -->
<!-- ========== 15. 评论设置 ========== -->
<tr><th class="subtitle"><h2 id="section-comment"><?php _e('评论设置', 'argon');?></h2></th></tr>
<tr><th class="subtitle"><h3 id="subsection-comment-pagination"><?php _e('评论分页', 'argon');?></h3></th></tr>