Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

4 changes: 4 additions & 0 deletions FitCount/Assets.xcassets/AccentColor.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"colors" : [
{
"color" : {
"platform" : "universal",
"reference" : "systemIndigoColor"
},
"idiom" : "universal"
}
],
Expand Down
22 changes: 9 additions & 13 deletions FitCount/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ class SessionConfig: ObservableObject {
@Published var nReps : Int = 1
@Published var nMinutes : Int = 0
@Published var nSeconds : Int = 1

@Published var useReps: Bool = true
@Published var exercise: Exercise = exercises[0] // use first exercise by default but change in the ExerciseDetailsView
}

struct ContentView: View {
@StateObject var viewModel = ViewModel()
@StateObject var sessionConfig: SessionConfig = SessionConfig()

@StateObject var sessionConfig = SessionConfig()

var body: some View {
NavigationStack(path: $viewModel.path) {
Expand All @@ -34,9 +32,11 @@ struct ContentView: View {
.font(.headline)
}
.padding()
.cornerRadius(8) // Add corner radius for a rounded look
.cornerRadius(8)
}.navigationDestination(for: Exercise.self) { exercise in
ExerciseDetailsView(exercise: exercise).environmentObject(viewModel).environmentObject(sessionConfig)
ExerciseDetailsView(exercise: exercise)
.environmentObject(viewModel)
.environmentObject(sessionConfig)
}
}
.background(.white)
Expand All @@ -60,13 +60,9 @@ struct ContentView: View {


class ViewModel: ObservableObject {
@Published var path: NavigationPath = NavigationPath()
}

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
@Published var path = NavigationPath()

func popToRoot(){
path.removeLast(path.count) // pop to root
}
}


4 changes: 2 additions & 2 deletions FitCount/FitCountApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ struct Exercise: Identifiable, Hashable {

let exercises = [
Exercise(
name: "Biceps Curls",
name: "Bicep Curls",
details: "Lift weights in both hands by bending your elbow and lifting them towards your shoulder.",
features: [.fitness(.bicepsCurls), .overlay(.upperBody)]
features: [.fitness(.bicepCurls), .overlay(.upperBody)]
),
Exercise(
name: "Squats",
Expand Down
2 changes: 1 addition & 1 deletion FitCount/History/HistoryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct HistoryView: View {
Text(sessionData.exercise)
.font(.title)
.fontWeight(.bold)
.foregroundColor(.indigo)
.foregroundColor(Color("AccentColor"))

Text(sessionData.date.formatted(
.dateTime
Expand Down

This file was deleted.

42 changes: 0 additions & 42 deletions FitCount/Workout/BoundingBoxView.swift

This file was deleted.

6 changes: 2 additions & 4 deletions FitCount/Workout/ExerciseDetailsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import SwiftUI
import PagerTabStripView


struct TitleNavBarItem: View {
let title: String

Expand Down Expand Up @@ -36,7 +35,6 @@ struct ExerciseDetailsView: View {
.font(.body)
.padding()


Spacer()

PagerTabStripView(
Expand Down Expand Up @@ -117,8 +115,8 @@ struct ExerciseDetailsView: View {
Text("Start workout")
.foregroundColor(.white)
.padding()
.background(.indigo) // Set background color to the main color
.cornerRadius(8) // Add corner radius for a rounded look
.background(Color("AccentColor"))
.cornerRadius(8)

}
.navigationDestination(for: String.self) { _ in
Expand Down
6 changes: 0 additions & 6 deletions FitCount/Workout/InstructionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,3 @@ struct InstructionsView: View {

}
}

struct InstructionsView_Previews: PreviewProvider {
static var previews: some View {
InstructionsView()
}
}
Loading