// // TimerIconAnimation.swift // DynamicIsland // // Created by Ebullioscopic on 2025-01-13. // import SwiftUI import Defaults struct TimerIconAnimation: View { @Default(.accentColor) private var accentColor var body: some View { ZStack { Circle() .fill(accentColor.gradient) .frame(width: 24, height: 24) Image(systemName: "timer") .font(.system(size: 12, weight: .medium)) .foregroundStyle(.white) } } } struct TimerIconView: NSViewRepresentable { func makeNSView(context: Context) -> NSView { let hostingView = NSHostingView(rootView: TimerIconAnimation()) hostingView.translatesAutoresizingMaskIntoConstraints = false return hostingView } func updateNSView(_ nsView: NSView, context: Context) { if let hostingView = nsView as? NSHostingView { hostingView.rootView = TimerIconAnimation() } } } #Preview { TimerIconAnimation() .frame(width: 50, height: 50) .background(.black) .onAppear { // Start a demo timer for preview TimerManager.shared.startDemoTimer(duration: 300) } }