feat(settings): 默认启用短动效并提供独立减弱动画选项

This commit is contained in:
2026-11-04 11:53:17 +08:00
parent 40a7a55edf
commit f18f6652ff
23 changed files with 443 additions and 34 deletions
@@ -4,6 +4,7 @@ import SwiftUI
struct MetricProgressBar: View {
let value: Double
let color: Color
@Environment(\.metricAnimationsEnabled) private var animates
private var fraction: Double { value.isFinite ? min(1, max(0, value)) : 0 }
@@ -15,6 +16,8 @@ struct MetricProgressBar: View {
}
.frame(width: proxy.size.width, height: proxy.size.height)
.clipShape(Capsule())
.animation(animates ? .easeInOut(duration: MetricMotion.duration) : nil, value: fraction)
.transaction { if !animates { $0.disablesAnimations = true } }
}
}
}