23 lines
674 B
Swift
23 lines
674 B
Swift
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
|
|
|
|
func body(content: Content) -> some View {
|
|
content.background(RoundedRectangle(cornerRadius: radius).fill(Color("PanelCard")))
|
|
}
|
|
}
|