fitness_app/FitnessApp/ProgressCircleView.swift
Matt Bruce 9b0287f038 initial start screen
Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
2024-12-20 13:19:36 -06:00

32 lines
756 B
Swift

//
// ProgressCircle.swift
// FitnessApp
//
// Created by Matt Bruce on 12/20/24.
//
import SwiftUI
struct ProgressCircleView: View {
@Binding var progress: Int
var goal: Int
var color: Color
private let width: CGFloat = 20
var body: some View {
ZStack {
Circle()
.stroke(color.opacity(0.3), lineWidth: width)
Circle()
.trim(from: 0, to: CGFloat(progress) / CGFloat(goal))
.stroke(color, style: StrokeStyle(lineWidth: 20, lineCap: .round))
.rotationEffect(Angle(degrees: -90))
.shadow(radius: 5)
}
}
}
#Preview {
ProgressCircleView(progress: .constant(100), goal: 200, color: .gray)
}