From 96e069add3ada6781cff9b5f5ffe7ada02d005c9 Mon Sep 17 00:00:00 2001 From: "emre.kartal" Date: Sun, 24 Sep 2023 22:31:23 +0200 Subject: [PATCH 1/5] Add Login Page :white_check_mark: --- Sources/allin/allin.xcodeproj/project.pbxproj | 4 + .../PurpleText.colorset/Contents.json | 38 +++++++++ .../StrokeGrayColor.colorset/Contents.json | 38 +++++++++ Sources/allin/allin/Ressources/Colors.swift | 2 + Sources/allin/allin/Screens/LoginScreen.swift | 78 +++++++++++++++++++ 5 files changed, 160 insertions(+) create mode 100644 Sources/allin/allin/Assets.xcassets/PurpleText.colorset/Contents.json create mode 100644 Sources/allin/allin/Assets.xcassets/StrokeGrayColor.colorset/Contents.json create mode 100644 Sources/allin/allin/Screens/LoginScreen.swift diff --git a/Sources/allin/allin.xcodeproj/project.pbxproj b/Sources/allin/allin.xcodeproj/project.pbxproj index 338403a..0850035 100644 --- a/Sources/allin/allin.xcodeproj/project.pbxproj +++ b/Sources/allin/allin.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ EC87FCD92ABBA60900363986 /* Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC87FCD82ABBA60900363986 /* Colors.swift */; }; EC87FCDB2ABBA6AC00363986 /* TrendingBetCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC87FCDA2ABBA6AC00363986 /* TrendingBetCard.swift */; }; EC9A45B02ABDF4A800125D41 /* HomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */; }; + ECFC54442AC0C39E00195760 /* LoginScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFC54432AC0C39E00195760 /* LoginScreen.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -65,6 +66,7 @@ EC87FCD82ABBA60900363986 /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Colors.swift; path = allin/Ressources/Colors.swift; sourceTree = SOURCE_ROOT; }; EC87FCDA2ABBA6AC00363986 /* TrendingBetCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TrendingBetCard.swift; path = allin/Views/TrendingBetCard.swift; sourceTree = SOURCE_ROOT; }; EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HomeScreen.swift; path = allin/Screens/HomeScreen.swift; sourceTree = SOURCE_ROOT; }; + ECFC54432AC0C39E00195760 /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LoginScreen.swift; path = allin/Screens/LoginScreen.swift; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -187,6 +189,7 @@ EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */, EC50BF952ABF4D3300197685 /* SplashScreen.swift */, EC50BF972ABF541B00197685 /* WelcomeScreen.swift */, + ECFC54432AC0C39E00195760 /* LoginScreen.swift */, ); path = Screens; sourceTree = ""; @@ -329,6 +332,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + ECFC54442AC0C39E00195760 /* LoginScreen.swift in Sources */, EC87FCD62ABBA24000363986 /* Extensions.swift in Sources */, EC46D7DD2ABCCC270030AC04 /* MenuView.swift in Sources */, EC87FCD92ABBA60900363986 /* Colors.swift in Sources */, diff --git a/Sources/allin/allin/Assets.xcassets/PurpleText.colorset/Contents.json b/Sources/allin/allin/Assets.xcassets/PurpleText.colorset/Contents.json new file mode 100644 index 0000000..8790273 --- /dev/null +++ b/Sources/allin/allin/Assets.xcassets/PurpleText.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xF6", + "green" : "0x45", + "red" : "0x6E" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xF6", + "green" : "0x45", + "red" : "0x6E" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/allin/allin/Assets.xcassets/StrokeGrayColor.colorset/Contents.json b/Sources/allin/allin/Assets.xcassets/StrokeGrayColor.colorset/Contents.json new file mode 100644 index 0000000..de593c3 --- /dev/null +++ b/Sources/allin/allin/Assets.xcassets/StrokeGrayColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x8A", + "green" : "0x8A", + "red" : "0x8A" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x8A", + "green" : "0x8A", + "red" : "0x8A" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/allin/allin/Ressources/Colors.swift b/Sources/allin/allin/Ressources/Colors.swift index 6a62d2d..0bcac1b 100644 --- a/Sources/allin/allin/Ressources/Colors.swift +++ b/Sources/allin/allin/Ressources/Colors.swift @@ -14,6 +14,7 @@ struct AllinColor { static let pinkAccentText = Color("PinkAccentText") static let darkLight = Color("DarkLight") static let backgroundWhite = Color("BackgroundWhite") + static let PurpleText = Color("PurpleText") static let StartBackground = Color("StartBackground") static let blueAccent = Color("BlueAccent") static let TopBarColorPink = Color("TopBarColorPink") @@ -21,6 +22,7 @@ struct AllinColor { static let LightPurple = Color("LightPurple") static let TopBarColorBlue = Color("TopBarColorBlue") static let TopBarColorPurple = Color("TopBarColorPurple") + static let StrokeGrayColor = Color("StrokeGrayColor") static let DescriptionColorMenu = Color("DescriptionColorMenu") static let BorderColorMenu = Color("BorderColorMenu") static let gradiantCard = LinearGradient( diff --git a/Sources/allin/allin/Screens/LoginScreen.swift b/Sources/allin/allin/Screens/LoginScreen.swift new file mode 100644 index 0000000..2cfcd30 --- /dev/null +++ b/Sources/allin/allin/Screens/LoginScreen.swift @@ -0,0 +1,78 @@ +// +// LoginScreen.swift +// AllIn +// +// Created by étudiant on 24/09/2023. +// + +import SwiftUI + +struct Login: View { + + @State private var username: String = "" + @State private var password: String = "" + var body: some View { + GeometryReader { geometry in + VStack(spacing: 15) { + Spacer() + Text("Te revoilà!") + .betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40) + Text("Bon retour parmis nous tu nous as manqué!") + .frame(width: 220) + .multilineTextAlignment(.center) + .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 20) + .padding(.bottom, 60) + + TextField("", text: $username, prompt: Text("Email").foregroundColor(.gray)) + .padding() + .background(Color.white.cornerRadius(9)) + .frame(width: 300) + .foregroundColor(.black) + .overlay( + RoundedRectangle(cornerRadius: 9, style: .continuous) + .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + ) + .padding(.bottom, 8) + + TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) + .padding() + .background(Color.white.cornerRadius(9)) + .frame(width: 300) + .overlay( + RoundedRectangle(cornerRadius: 9, style: .continuous) + .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + ) + .foregroundColor(.black) + + Text("Mot de passe oublié?") + .frame(alignment: .trailing) + .padding(.bottom, 20) + .padding(.leading, 150) + .betTextStyle(weight: .medium, color: AllinColor.StartTextColor, size: 14) + + Button(action: {}) { + Text("Se connecter") + .betTextStyle(weight: .bold, color: .white, size: 17) + } + .frame(width: 300, height: 60) + .background(LinearGradient(gradient: + Gradient(colors:[AllinColor.TopBarColorPink,AllinColor.TopBarColorPurple,AllinColor.TopBarColorBlue]), + startPoint: .leading, endPoint: .trailing)) + .cornerRadius(13) + + Spacer() + HStack(spacing: 0) { + Text("Pas encore inscrit? ") + .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16) + Text("S'inscrire") + .betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) + } + + } + .frame(width: geometry.size.width, height: geometry.size.height) + .background(AllinColor.StartBackground) + } + } + +} + From a16e003236e2070081040b1410e892099cd7bbd8 Mon Sep 17 00:00:00 2001 From: "emre.kartal" Date: Mon, 25 Sep 2023 16:12:38 +0200 Subject: [PATCH 2/5] Add RegisterPage :white_check_mark: --- Sources/allin/allin.xcodeproj/project.pbxproj | 4 + .../allin/allin/Screens/RegisterScreen.swift | 96 +++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 Sources/allin/allin/Screens/RegisterScreen.swift diff --git a/Sources/allin/allin.xcodeproj/project.pbxproj b/Sources/allin/allin.xcodeproj/project.pbxproj index 0850035..c983f53 100644 --- a/Sources/allin/allin.xcodeproj/project.pbxproj +++ b/Sources/allin/allin.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ EC87FCD92ABBA60900363986 /* Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC87FCD82ABBA60900363986 /* Colors.swift */; }; EC87FCDB2ABBA6AC00363986 /* TrendingBetCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC87FCDA2ABBA6AC00363986 /* TrendingBetCard.swift */; }; EC9A45B02ABDF4A800125D41 /* HomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */; }; + ECDF624A2AC1CAFD00BA8213 /* RegisterScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */; }; ECFC54442AC0C39E00195760 /* LoginScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFC54432AC0C39E00195760 /* LoginScreen.swift */; }; /* End PBXBuildFile section */ @@ -66,6 +67,7 @@ EC87FCD82ABBA60900363986 /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Colors.swift; path = allin/Ressources/Colors.swift; sourceTree = SOURCE_ROOT; }; EC87FCDA2ABBA6AC00363986 /* TrendingBetCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TrendingBetCard.swift; path = allin/Views/TrendingBetCard.swift; sourceTree = SOURCE_ROOT; }; EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HomeScreen.swift; path = allin/Screens/HomeScreen.swift; sourceTree = SOURCE_ROOT; }; + ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RegisterScreen.swift; path = allin/Screens/RegisterScreen.swift; sourceTree = SOURCE_ROOT; }; ECFC54432AC0C39E00195760 /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LoginScreen.swift; path = allin/Screens/LoginScreen.swift; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ @@ -190,6 +192,7 @@ EC50BF952ABF4D3300197685 /* SplashScreen.swift */, EC50BF972ABF541B00197685 /* WelcomeScreen.swift */, ECFC54432AC0C39E00195760 /* LoginScreen.swift */, + ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */, ); path = Screens; sourceTree = ""; @@ -342,6 +345,7 @@ EC50BF962ABF4D3300197685 /* SplashScreen.swift in Sources */, EC9A45B02ABDF4A800125D41 /* HomeScreen.swift in Sources */, EC46D7DF2ABCE0A20030AC04 /* ParameterMenuView.swift in Sources */, + ECDF624A2AC1CAFD00BA8213 /* RegisterScreen.swift in Sources */, EC50BF982ABF541B00197685 /* WelcomeScreen.swift in Sources */, D98C4D642AB9D017007A6B4D /* AllInApp.swift in Sources */, EC87FCDB2ABBA6AC00363986 /* TrendingBetCard.swift in Sources */, diff --git a/Sources/allin/allin/Screens/RegisterScreen.swift b/Sources/allin/allin/Screens/RegisterScreen.swift new file mode 100644 index 0000000..9e75bbf --- /dev/null +++ b/Sources/allin/allin/Screens/RegisterScreen.swift @@ -0,0 +1,96 @@ +// +// RegisterScreen.swift +// AllIn +// +// Created by étudiant on 25/09/2023. +// + +import SwiftUI + +struct Register: View { + + @State private var pseudo: String = "" + @State private var username: String = "" + @State private var password: String = "" + @State private var passwordConfirm: String = "" + var body: some View { + GeometryReader { geometry in + VStack(spacing: 15) { + Spacer() + Text("On a besoin de ça!") + .betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40) + Text("Promis c’est rapide.") + .frame(width: 220) + .multilineTextAlignment(.center) + .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 20) + .padding(.bottom, 60) + + TextField("", text: $pseudo, prompt: Text("Pseudo").foregroundColor(.gray)) + .padding() + .background(Color.white.cornerRadius(9)) + .frame(width: 300) + .foregroundColor(.black) + .overlay( + RoundedRectangle(cornerRadius: 9, style: .continuous) + .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + ) + .padding(.bottom, 8) + + TextField("", text: $username, prompt: Text("Email").foregroundColor(.gray)) + .padding() + .background(Color.white.cornerRadius(9)) + .frame(width: 300) + .foregroundColor(.black) + .overlay( + RoundedRectangle(cornerRadius: 9, style: .continuous) + .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + ) + .padding(.bottom, 8) + + TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) + .padding() + .background(Color.white.cornerRadius(9)) + .frame(width: 300) + .overlay( + RoundedRectangle(cornerRadius: 9, style: .continuous) + .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + ) + .foregroundColor(.black) + .padding(.bottom, 8) + + TextField("", text: $passwordConfirm, prompt: Text("Confirmation du Mot de passe").foregroundColor(.gray)) + .padding() + .background(Color.white.cornerRadius(9)) + .frame(width: 300) + .overlay( + RoundedRectangle(cornerRadius: 9, style: .continuous) + .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + ) + .foregroundColor(.black) + .padding(.bottom, 50) + + Button(action: {}) { + Text("S'inscrire") + .betTextStyle(weight: .bold, color: .white, size: 17) + } + .frame(width: 300, height: 60) + .background(LinearGradient(gradient: + Gradient(colors:[AllinColor.TopBarColorPink,AllinColor.TopBarColorPurple,AllinColor.TopBarColorBlue]), + startPoint: .leading, endPoint: .trailing)) + .cornerRadius(13) + + Spacer() + HStack(spacing: 0) { + Text("Tu as déjà un compte? ") + .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16) + Text("Se connecter") + .betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) + } + + } + .frame(width: geometry.size.width, height: geometry.size.height) + .background(AllinColor.StartBackground) + } + } + +} From dddd873eb4a5cc15aba03c271036eef16e4cf9ee Mon Sep 17 00:00:00 2001 From: "emre.kartal" Date: Mon, 25 Sep 2023 18:15:57 +0200 Subject: [PATCH 3/5] Add Visibility Password :see_no_evil: --- Sources/allin/allin/Screens/LoginScreen.swift | 21 ++- .../allin/allin/Screens/RegisterScreen.swift | 157 ++++++++++++------ Sources/allin/allin/Views/TopBarView.swift | 2 +- 3 files changed, 128 insertions(+), 52 deletions(-) diff --git a/Sources/allin/allin/Screens/LoginScreen.swift b/Sources/allin/allin/Screens/LoginScreen.swift index 2cfcd30..dd1f28c 100644 --- a/Sources/allin/allin/Screens/LoginScreen.swift +++ b/Sources/allin/allin/Screens/LoginScreen.swift @@ -9,6 +9,7 @@ import SwiftUI struct Login: View { + @State private var isPasswordVisible = true @State private var username: String = "" @State private var password: String = "" var body: some View { @@ -34,7 +35,13 @@ struct Login: View { ) .padding(.bottom, 8) - TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) + Group { + if isPasswordVisible { + SecureField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) + } else { + TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) + } + } .padding() .background(Color.white.cornerRadius(9)) .frame(width: 300) @@ -42,6 +49,18 @@ struct Login: View { RoundedRectangle(cornerRadius: 9, style: .continuous) .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) ) + .overlay( + HStack { + Spacer() + Button(action: { + isPasswordVisible.toggle() + }) { + Image(systemName: isPasswordVisible ? "eye.slash" : "eye") + .foregroundColor(.gray) + } + .padding(.trailing, 8) + } + ) .foregroundColor(.black) Text("Mot de passe oublié?") diff --git a/Sources/allin/allin/Screens/RegisterScreen.swift b/Sources/allin/allin/Screens/RegisterScreen.swift index 9e75bbf..b4ab25f 100644 --- a/Sources/allin/allin/Screens/RegisterScreen.swift +++ b/Sources/allin/allin/Screens/RegisterScreen.swift @@ -9,45 +9,97 @@ import SwiftUI struct Register: View { + @State private var isPasswordVisible = true @State private var pseudo: String = "" @State private var username: String = "" @State private var password: String = "" @State private var passwordConfirm: String = "" var body: some View { GeometryReader { geometry in - VStack(spacing: 15) { - Spacer() - Text("On a besoin de ça!") - .betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40) - Text("Promis c’est rapide.") - .frame(width: 220) - .multilineTextAlignment(.center) - .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 20) - .padding(.bottom, 60) - - TextField("", text: $pseudo, prompt: Text("Pseudo").foregroundColor(.gray)) + ScrollView { + VStack(spacing: 15) { + Spacer() + VStack { + if (pseudo != "") { + Text("Bonjour "+pseudo+",") + .betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40) + .lineLimit(1) + .padding([.trailing, .leading], 30) + } else { + Text("Bonjour,") + .betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40) + .lineLimit(1) + .padding([.trailing, .leading], 30) + } + Text("On a besoin de ça!") + .betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40) + } + + Text("Promis c’est rapide.") + .frame(width: 220) + .multilineTextAlignment(.center) + .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 20) + .padding(.bottom, 60) + + TextField("", text: $pseudo, prompt: Text("Pseudo").foregroundColor(.gray)) + .padding() + .background(Color.white.cornerRadius(9)) + .frame(width: 300) + .foregroundColor(.black) + .overlay( + RoundedRectangle(cornerRadius: 9, style: .continuous) + .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + ) + .padding(.bottom, 8) + + TextField("", text: $username, prompt: Text("Email").foregroundColor(.gray)) + .padding() + .background(Color.white.cornerRadius(9)) + .frame(width: 300) + .foregroundColor(.black) + .overlay( + RoundedRectangle(cornerRadius: 9, style: .continuous) + .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + ) + .padding(.bottom, 8) + + Group { + if isPasswordVisible { + SecureField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) + } else { + TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) + } + } .padding() .background(Color.white.cornerRadius(9)) .frame(width: 300) - .foregroundColor(.black) .overlay( RoundedRectangle(cornerRadius: 9, style: .continuous) .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) ) - .padding(.bottom, 8) - - TextField("", text: $username, prompt: Text("Email").foregroundColor(.gray)) - .padding() - .background(Color.white.cornerRadius(9)) - .frame(width: 300) .foregroundColor(.black) + .padding(.bottom, 8) .overlay( - RoundedRectangle(cornerRadius: 9, style: .continuous) - .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + HStack { + Spacer() + Button(action: { + isPasswordVisible.toggle() + }) { + Image(systemName: isPasswordVisible ? "eye.slash" : "eye") + .foregroundColor(.gray) + } + .padding(.bottom, 8) + .padding(.trailing, 8) + } ) - .padding(.bottom, 8) - - TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) + + Group { + if isPasswordVisible { + SecureField("", text: $passwordConfirm, prompt: Text("Confirmation du Mot de passe").foregroundColor(.gray)) + } else { + TextField("", text: $passwordConfirm, prompt: Text("Confirmation du Mot de passe").foregroundColor(.gray)) + } + } .padding() .background(Color.white.cornerRadius(9)) .frame(width: 300) @@ -55,38 +107,43 @@ struct Register: View { RoundedRectangle(cornerRadius: 9, style: .continuous) .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) ) - .foregroundColor(.black) - .padding(.bottom, 8) - - TextField("", text: $passwordConfirm, prompt: Text("Confirmation du Mot de passe").foregroundColor(.gray)) - .padding() - .background(Color.white.cornerRadius(9)) - .frame(width: 300) .overlay( - RoundedRectangle(cornerRadius: 9, style: .continuous) - .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + HStack { + Spacer() + Button(action: { + isPasswordVisible.toggle() + }) { + Image(systemName: isPasswordVisible ? "eye.slash" : "eye") + .foregroundColor(.gray) + } + .padding(.bottom, 8) + .padding(.trailing, 8) + } ) .foregroundColor(.black) .padding(.bottom, 50) - - Button(action: {}) { - Text("S'inscrire") - .betTextStyle(weight: .bold, color: .white, size: 17) + + Button(action: {}) { + Text("S'inscrire") + .betTextStyle(weight: .bold, color: .white, size: 17) + } + .frame(width: 300, height: 60) + .background(LinearGradient(gradient: + Gradient(colors:[AllinColor.TopBarColorPink,AllinColor.TopBarColorPurple,AllinColor.TopBarColorBlue]), + startPoint: .leading, endPoint: .trailing)) + .cornerRadius(13) + + Spacer() + + HStack(spacing: 0) { + Text("Tu as déjà un compte? ") + .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16) + Text("Se connecter") + .betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) + } + } - .frame(width: 300, height: 60) - .background(LinearGradient(gradient: - Gradient(colors:[AllinColor.TopBarColorPink,AllinColor.TopBarColorPurple,AllinColor.TopBarColorBlue]), - startPoint: .leading, endPoint: .trailing)) - .cornerRadius(13) - - Spacer() - HStack(spacing: 0) { - Text("Tu as déjà un compte? ") - .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16) - Text("Se connecter") - .betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) - } - + } .frame(width: geometry.size.width, height: geometry.size.height) .background(AllinColor.StartBackground) diff --git a/Sources/allin/allin/Views/TopBarView.swift b/Sources/allin/allin/Views/TopBarView.swift index 141fd6b..3168483 100644 --- a/Sources/allin/allin/Views/TopBarView.swift +++ b/Sources/allin/allin/Views/TopBarView.swift @@ -14,7 +14,7 @@ struct TopBarView: View { var body: some View { ZStack{ HStack{ - Button(action: {withAnimation{ self.showMenu = !self.showMenu }}) { + Button(action: {withAnimation{ self.showMenu.toggle() }}) { Image("menu") .resizable() .frame(width: 26,height: 15) From 40a2ab261c223835fd95672c06ec2dbaa4af0081 Mon Sep 17 00:00:00 2001 From: "emre.kartal" Date: Mon, 25 Sep 2023 18:24:08 +0200 Subject: [PATCH 4/5] remove ScrollBar into the ScrollView :x: --- Sources/allin/allin/Screens/RegisterScreen.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/allin/allin/Screens/RegisterScreen.swift b/Sources/allin/allin/Screens/RegisterScreen.swift index b4ab25f..be0f149 100644 --- a/Sources/allin/allin/Screens/RegisterScreen.swift +++ b/Sources/allin/allin/Screens/RegisterScreen.swift @@ -16,7 +16,7 @@ struct Register: View { @State private var passwordConfirm: String = "" var body: some View { GeometryReader { geometry in - ScrollView { + ScrollView(showsIndicators: false) { VStack(spacing: 15) { Spacer() VStack { From 738e77ad9fffde5758df7a682b2c2ba4f4fa9b4d Mon Sep 17 00:00:00 2001 From: "emre.kartal" Date: Tue, 26 Sep 2023 10:15:07 +0200 Subject: [PATCH 5/5] Add Navigation :white_check_mark: --- Sources/allin/allin.xcodeproj/project.pbxproj | 4 ++ Sources/allin/allin/ContentView.swift | 36 +---------- Sources/allin/allin/Screens/LoginScreen.swift | 60 ++++++++++--------- .../allin/allin/Screens/RegisterScreen.swift | 9 +-- .../allin/allin/Screens/WelcomeScreen.swift | 19 +++--- Sources/allin/allin/Views/MenuView.swift | 7 ++- 6 files changed, 60 insertions(+), 75 deletions(-) diff --git a/Sources/allin/allin.xcodeproj/project.pbxproj b/Sources/allin/allin.xcodeproj/project.pbxproj index c983f53..4dfbea3 100644 --- a/Sources/allin/allin.xcodeproj/project.pbxproj +++ b/Sources/allin/allin.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ EC87FCDB2ABBA6AC00363986 /* TrendingBetCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC87FCDA2ABBA6AC00363986 /* TrendingBetCard.swift */; }; EC9A45B02ABDF4A800125D41 /* HomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */; }; ECDF624A2AC1CAFD00BA8213 /* RegisterScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */; }; + ECDF624C2AC205E100BA8213 /* BetScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDF624B2AC205E100BA8213 /* BetScreen.swift */; }; ECFC54442AC0C39E00195760 /* LoginScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFC54432AC0C39E00195760 /* LoginScreen.swift */; }; /* End PBXBuildFile section */ @@ -68,6 +69,7 @@ EC87FCDA2ABBA6AC00363986 /* TrendingBetCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TrendingBetCard.swift; path = allin/Views/TrendingBetCard.swift; sourceTree = SOURCE_ROOT; }; EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HomeScreen.swift; path = allin/Screens/HomeScreen.swift; sourceTree = SOURCE_ROOT; }; ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RegisterScreen.swift; path = allin/Screens/RegisterScreen.swift; sourceTree = SOURCE_ROOT; }; + ECDF624B2AC205E100BA8213 /* BetScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = BetScreen.swift; path = allin/Screens/BetScreen.swift; sourceTree = SOURCE_ROOT; }; ECFC54432AC0C39E00195760 /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LoginScreen.swift; path = allin/Screens/LoginScreen.swift; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ @@ -193,6 +195,7 @@ EC50BF972ABF541B00197685 /* WelcomeScreen.swift */, ECFC54432AC0C39E00195760 /* LoginScreen.swift */, ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */, + ECDF624B2AC205E100BA8213 /* BetScreen.swift */, ); path = Screens; sourceTree = ""; @@ -340,6 +343,7 @@ EC46D7DD2ABCCC270030AC04 /* MenuView.swift in Sources */, EC87FCD92ABBA60900363986 /* Colors.swift in Sources */, D98C4D662AB9D017007A6B4D /* ContentView.swift in Sources */, + ECDF624C2AC205E100BA8213 /* BetScreen.swift in Sources */, D92EC57C2ABADA2800CCD30E /* CoinCounterView.swift in Sources */, D98C4D8E2AB9D440007A6B4D /* TopBarView.swift in Sources */, EC50BF962ABF4D3300197685 /* SplashScreen.swift in Sources */, diff --git a/Sources/allin/allin/ContentView.swift b/Sources/allin/allin/ContentView.swift index 055470a..f5b2673 100644 --- a/Sources/allin/allin/ContentView.swift +++ b/Sources/allin/allin/ContentView.swift @@ -9,41 +9,9 @@ import SwiftUI struct ContentView: View { - @State var showMenu = false - var body: some View { - - let closeDrag = DragGesture() - .onEnded { - if $0.translation.width < -100 { - withAnimation{ - self.showMenu = false - } - } - } - let openDrag = DragGesture() - .onEnded { - if $0.translation.width > 100 { - withAnimation{ - self.showMenu = true - } - } - } - - GeometryReader { geometry in - ZStack(alignment: .leading) { - Home(showMenu: self.$showMenu) - .frame(width: geometry.size.width, height: geometry.size.height) - .offset(x: self.showMenu ? geometry.size.width/1.21:0) - .gesture(openDrag) - - if self.showMenu { - MenuView() - .frame(width: geometry.size.width*0.83) - .transition(.move(edge: .leading)) - } - } - .gesture(closeDrag) + NavigationView { + Welcome() } } } diff --git a/Sources/allin/allin/Screens/LoginScreen.swift b/Sources/allin/allin/Screens/LoginScreen.swift index dd1f28c..de07e4d 100644 --- a/Sources/allin/allin/Screens/LoginScreen.swift +++ b/Sources/allin/allin/Screens/LoginScreen.swift @@ -42,49 +42,53 @@ struct Login: View { TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray)) } } - .padding() - .background(Color.white.cornerRadius(9)) - .frame(width: 300) - .overlay( - RoundedRectangle(cornerRadius: 9, style: .continuous) - .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) - ) - .overlay( - HStack { - Spacer() - Button(action: { - isPasswordVisible.toggle() - }) { - Image(systemName: isPasswordVisible ? "eye.slash" : "eye") - .foregroundColor(.gray) - } - .padding(.trailing, 8) + .padding() + .background(Color.white.cornerRadius(9)) + .frame(width: 300) + .overlay( + RoundedRectangle(cornerRadius: 9, style: .continuous) + .stroke(AllinColor.StrokeGrayColor, lineWidth: 1) + ) + .overlay( + HStack { + Spacer() + Button(action: { + isPasswordVisible.toggle() + }) { + Image(systemName: isPasswordVisible ? "eye.slash" : "eye") + .foregroundColor(.gray) } - ) - .foregroundColor(.black) + .padding(.trailing, 8) + } + ) + .foregroundColor(.black) Text("Mot de passe oublié?") .frame(alignment: .trailing) .padding(.bottom, 20) .padding(.leading, 150) .betTextStyle(weight: .medium, color: AllinColor.StartTextColor, size: 14) - - Button(action: {}) { + + NavigationLink(destination: Home(page: "Bet").navigationBarBackButtonHidden(true)) + { Text("Se connecter") .betTextStyle(weight: .bold, color: .white, size: 17) + .frame(width: 300, height: 60) + .background(LinearGradient(gradient: + Gradient(colors:[AllinColor.TopBarColorPink,AllinColor.TopBarColorPurple,AllinColor.TopBarColorBlue]), + startPoint: .leading, endPoint: .trailing)) + .cornerRadius(13) } - .frame(width: 300, height: 60) - .background(LinearGradient(gradient: - Gradient(colors:[AllinColor.TopBarColorPink,AllinColor.TopBarColorPurple,AllinColor.TopBarColorBlue]), - startPoint: .leading, endPoint: .trailing)) - .cornerRadius(13) Spacer() HStack(spacing: 0) { Text("Pas encore inscrit? ") .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16) - Text("S'inscrire") - .betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) + NavigationLink(destination: Register().navigationBarBackButtonHidden(true)) + { + Text("S'inscrire") + .betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) + } } } diff --git a/Sources/allin/allin/Screens/RegisterScreen.swift b/Sources/allin/allin/Screens/RegisterScreen.swift index be0f149..ef88316 100644 --- a/Sources/allin/allin/Screens/RegisterScreen.swift +++ b/Sources/allin/allin/Screens/RegisterScreen.swift @@ -23,7 +23,6 @@ struct Register: View { if (pseudo != "") { Text("Bonjour "+pseudo+",") .betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40) - .lineLimit(1) .padding([.trailing, .leading], 30) } else { Text("Bonjour,") @@ -116,7 +115,6 @@ struct Register: View { Image(systemName: isPasswordVisible ? "eye.slash" : "eye") .foregroundColor(.gray) } - .padding(.bottom, 8) .padding(.trailing, 8) } ) @@ -138,8 +136,11 @@ struct Register: View { HStack(spacing: 0) { Text("Tu as déjà un compte? ") .betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16) - Text("Se connecter") - .betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) + NavigationLink(destination: Login().navigationBarBackButtonHidden(true)) + { + Text("Se connecter") + .betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16) + } } } diff --git a/Sources/allin/allin/Screens/WelcomeScreen.swift b/Sources/allin/allin/Screens/WelcomeScreen.swift index 54c7fcb..2ad67fa 100644 --- a/Sources/allin/allin/Screens/WelcomeScreen.swift +++ b/Sources/allin/allin/Screens/WelcomeScreen.swift @@ -61,19 +61,24 @@ struct Welcome: View { .padding([.leading,.trailing], 40) Spacer() Spacer() - Button(action: {}) { + NavigationLink(destination: Register().navigationBarBackButtonHidden(true)) + { Text("Rejoindre") .betTextStyle(weight: .bold, color: AllinColor.StartBackground, size: 17) + .frame(width: geometry.size.width*0.85, height: 50) + .background(AllinColor.LightPurple) + .cornerRadius(30) } - .frame(width: geometry.size.width*0.85, height: 50) - .background(AllinColor.LightPurple) - .cornerRadius(30) + HStack(spacing: 0) { Text("Tu as déja un compte? ") .betTextStyle(weight: .regular, color: AllinColor.LightPurple, size: 16) - Text("Connexion") - .betTextStyle(weight: .semibold, color: AllinColor.LightPurple, size: 16) - .underline() + NavigationLink(destination: Login().navigationBarBackButtonHidden(true)) + { + Text("Connexion") + .betTextStyle(weight: .semibold, color: AllinColor.LightPurple, size: 16) + .underline() + } } Spacer() } diff --git a/Sources/allin/allin/Views/MenuView.swift b/Sources/allin/allin/Views/MenuView.swift index 3273aaa..fb4e1e0 100644 --- a/Sources/allin/allin/Views/MenuView.swift +++ b/Sources/allin/allin/Views/MenuView.swift @@ -12,8 +12,11 @@ struct MenuView: View { var body: some View { VStack(alignment: .leading, spacing: 10) { - ParameterMenuView(icon: "VideoGame", title: "CREER UN BET", description: "Créez un nouveau BET et faites participer vos amis.") - .padding([.leading,.trailing], 13) + NavigationLink(destination: Home(page: "CreationBet").navigationBarBackButtonHidden(true)) + { + ParameterMenuView(icon: "VideoGame", title: "CREER UN BET", description: "Créez un nouveau BET et faites participer vos amis.") + .padding([.leading,.trailing], 13) + } ParameterMenuView(icon: "Eyes", title: "HISTORIQUE DES BETS", description: "Consultez vos paris en cours et terminés.") .padding([.leading,.trailing], 13)