feat: 移除全局动画风格设置,使用融合风格
- 移除 argon_animation_style 和 argon_animation_speed 设置项 - 使用固定的融合动画参数:Material 3 时长 + Apple 流畅缓动 + Material 弹性效果 - 保留卡片悬浮效果和按钮点击效果的自定义选项 - 简化代码,减少用户配置复杂度
This commit is contained in:
47
header.php
47
header.php
@@ -698,53 +698,22 @@ if ($card_opacity == '' || $card_opacity == '1') {
|
||||
</style>
|
||||
|
||||
<?php
|
||||
// 动画效果设置
|
||||
$animation_style = get_option('argon_animation_style', 'material3');
|
||||
$animation_speed = get_option('argon_animation_speed', 'normal');
|
||||
// 动画效果设置 - 使用融合风格(Material 3 + Apple + 简约的最佳组合)
|
||||
$card_hover_effect = get_option('argon_card_hover_effect', 'lift');
|
||||
$button_click_effect = get_option('argon_button_click_effect', 'both');
|
||||
|
||||
// 根据动画速度设置时间变量
|
||||
$speed_multiplier = 1;
|
||||
if ($animation_speed == 'fast') {
|
||||
$speed_multiplier = 0.6;
|
||||
} else if ($animation_speed == 'slow') {
|
||||
$speed_multiplier = 1.5;
|
||||
}
|
||||
|
||||
$animation_fast = round(150 * $speed_multiplier);
|
||||
$animation_normal = round(250 * $speed_multiplier);
|
||||
$animation_slow = round(400 * $speed_multiplier);
|
||||
|
||||
// 根据动画风格设置缓动函数
|
||||
$ease_standard = 'cubic-bezier(0.4, 0, 0.2, 1)';
|
||||
$ease_spring = 'cubic-bezier(0.34, 1.56, 0.64, 1)';
|
||||
|
||||
if ($animation_style == 'apple') {
|
||||
$ease_standard = 'cubic-bezier(0.25, 0.1, 0.25, 1)';
|
||||
$ease_spring = 'cubic-bezier(0.175, 0.885, 0.32, 1.275)';
|
||||
} else if ($animation_style == 'minimal') {
|
||||
$ease_standard = 'ease';
|
||||
$ease_spring = 'ease-out';
|
||||
}
|
||||
?>
|
||||
|
||||
<style id="theme_animation_css">
|
||||
:root {
|
||||
--animation-fast: <?php echo $animation_fast; ?>ms;
|
||||
--animation-normal: <?php echo $animation_normal; ?>ms;
|
||||
--animation-slow: <?php echo $animation_slow; ?>ms;
|
||||
--ease-standard: <?php echo $ease_standard; ?>;
|
||||
--ease-spring: <?php echo $ease_spring; ?>;
|
||||
/* 动画时长 - Material 3 规范 */
|
||||
--animation-fast: 150ms;
|
||||
--animation-normal: 250ms;
|
||||
--animation-slow: 400ms;
|
||||
/* 缓动函数 - 融合风格:Material 3 标准 + Apple 流畅 + 简约自然 */
|
||||
--ease-standard: cubic-bezier(0.25, 0.1, 0.25, 1); /* Apple 风格,更流畅 */
|
||||
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* Material 弹性,有活力 */
|
||||
}
|
||||
|
||||
<?php if ($animation_style == 'disabled'): ?>
|
||||
*, *::before, *::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($card_hover_effect == 'none'): ?>
|
||||
.post-item:hover, article.card:hover {
|
||||
transform: none !important;
|
||||
|
||||
29
settings.php
29
settings.php
@@ -2869,33 +2869,6 @@ window.pjaxLoaded = function(){
|
||||
|
||||
<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_animation_style">
|
||||
<?php $argon_animation_style = get_option('argon_animation_style', 'material3'); ?>
|
||||
<option value="material3" <?php if ($argon_animation_style=='material3'){echo 'selected';} ?>><?php _e('Material 3 (推荐)', 'argon');?></option>
|
||||
<option value="apple" <?php if ($argon_animation_style=='apple'){echo 'selected';} ?>><?php _e('Apple 风格', 'argon');?></option>
|
||||
<option value="minimal" <?php if ($argon_animation_style=='minimal'){echo 'selected';} ?>><?php _e('简约', 'argon');?></option>
|
||||
<option value="disabled" <?php if ($argon_animation_style=='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_animation_speed">
|
||||
<?php $argon_animation_speed = get_option('argon_animation_speed', 'normal'); ?>
|
||||
<option value="fast" <?php if ($argon_animation_speed=='fast'){echo 'selected';} ?>><?php _e('快速', 'argon');?></option>
|
||||
<option value="normal" <?php if ($argon_animation_speed=='normal'){echo 'selected';} ?>><?php _e('正常 (推荐)', 'argon');?></option>
|
||||
<option value="slow" <?php if ($argon_animation_speed=='slow'){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>
|
||||
@@ -5757,8 +5730,6 @@ function argon_update_themeoptions(){
|
||||
argon_update_option('argon_disable_pjax_animation');
|
||||
|
||||
// 动画效果相关配置
|
||||
argon_update_option('argon_animation_style');
|
||||
argon_update_option('argon_animation_speed');
|
||||
argon_update_option('argon_card_hover_effect');
|
||||
argon_update_option('argon_button_click_effect');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user