diff --git a/Sources/FloatingMonitor/Views/GaugeView.swift b/Sources/FloatingMonitor/Views/GaugeView.swift index 30516c5..26fd686 100644 --- a/Sources/FloatingMonitor/Views/GaugeView.swift +++ b/Sources/FloatingMonitor/Views/GaugeView.swift @@ -66,6 +66,7 @@ struct StyledGauge: View { ) ) .frame(width: max(geo.size.width * CGFloat(value / 100), 4), height: 8) + .animation(.easeOut(duration: 0.2), value: value) } } .frame(height: 8) @@ -91,6 +92,7 @@ struct StyledGauge: View { Circle() .stroke(Color.white.opacity(0.12), lineWidth: 5) .frame(width: 48, height: 48) + .animation(.easeOut(duration: 0.2), value: value) Circle() .trim(from: 0, to: CGFloat(value / 100)) .stroke( @@ -127,6 +129,7 @@ struct StyledGauge: View { Text(String(format: "%.1f%@", value, unit)) .font(.system(size: fontSize + 6, weight: .bold, design: .monospaced)) .foregroundColor(gaugeColor) + .animation(.easeOut(duration: 0.2), value: value) Spacer() Text(detail) .font(.system(size: fontSize - 2)) @@ -148,6 +151,7 @@ struct StyledGauge: View { .fill(gaugeColor.opacity(0.85)) .frame(width: 42, height: 42) .clipShape(Circle()) + .animation(.easeOut(duration: 0.2), value: value) Text(String(format: "%.0f", value)) .font(.system(size: fontSize - 2, weight: .bold, design: .monospaced)) @@ -178,6 +182,7 @@ struct StyledGauge: View { RoundedRectangle(cornerRadius: 4) .fill(gaugeColor) .frame(width: max(geo.size.width * CGFloat(value / 100), 3), height: 14) + .animation(.easeOut(duration: 0.2), value: value) } } .frame(height: 14)