diff --git a/Sources/allin/allin.xcodeproj/project.pbxproj b/Sources/allin/allin.xcodeproj/project.pbxproj index 78d7258..f526a57 100644 --- a/Sources/allin/allin.xcodeproj/project.pbxproj +++ b/Sources/allin/allin.xcodeproj/project.pbxproj @@ -16,9 +16,11 @@ D98C4D7F2AB9D019007A6B4D /* AllInUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D98C4D7E2AB9D019007A6B4D /* AllInUITests.swift */; }; D98C4D812AB9D019007A6B4D /* AllInUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D98C4D802AB9D019007A6B4D /* AllInUITestsLaunchTests.swift */; }; D98C4D8E2AB9D440007A6B4D /* TopBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D98C4D8D2AB9D440007A6B4D /* TopBarView.swift */; }; + EC000A7B2AC7450200A8BE26 /* CreationBetScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC000A7A2AC7450200A8BE26 /* CreationBetScreen.swift */; }; EC2C1EEB2AC08BE80091D57C /* BetCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2C1EEA2AC08BE80091D57C /* BetCard.swift */; }; EC2C1EED2AC093820091D57C /* TextCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2C1EEC2AC093820091D57C /* TextCapsule.swift */; }; EC2C1EEF2AC098D30091D57C /* UsersPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2C1EEE2AC098D30091D57C /* UsersPreview.swift */; }; + EC31955E2ACD3B8E00D0A4DC /* ConfidentialityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC31955D2ACD3B8E00D0A4DC /* ConfidentialityView.swift */; }; EC3737E42AC2F5FB00E6BDB5 /* ChoiceCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC3737E32AC2F5FB00E6BDB5 /* ChoiceCapsule.swift */; }; EC3737E62AC41DB000E6BDB5 /* WinModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC3737E52AC41DB000E6BDB5 /* WinModal.swift */; }; EC3737E82AC5A53B00E6BDB5 /* AllcoinsCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC3737E72AC5A53B00E6BDB5 /* AllcoinsCapsule.swift */; }; @@ -70,10 +72,12 @@ D98C4D7E2AB9D019007A6B4D /* AllInUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllInUITests.swift; sourceTree = ""; }; D98C4D802AB9D019007A6B4D /* AllInUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllInUITestsLaunchTests.swift; sourceTree = ""; }; D98C4D8D2AB9D440007A6B4D /* TopBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopBarView.swift; sourceTree = ""; }; + EC000A7A2AC7450200A8BE26 /* CreationBetScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = CreationBetScreen.swift; path = allin/Screens/CreationBetScreen.swift; sourceTree = SOURCE_ROOT; }; EC0EA7AF2ABDAAD1006BA4A0 /* PlusJakartaSans.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = PlusJakartaSans.ttf; sourceTree = ""; }; EC2C1EEA2AC08BE80091D57C /* BetCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = BetCard.swift; path = allin/Views/BetCard.swift; sourceTree = SOURCE_ROOT; }; EC2C1EEC2AC093820091D57C /* TextCapsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TextCapsule.swift; path = allin/Views/TextCapsule.swift; sourceTree = SOURCE_ROOT; }; EC2C1EEE2AC098D30091D57C /* UsersPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = UsersPreview.swift; path = allin/Views/UsersPreview.swift; sourceTree = SOURCE_ROOT; }; + EC31955D2ACD3B8E00D0A4DC /* ConfidentialityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ConfidentialityView.swift; path = allin/Views/ConfidentialityView.swift; sourceTree = SOURCE_ROOT; }; EC3737E32AC2F5FB00E6BDB5 /* ChoiceCapsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ChoiceCapsule.swift; path = allin/Views/ChoiceCapsule.swift; sourceTree = SOURCE_ROOT; }; EC3737E52AC41DB000E6BDB5 /* WinModal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WinModal.swift; path = allin/Screens/WinModal.swift; sourceTree = SOURCE_ROOT; }; EC3737E72AC5A53B00E6BDB5 /* AllcoinsCapsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AllcoinsCapsule.swift; path = allin/Views/AllcoinsCapsule.swift; sourceTree = SOURCE_ROOT; }; @@ -136,6 +140,7 @@ ECA7010E2AC4949D00532444 /* FriendView.swift */, EC3737E72AC5A53B00E6BDB5 /* AllcoinsCapsule.swift */, EC3737E92AC5A58B00E6BDB5 /* RecapBetCard.swift */, + EC31955D2ACD3B8E00D0A4DC /* ConfidentialityView.swift */, ); path = Views; sourceTree = ""; @@ -229,6 +234,7 @@ ECA701082AC3FE3300532444 /* RankingScreen.swift */, ECA7010C2AC4948600532444 /* FriendsScreen.swift */, EC3737E52AC41DB000E6BDB5 /* WinModal.swift */, + EC000A7A2AC7450200A8BE26 /* CreationBetScreen.swift */, ); path = Screens; sourceTree = ""; @@ -372,6 +378,7 @@ buildActionMask = 2147483647; files = ( ECA7010B2AC4003400532444 /* RankingRowView.swift in Sources */, + EC31955E2ACD3B8E00D0A4DC /* ConfidentialityView.swift in Sources */, ECA701092AC3FE3300532444 /* RankingScreen.swift in Sources */, ECFC54442AC0C39E00195760 /* LoginScreen.swift in Sources */, EC87FCD62ABBA24000363986 /* Extensions.swift in Sources */, @@ -397,6 +404,7 @@ D98C4D642AB9D017007A6B4D /* AllInApp.swift in Sources */, EC2C1EEF2AC098D30091D57C /* UsersPreview.swift in Sources */, EC87FCDB2ABBA6AC00363986 /* TrendingBetCard.swift in Sources */, + EC000A7B2AC7450200A8BE26 /* CreationBetScreen.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Sources/allin/allin/Assets.xcassets/PlaceholderGrayColor.colorset/Contents.json b/Sources/allin/allin/Assets.xcassets/PlaceholderGrayColor.colorset/Contents.json new file mode 100644 index 0000000..6b527a7 --- /dev/null +++ b/Sources/allin/allin/Assets.xcassets/PlaceholderGrayColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xCB", + "green" : "0xCB", + "red" : "0xCB" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xCB", + "green" : "0xCB", + "red" : "0xCB" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/allin/allin/Assets.xcassets/PurpleLight.colorset/Contents.json b/Sources/allin/allin/Assets.xcassets/PurpleLight.colorset/Contents.json new file mode 100644 index 0000000..7388cc5 --- /dev/null +++ b/Sources/allin/allin/Assets.xcassets/PurpleLight.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xB5", + "red" : "0xB7" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xB5", + "red" : "0xB7" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/allin/allin/Assets.xcassets/TitleCreationBetColor.colorset/Contents.json b/Sources/allin/allin/Assets.xcassets/TitleCreationBetColor.colorset/Contents.json new file mode 100644 index 0000000..d1f70bd --- /dev/null +++ b/Sources/allin/allin/Assets.xcassets/TitleCreationBetColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x49", + "green" : "0x49", + "red" : "0x49" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/allin/allin/Assets.xcassets/circle-question-regular.imageset/Contents.json b/Sources/allin/allin/Assets.xcassets/circle-question-regular.imageset/Contents.json new file mode 100644 index 0000000..5f326db --- /dev/null +++ b/Sources/allin/allin/Assets.xcassets/circle-question-regular.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "circle-question-regular.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/allin/allin/Assets.xcassets/circle-question-regular.imageset/circle-question-regular.png b/Sources/allin/allin/Assets.xcassets/circle-question-regular.imageset/circle-question-regular.png new file mode 100644 index 0000000..c8b22bc Binary files /dev/null and b/Sources/allin/allin/Assets.xcassets/circle-question-regular.imageset/circle-question-regular.png differ diff --git a/Sources/allin/allin/ContentView.swift b/Sources/allin/allin/ContentView.swift index 8095dc5..30cfc89 100644 --- a/Sources/allin/allin/ContentView.swift +++ b/Sources/allin/allin/ContentView.swift @@ -11,7 +11,7 @@ struct ContentView: View { var body: some View { NavigationView { - Home(page: "Bet") + Home(page: "CreationBet") } } } diff --git a/Sources/allin/allin/Ressources/Colors.swift b/Sources/allin/allin/Ressources/Colors.swift index 4ee6ff8..92b0774 100644 --- a/Sources/allin/allin/Ressources/Colors.swift +++ b/Sources/allin/allin/Ressources/Colors.swift @@ -31,6 +31,9 @@ struct AllinColor { static let Gray_400 = Color("Gray_400") static let Gray_100 = Color("Gray_100") static let lightGray = Color("LightGray") + static let PurpleLight = Color("PurpleLight") + static let TitleCreationBetColor = Color("TitleCreationBetColor") + static let PlaceholderGrayColor = Color("PlaceholderGrayColor") static let BorderColorMenu = Color("BorderColorMenu") static let PrimaryTextColor = Color("PrimaryTextColor") static let DelimiterGray = Color("DelimiterGray") diff --git a/Sources/allin/allin/Screens/CreationBetScreen.swift b/Sources/allin/allin/Screens/CreationBetScreen.swift new file mode 100644 index 0000000..19442a4 --- /dev/null +++ b/Sources/allin/allin/Screens/CreationBetScreen.swift @@ -0,0 +1,213 @@ +// +// CreationBetScreen.swift +// AllIn +// +// Created by étudiant on 29/09/2023. +// + +import SwiftUI + +struct CreationBet: View { + + @Binding var showMenu: Bool + @State var selectedConfidentiality = true + @State private var theme: String = "" + @State private var description: String = "" + @State var present = false + @State private var startDate = Date() + @State private var endDate = Date() + let dateRange: ClosedRange = { + let calendar = Calendar.current + let startDate = Date() + let endDate = calendar.date(byAdding: .year, value: 10, to: startDate)! + return startDate ... endDate + }() + + var body: some View { + VStack(alignment: .center, spacing: 0) { + TopBarView(showMenu: self.$showMenu) + TabView { + ScrollView(showsIndicators: false) { + VStack(alignment: .leading, spacing: 5) { + VStack() { + HStack(spacing: 5) { + Text("Thème") + .font(.system(size: 17)) + .fontWeight(.bold) + .foregroundColor(AllinColor.TitleCreationBetColor) + Image("circle-question-regular") + .resizable() + .frame(width: 14, height: 14) + Spacer() + } + .padding(.leading, 10) + TextField("", text: $theme, prompt: Text("Études, sport, soirée...").foregroundColor(AllinColor.PlaceholderGrayColor).font(.system(size: 14)).fontWeight(.light)) + .padding() + .background( + RoundedRectangle(cornerRadius: 9) + .fill(Color.white) + .frame(height: 40) + ) + .frame(width: 350, height: 40) + .foregroundColor(.black) + .overlay( + RoundedRectangle(cornerRadius: 10, style: .continuous) + .stroke(AllinColor.LightGray_200, lineWidth: 1) + ) + .padding(.bottom, 5) + } + + HStack(spacing: 5) { + Text("Phrase du BET") + .font(.system(size: 17)) + .fontWeight(.bold) + .foregroundColor(AllinColor.TitleCreationBetColor) + Image("circle-question-regular") + .resizable() + .frame(width: 14, height: 14) + Spacer() + } + .padding(.leading, 10) + TextField("", text: $description, prompt: Text("Études, sport, soirée...").foregroundColor(AllinColor.PlaceholderGrayColor).font(.system(size: 14)).fontWeight(.light), axis: .vertical) + .lineLimit(4, reservesSpace: true) + .padding() + .background( + RoundedRectangle(cornerRadius: 9) + .fill(Color.white) + .frame(height: 110) + ) + .frame(width: 350, height: 110) + .foregroundColor(.black) + .overlay( + RoundedRectangle(cornerRadius: 10, style: .continuous) + .stroke(AllinColor.LightGray_200, lineWidth: 1) + ) + .padding(.bottom, 30) + + HStack(spacing: 5) { + Text("Date de fin des inscriptions") + .font(.system(size: 17)) + .fontWeight(.bold) + .foregroundColor(AllinColor.TitleCreationBetColor) + Image("circle-question-regular") + .resizable() + .frame(width: 14, height: 14) + Spacer() + } + .padding(.leading, 10) + DatePicker( + "", + selection: $startDate, + in: dateRange, + displayedComponents: [.date, .hourAndMinute] + ) + .accentColor(AllinColor.PrimaryTextColor) + .labelsHidden() + .padding(.bottom, 10) + VStack() { + HStack(spacing: 5) { + Text("Date de fin du BET") + .font(.system(size: 17)) + .fontWeight(.bold) + .foregroundColor(AllinColor.TitleCreationBetColor) + Image("circle-question-regular") + .resizable() + .frame(width: 14, height: 14) + Spacer() + } + .padding(.leading, 10) + HStack() { + DatePicker( + "", + selection: $endDate, + in: dateRange, + displayedComponents: [.date, .hourAndMinute] + ) + .accentColor(AllinColor.PrimaryTextColor) + .labelsHidden() + Spacer() + } + } + .padding(.bottom, 40) + VStack { + HStack(spacing: 5) { + Text("Confidentialité du BET") + .font(.system(size: 17)) + .fontWeight(.bold) + .foregroundColor(AllinColor.TitleCreationBetColor) + Image("circle-question-regular") + .resizable() + .frame(width: 14, height: 14) + Spacer() + } + .padding(.leading, 10) + HStack(spacing: 5) { + ConfidentialityView(image: "globe", text: "Public", selected: selectedConfidentiality) + .onTapGesture { + selectedConfidentiality = true + } + .padding(.trailing, 5) + ConfidentialityView(image: "lock", text: "Privé", selected: !selectedConfidentiality) + .onTapGesture { + selectedConfidentiality = false + } + Spacer() + } + } + .padding(.bottom, 10) + VStack(spacing: 10) { + Text("Votre BET sera visible par tous les utilisateurs.") + .font(.system(size: 13)) + .fontWeight(.bold) + .padding(.leading, 35) + .foregroundColor(AllinColor.PurpleLight) + .multilineTextAlignment(.center) + Text("Tout le monde pourra rejoindre le BET.") + .font(.system(size: 13)) + .fontWeight(.bold) + .padding(.leading, 35) + .foregroundColor(AllinColor.PurpleLight) + .multilineTextAlignment(.center) + Text("Vous pourrez inviter des amis à tout moment pendant la période d’inscription.") + .font(.system(size: 13)) + .padding(.leading, 35) + .fontWeight(.bold) + .foregroundColor(AllinColor.PurpleLight) + .multilineTextAlignment(.center) + + } + Spacer() + HStack() { + Spacer() + Button(action: {}) { + Text("Publier le bet") + .font(.system(size: 24)) + .fontWeight(.bold) + .foregroundColor(.purple) + .overlay { + AllinColor.gradiantCard.frame(width: 150) + .mask( + Text("Publier le bet") + .font(.system(size: 24)) + .fontWeight(.bold) + .frame(maxWidth: .infinity) + ) + } + } + .frame(width: 335, height: 60) + .background(.white) + .cornerRadius(12) + Spacer() + } + } + .padding([.leading,.trailing, .top, .bottom], 30) + } + + Text("Hello") + } + .tabViewStyle(PageTabViewStyle()) + Spacer() + } + .edgesIgnoringSafeArea(.bottom).background(AllinColor.backgroundWhite) + } +} diff --git a/Sources/allin/allin/Screens/HomeScreen.swift b/Sources/allin/allin/Screens/HomeScreen.swift index b3cb6c7..a7733a3 100644 --- a/Sources/allin/allin/Screens/HomeScreen.swift +++ b/Sources/allin/allin/Screens/HomeScreen.swift @@ -44,6 +44,9 @@ struct Home: View { case "Friends": Friends(showMenu: self.$showMenu) + case "CreationBet": + CreationBet(showMenu: self.$showMenu) + default: Bet(showMenu: self.$showMenu) } diff --git a/Sources/allin/allin/Views/ConfidentialityView.swift b/Sources/allin/allin/Views/ConfidentialityView.swift new file mode 100644 index 0000000..e0c2d3f --- /dev/null +++ b/Sources/allin/allin/Views/ConfidentialityView.swift @@ -0,0 +1,32 @@ +// +// ConfidentialityView.swift +// AllIn +// +// Created by étudiant on 04/10/2023. +// + +import SwiftUI + +struct ConfidentialityView: View { + + var image: String + var text: String + var selected: Bool + + var body: some View { + HStack() { + Image(systemName: image) + .resizable() + .frame(width: 18, height: 18) + .foregroundColor(selected ? .white : AllinColor.PrimaryTextColor) + + Text(text) + .font(.system(size: 17)) + .fontWeight(.bold) + .foregroundColor(selected ? .white : AllinColor.PrimaryTextColor) + } + .frame(width: 110, height: 45) + .background(selected ? AllinColor.PrimaryTextColor : .white) + .cornerRadius(10) + } +} diff --git a/Sources/allin/allin/Views/MenuView.swift b/Sources/allin/allin/Views/MenuView.swift index 56b394a..1c2d7f0 100644 --- a/Sources/allin/allin/Views/MenuView.swift +++ b/Sources/allin/allin/Views/MenuView.swift @@ -83,8 +83,11 @@ struct MenuView: View { .padding([.leading,.trailing], 13) } - ParameterMenuView(icon: "Money", title: "BET EN COURS", description: "Gérez vos bets et récompensez les gagnants.") - .padding([.leading,.trailing], 13) + NavigationLink(destination: Home(page: "CreationBet").navigationBarBackButtonHidden(true)) + { + ParameterMenuView(icon: "Money", title: "BET EN COURS", description: "Gérez vos bets et récompensez les gagnants.") + .padding([.leading,.trailing], 13) + } Spacer() Image("GearIcon")