-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
214 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
Shapy.xcodeproj/project.xcworkspace/xcuserdata/damienrifflart.xcuserdatad/UserInterfaceState.xcuserstate |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import SwiftUI | ||
|
||
class DataManager: ObservableObject { | ||
@Published var currentSerie: Int = 1 | ||
@Published var exerciceOne: String = "15 Pompes" | ||
@Published var exerciceTwo: String = "30 Abdos" | ||
@Published var exerciceThree: String = "" | ||
@Published var exerciceFour: String = "" | ||
@Published var exerciceIndex: Int = 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
import SwiftUI | ||
|
||
struct SettingsView: View { | ||
@ObservedObject var variables: DataManager | ||
@State private var isLandingViewActive = false | ||
@State private var exerciceOneInput = "" | ||
@State private var exerciceTwoInput = "" | ||
@State private var exerciceThreeInput = "" | ||
@State private var exerciceFourInput = "" | ||
|
||
func saveButton(){ | ||
isLandingViewActive.toggle() | ||
variables.exerciceOne = exerciceOneInput | ||
variables.exerciceTwo = exerciceTwoInput | ||
variables.exerciceThree = exerciceThreeInput | ||
variables.exerciceFour = exerciceFourInput | ||
} | ||
|
||
var body: some View { | ||
|
||
ZStack{ | ||
// Background Color | ||
Color(hex: 0x0E0215) | ||
.ignoresSafeArea() | ||
|
||
VStack{ | ||
HStack{ | ||
// Back Button | ||
Button(action: { isLandingViewActive.toggle() }) { | ||
Text("Retour") | ||
.font(.system(size: 30, weight: .bold)) | ||
.foregroundColor(Color(hex: 0x0E0215)) | ||
.padding() | ||
.frame(width: 130, height:60) | ||
.background(Color(hex: 0xE6D2F7)) | ||
.cornerRadius(10) | ||
} | ||
.padding(.leading, 20) | ||
|
||
Spacer() | ||
|
||
// Save Button | ||
Button(action: { saveButton() }) { | ||
Text("Enregistrer") | ||
.font(.system(size: 30, weight: .bold)) | ||
.foregroundColor(Color(hex: 0x0E0215)) | ||
.padding() | ||
.frame(width: 188, height:60) | ||
.background(Color(hex: 0xE6D2F7)) | ||
.cornerRadius(10) | ||
} | ||
.padding(.trailing, 20) | ||
|
||
} | ||
.fullScreenCover(isPresented: $isLandingViewActive) { | ||
LandingView(variables: variables) | ||
} | ||
|
||
Spacer() | ||
|
||
// Exercice 1 | ||
Text("Exercice 1") | ||
.foregroundColor(Color.white) | ||
.font(.system(size:35, weight:.bold)) | ||
.padding(.leading, 40.0) | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
|
||
TextField(" 15 Pompes", text: $exerciceOneInput) | ||
.background(Color.gray.opacity(0.2)) | ||
.foregroundColor(Color(hex: 0xE6D2F7)) | ||
.frame(width: 300) | ||
.cornerRadius(6) | ||
.font(.system(size:40)) | ||
.padding(.top, -20) | ||
.padding(.bottom, 20) | ||
|
||
|
||
// Exercice 2 | ||
Text("Exercice 2") | ||
.foregroundColor(Color.white) | ||
.font(.system(size:35, weight:.bold)) | ||
.padding(.leading, 40.0) | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
|
||
TextField(" 15 Pompes", text: $exerciceTwoInput) | ||
.background(Color.gray.opacity(0.2)) | ||
.foregroundColor(Color(hex: 0xE6D2F7)) | ||
.frame(width: 300) | ||
.cornerRadius(6) | ||
.font(.system(size:40)) | ||
.padding(.top, -20) | ||
.padding(.bottom, 20) | ||
|
||
|
||
// Exercice 3 | ||
Text("Exercice 3") | ||
.foregroundColor(Color.white) | ||
.font(.system(size:35, weight:.bold)) | ||
.padding(.leading, 40.0) | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
|
||
TextField(" 15 Pompes", text: $exerciceThreeInput) | ||
.background(Color.gray.opacity(0.2)) | ||
.foregroundColor(Color(hex: 0xE6D2F7)) | ||
.frame(width: 300) | ||
.cornerRadius(6) | ||
.font(.system(size:40)) | ||
.padding(.top, -20) | ||
.padding(.bottom, 20) | ||
|
||
|
||
// Exercice 4 | ||
Text("Exercice 4") | ||
.foregroundColor(Color.white) | ||
.font(.system(size:35, weight:.bold)) | ||
.padding(.leading, 40.0) | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
|
||
TextField(" 15 Pompes", text: $exerciceFourInput) | ||
.background(Color.gray.opacity(0.2)) | ||
.foregroundColor(Color(hex: 0xE6D2F7)) | ||
.frame(width: 300) | ||
.cornerRadius(6) | ||
.font(.system(size:40)) | ||
.padding(.top, -20) | ||
|
||
|
||
|
||
} | ||
.padding(.bottom, 50.0) | ||
|
||
|
||
} | ||
} | ||
} | ||
|
||
|
||
struct SettingsView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
SettingsView(variables: DataManager()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters