diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/BlackTitleColor.colorset/Contents.json b/Sources/AllInApp/AllIn/Assets.xcassets/BlackTitleColor.colorset/Contents.json new file mode 100644 index 0000000..0e54db2 --- /dev/null +++ b/Sources/AllInApp/AllIn/Assets.xcassets/BlackTitleColor.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" : "0x49", + "green" : "0x49", + "red" : "0x49" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/Bleue200.colorset/Contents.json b/Sources/AllInApp/AllIn/Assets.xcassets/Bleue200.colorset/Contents.json new file mode 100644 index 0000000..0286b3d --- /dev/null +++ b/Sources/AllInApp/AllIn/Assets.xcassets/Bleue200.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xF8", + "green" : "0x99", + "red" : "0x23" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xF8", + "green" : "0x99", + "red" : "0x23" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/BleueBadge.imageset/Contents.json b/Sources/AllInApp/AllIn/Assets.xcassets/BleueBadge.imageset/Contents.json new file mode 100644 index 0000000..446d6be --- /dev/null +++ b/Sources/AllInApp/AllIn/Assets.xcassets/BleueBadge.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Vector.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/BleueBadge.imageset/Vector.png b/Sources/AllInApp/AllIn/Assets.xcassets/BleueBadge.imageset/Vector.png new file mode 100644 index 0000000..2114e9d Binary files /dev/null and b/Sources/AllInApp/AllIn/Assets.xcassets/BleueBadge.imageset/Vector.png differ diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/LoadingHeart.imageset/Contents.json b/Sources/AllInApp/AllIn/Assets.xcassets/LoadingHeart.imageset/Contents.json new file mode 100644 index 0000000..063d4f3 --- /dev/null +++ b/Sources/AllInApp/AllIn/Assets.xcassets/LoadingHeart.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Group 280.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/LoadingHeart.imageset/Group 280.png b/Sources/AllInApp/AllIn/Assets.xcassets/LoadingHeart.imageset/Group 280.png new file mode 100644 index 0000000..956a97a Binary files /dev/null and b/Sources/AllInApp/AllIn/Assets.xcassets/LoadingHeart.imageset/Group 280.png differ diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/Pink100.colorset/Contents.json b/Sources/AllInApp/AllIn/Assets.xcassets/Pink100.colorset/Contents.json new file mode 100644 index 0000000..3492dff --- /dev/null +++ b/Sources/AllInApp/AllIn/Assets.xcassets/Pink100.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x8A", + "green" : "0x2B", + "red" : "0xFE" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x8A", + "green" : "0x2B", + "red" : "0xFE" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/Pink200.colorset/Contents.json b/Sources/AllInApp/AllIn/Assets.xcassets/Pink200.colorset/Contents.json new file mode 100644 index 0000000..c0ba743 --- /dev/null +++ b/Sources/AllInApp/AllIn/Assets.xcassets/Pink200.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xA8", + "green" : "0x49", + "red" : "0xC2" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xA8", + "green" : "0x49", + "red" : "0xC2" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/PinkBadge.imageset/Contents.json b/Sources/AllInApp/AllIn/Assets.xcassets/PinkBadge.imageset/Contents.json new file mode 100644 index 0000000..b0b4a62 --- /dev/null +++ b/Sources/AllInApp/AllIn/Assets.xcassets/PinkBadge.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Vector (1).png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/PinkBadge.imageset/Vector (1).png b/Sources/AllInApp/AllIn/Assets.xcassets/PinkBadge.imageset/Vector (1).png new file mode 100644 index 0000000..c6c1d71 Binary files /dev/null and b/Sources/AllInApp/AllIn/Assets.xcassets/PinkBadge.imageset/Vector (1).png differ diff --git a/Sources/AllInApp/AllIn/Assets.xcassets/Purple200.colorset/Contents.json b/Sources/AllInApp/AllIn/Assets.xcassets/Purple200.colorset/Contents.json new file mode 100644 index 0000000..8beecea --- /dev/null +++ b/Sources/AllInApp/AllIn/Assets.xcassets/Purple200.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xC5", + "green" : "0x66", + "red" : "0x8A" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xC5", + "green" : "0x66", + "red" : "0x8A" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/AllInApp/AllIn/Components/AllcoinsCounter.swift b/Sources/AllInApp/AllIn/Components/AllcoinsCounter.swift index eb21bd1..e5771c1 100644 --- a/Sources/AllInApp/AllIn/Components/AllcoinsCounter.swift +++ b/Sources/AllInApp/AllIn/Components/AllcoinsCounter.swift @@ -8,6 +8,8 @@ import SwiftUI struct AllcoinsCounter: View { + var backgroundColor: Color = AllInColors.whiteColor + var foreGroundColor: Color = AllInColors.primaryColor var body: some View { HStack(alignment: .center) { Image("allcoinIcon") @@ -15,10 +17,10 @@ struct AllcoinsCounter: View { .frame(width: 17, height: 17, alignment: .leading) Text(String(AppStateContainer.shared.user?.nbCoins ?? 0)) .fontWeight(.black) - .foregroundColor(AllInColors.primaryColor) + .foregroundColor(foreGroundColor) } .frame(width: 90, height: 40) - .background(Color.white) + .background(backgroundColor) .cornerRadius(9999, corners: [.topLeft, .bottomLeft]) } diff --git a/Sources/AllInApp/AllIn/Components/BetCard.swift b/Sources/AllInApp/AllIn/Components/BetCard.swift index a1d3eda..653f9a9 100644 --- a/Sources/AllInApp/AllIn/Components/BetCard.swift +++ b/Sources/AllInApp/AllIn/Components/BetCard.swift @@ -9,47 +9,46 @@ import SwiftUI struct BetCard: View { @State var showDetails: Bool = false + @State var showParticipate: Bool = false var body: some View { - ZStack{ - VStack(spacing: 0){ - VStack(alignment: .leading,spacing: 2){ - HStack{ - Spacer() - Text("proposé par Lucas").font(.system(size: 10)).foregroundColor(AllInColors.grey800Color) - - } - Text("Etudes").font(.system(size: 15)).foregroundColor(AllInColors.grey800Color) - Text("Emre va réussir son TP de CI/CD mercredi?").font(.system(size: 20)).fontWeight(.bold) - HStack{ - Text("Commence le").font(.system(size: 15)).foregroundColor(AllInColors.grey800Color) - TextCapsule() - TextCapsule() - Spacer() - - } + VStack(spacing: 0){ + VStack(alignment: .leading,spacing: 2){ + HStack{ + Spacer() + Text("proposé par Lucas").font(.system(size: 10)).foregroundColor(AllInColors.grey800Color) + } - .frame(width: .infinity) - .padding(.all,15) - .background(AllInColors.componentBackgroundColor).cornerRadius(20, corners: [.topLeft,.topRight]).padding(.bottom,0) - - VStack(alignment: .leading,spacing: 2){ - HStack{ - Spacer() - UsersPreview() - Text(" 4 joueurs en attente").font(.system(size: 15)).foregroundColor(AllInColors.grey800Color).fontWeight(.medium) - - Spacer() - - }.padding(0) - ParticipateButton().padding(.top, 5) + Text("Etudes").font(.system(size: 15)).foregroundColor(AllInColors.grey800Color) + Text("Emre va réussir son TP de CI/CD mercredi?").font(.system(size: 20)).fontWeight(.bold) + HStack{ + Text("Commence le").font(.system(size: 15)).foregroundColor(AllInColors.grey800Color) + TextCapsule() + TextCapsule() + Spacer() } - .frame(width: .infinity) - .padding(.all,8) - .background(AllInColors.underComponentBackgroundColor) - .cornerRadius(20, corners: [.bottomLeft,.bottomRight]) - .border(width: 1, edges: [.top], color: AllInColors.delimiterGrey) } + .frame(width: .infinity) + .padding(.all,15) + .background(AllInColors.componentBackgroundColor).cornerRadius(20, corners: [.topLeft,.topRight]).padding(.bottom,0) + + VStack(alignment: .leading,spacing: 2){ + HStack{ + Spacer() + UsersPreview() + Text(" 4 joueurs en attente").font(.system(size: 15)).foregroundColor(AllInColors.grey800Color).fontWeight(.medium) + + Spacer() + + }.padding(0) + ParticipateButton(isOpen: $showParticipate).padding(.top, 5) + + } + .frame(width: .infinity) + .padding(.all,8) + .background(AllInColors.underComponentBackgroundColor) + .cornerRadius(20, corners: [.bottomLeft,.bottomRight]) + .border(width: 1, edges: [.top], color: AllInColors.delimiterGrey) }.onTapGesture { showDetails.toggle() }.fullScreenCover(isPresented: $showDetails) { @@ -57,6 +56,8 @@ struct BetCard: View { } } + + } struct BetCard_Previews: PreviewProvider { diff --git a/Sources/AllInApp/AllIn/Components/BetLineLoading.swift b/Sources/AllInApp/AllIn/Components/BetLineLoading.swift new file mode 100644 index 0000000..ba9dc95 --- /dev/null +++ b/Sources/AllInApp/AllIn/Components/BetLineLoading.swift @@ -0,0 +1,77 @@ +// +// BetLineLoading.swift +// AllIn +// +// Created by Lucas Delanier on 19/01/2024. +// + +import SwiftUI + +struct BetLineLoading: View { + + @Binding var value: Float + var body: some View { + GeometryReader { geometry in + VStack(spacing: 0){ + HStack(spacing: 5){ + Text("OUI").font(.system(size: 25)).fontWeight(.bold).foregroundColor(AllInColors.bleue200) + Spacer() + Text("NON").font(.system(size: 25)).fontWeight(.bold).foregroundColor(AllInColors.pink100) + + } + ZStack(alignment: .leading) { + HStack{ + Spacer() + Rectangle().frame(width: min(CGFloat(1-self.value)*geometry.size.width, geometry.size.width), height: 17) + .foregroundStyle(AllInColors.PinkBetGradiant).cornerRadius(999) + } + + HStack(spacing: 0){ + Rectangle().frame(width: min(CGFloat(self.value)*geometry.size.width, geometry.size.width), height: 17) + .foregroundStyle(AllInColors.BlueBetGradiant).cornerRadius(999) + .animation(.linear) + Image("LoadingHeart").resizable().frame(width: 29, height: 32).padding(.leading, -10) + } + + } + VStack(spacing: 1){ + HStack(spacing: 5){ + Image("BleueBadge").resizable().frame(width:10, height: 14) + Text("1.2").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.bleue200) + Spacer() + Text("1.2").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.pink100) + Image("PinkBadge").resizable().frame(width:10, height: 14) + + } + HStack(spacing: 5){ + Image("BleueBadge").resizable().frame(width:10, height: 14) + Text("1.2").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.bleue200) + Spacer() + Text("1.2").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.pink100) + Image("PinkBadge").resizable().frame(width:10, height: 14) + + } + HStack(spacing: 5){ + Image("BleueBadge").resizable().frame(width:10, height: 14) + Text("1.2").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.bleue200) + Spacer() + Text("1.2").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.pink100) + Image("PinkBadge").resizable().frame(width:10, height: 14) + + } + HStack(spacing: 5){ + Image("BleueBadge").resizable().frame(width:10, height: 14) + Text("1.2").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.bleue200) + Spacer() + Text("1.2").font(.system(size: 15)).fontWeight(.bold).foregroundColor(AllInColors.pink100) + Image("PinkBadge").resizable().frame(width:10, height: 14) + + } + } + } + + } + } +} + + diff --git a/Sources/AllInApp/AllIn/Components/DropDownAnswerMenu.swift b/Sources/AllInApp/AllIn/Components/DropDownAnswerMenu.swift new file mode 100644 index 0000000..b3c3c99 --- /dev/null +++ b/Sources/AllInApp/AllIn/Components/DropDownAnswerMenu.swift @@ -0,0 +1,81 @@ +// +// DropDownAnswerMenu.swift +// AllIn +// +// Created by Lucas Delanier on 16/01/2024. +// + +import SwiftUI + +// +// DropDownMenu.swift +// AllIn +// +// Created by Emre on 19/10/2023. +// + +import SwiftUI + +struct DropDownAnswerMenu: View { + + @State var expand = false + @Binding var selectedOption: Int + var options: [(Int, String, Float)] + + var body: some View { + VStack(spacing: 0, content: { + Button(action: { self.expand.toggle() }) { + HStack{ + Text(options[selectedOption].1.description) + .textStyle(weight: .bold, color: AllInColors.blueAccentColor, size: 20) + Text(options[selectedOption].2.description) + .textStyle(weight: .bold, color: AllInColors.lightPurpleColor, size: 10) + + Spacer() + Image(expand ? "chevronUpIcon" : "chevronDownIcon").resizable().frame(width: 15, height: 10).scaledToFill() + } + .padding([.leading, .trailing], 15) + .frame(height: 43) + } + if expand { + Rectangle() + .frame(height: 1) + .foregroundColor(AllInColors.delimiterGrey) + .padding(.bottom, 18) + VStack(spacing: 0) { + ForEach(0..