feat(menubar): 调整两排卡片布局并加入复合曲线与数值动效
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import SwiftUI
|
||||
|
||||
/// The same system numeric roll/blur transition as the original metric rows.
|
||||
struct AnimatedMetricText: View {
|
||||
let value: String
|
||||
@Environment(\.accessibilityReduceMotion) private var reduceMotion
|
||||
|
||||
var body: some View {
|
||||
Text(verbatim: value)
|
||||
.monospacedDigit()
|
||||
.contentTransition(.numericText())
|
||||
.animation(reduceMotion ? nil : .spring(duration: 0.35, bounce: 0), value: value)
|
||||
}
|
||||
}
|
||||
|
||||
struct PanelCardBackground: ViewModifier {
|
||||
let radius: CGFloat
|
||||
@Environment(\.accessibilityReduceTransparency) private var reduceTransparency
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
content.background {
|
||||
if reduceTransparency {
|
||||
RoundedRectangle(cornerRadius: radius).fill(Color(nsColor: .windowBackgroundColor))
|
||||
} else {
|
||||
RoundedRectangle(cornerRadius: radius).fill(Color("PanelCard"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user