This commit is contained in:
2025-07-25 17:30:11 -04:00
parent 310c120ca3
commit 3fd6887ce7
55 changed files with 1062 additions and 649 deletions

View File

@ -0,0 +1,36 @@
//
// ExerciseDoneCard.swift
// Workouts
//
// Created by rzen on 7/23/25 at 4:29PM.
//
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
//
import SwiftUI
struct ExerciseDoneCard: View {
let elapsedSeconds: Int
let onComplete: () -> Void
var body: some View {
VStack(spacing: 20) {
Button(action: onComplete) {
Text("Done in \(10 - elapsedSeconds)s")
.font(.headline)
.frame(maxWidth: .infinity)
}
.buttonStyle(.borderedProminent)
.tint(.green)
.padding(.horizontal)
}
.padding()
}
private var timeFormatted: String {
let minutes = elapsedSeconds / 60
let seconds = elapsedSeconds % 60
return String(format: "%02d:%02d", minutes, seconds)
}
}

View File

@ -0,0 +1,55 @@
//
// ExerciseIntroView.swift
// Workouts
//
// Created by rzen on 7/23/25 at 4:19PM.
//
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
//
import SwiftUI
struct ExerciseIntroCard: View {
let log: WorkoutLog
var body: some View {
VStack(alignment: .center, spacing: 16) {
Text(log.exerciseName)
.font(.title)
.lineLimit(1)
.minimumScaleFactor(0.5)
.layoutPriority(1)
HStack(alignment: .bottom) {
Text("\(log.weight)")
Text("lbs")
.fontWeight(.light)
.padding([.trailing], 10)
Text("\(log.sets)")
Text("×")
.fontWeight(.light)
Text("\(log.reps)")
}
.font(.title3)
.lineLimit(1)
.minimumScaleFactor(0.5)
.layoutPriority(1)
Text(log.status?.name ?? "Not Started")
.foregroundStyle(Color.accentColor)
}
.padding()
// VStack(spacing: 20) {
// Text(title)
// .font(.title)
//
// Text(elapsedSeconds.secondsFormatted)
// .font(.system(size: 48, weight: .semibold, design: .monospaced))
// .foregroundStyle(Color.accentColor)
// }
// .padding()
}
}

View File

@ -0,0 +1,30 @@
//
// ExerciseRestCard.swift
// Workouts
//
// Created by rzen on 7/23/25 at 4:28PM.
//
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
//
import SwiftUI
struct ExerciseRestCard: View {
let elapsedSeconds: Int
var body: some View {
VStack(spacing: 20) {
Text("Resting for")
.font(.title)
.lineLimit(1)
.minimumScaleFactor(0.5)
.layoutPriority(1)
Text(elapsedSeconds.secondsFormatted)
.font(.system(size: 48, weight: .semibold, design: .monospaced))
.foregroundStyle(Color.green)
}
.padding()
}
}

View File

@ -0,0 +1,28 @@
//
// ExerciseSetCard.swift
// Workouts
//
// Created by rzen on 7/23/25 at 4:26PM.
//
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
//
import SwiftUI
struct ExerciseSetCard: View {
let set: Int
let elapsedSeconds: Int
var body: some View {
VStack(spacing: 20) {
Text("Set \(set)")
.font(.title)
Text(elapsedSeconds.secondsFormatted)
.font(.system(size: 48, weight: .semibold, design: .monospaced))
.foregroundStyle(Color.accentColor)
}
.padding()
}
}