diff --git a/Sources/allin/allin.xcodeproj/project.pbxproj b/Sources/allin/allin.xcodeproj/project.pbxproj index b083463..5975557 100644 --- a/Sources/allin/allin.xcodeproj/project.pbxproj +++ b/Sources/allin/allin.xcodeproj/project.pbxproj @@ -107,6 +107,7 @@ D98C4D622AB9D017007A6B4D /* AllIn */ = { isa = PBXGroup; children = ( + ECF816C72ABB51E300DE30A4 /* Extensions */, D92EC5782ABAC6B900CCD30E /* Views */, D98C4D632AB9D017007A6B4D /* AllInApp.swift */, D98C4D652AB9D017007A6B4D /* ContentView.swift */, @@ -141,6 +142,13 @@ path = AllInUITests; sourceTree = ""; }; + ECF816C72ABB51E300DE30A4 /* Extensions */ = { + isa = PBXGroup; + children = ( + ); + path = Extensions; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ diff --git a/Sources/allin/allin/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sources/allin/allin/Assets.xcassets/AppIcon.appiconset/Contents.json index 9419ed0..468851b 100644 --- a/Sources/allin/allin/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Sources/allin/allin/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Group 108.png", + "filename" : "Group 217.png", "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" diff --git a/Sources/allin/allin/Assets.xcassets/AppIcon.appiconset/Group 108.png b/Sources/allin/allin/Assets.xcassets/AppIcon.appiconset/Group 108.png deleted file mode 100644 index 94d56ef..0000000 Binary files a/Sources/allin/allin/Assets.xcassets/AppIcon.appiconset/Group 108.png and /dev/null differ diff --git a/Sources/allin/allin/Assets.xcassets/AppIcon.appiconset/Group 217.png b/Sources/allin/allin/Assets.xcassets/AppIcon.appiconset/Group 217.png new file mode 100644 index 0000000..d503a96 Binary files /dev/null and b/Sources/allin/allin/Assets.xcassets/AppIcon.appiconset/Group 217.png differ diff --git a/Sources/allin/allin/Assets.xcassets/DarkGray.colorset/Contents.json b/Sources/allin/allin/Assets.xcassets/DarkGray.colorset/Contents.json new file mode 100644 index 0000000..5414be4 --- /dev/null +++ b/Sources/allin/allin/Assets.xcassets/DarkGray.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.173", + "green" : "0.173", + "red" : "0.173" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x2C", + "green" : "0x2C", + "red" : "0x2C" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/allin/allin/Assets.xcassets/menu.imageset/Contents.json b/Sources/allin/allin/Assets.xcassets/menu.imageset/Contents.json new file mode 100644 index 0000000..10d2d54 --- /dev/null +++ b/Sources/allin/allin/Assets.xcassets/menu.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "Vector.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Vector-2.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/allin/allin/Assets.xcassets/menu.imageset/Vector-2.png b/Sources/allin/allin/Assets.xcassets/menu.imageset/Vector-2.png new file mode 100644 index 0000000..669b731 Binary files /dev/null and b/Sources/allin/allin/Assets.xcassets/menu.imageset/Vector-2.png differ diff --git a/Sources/allin/allin/Assets.xcassets/menu.imageset/Vector.png b/Sources/allin/allin/Assets.xcassets/menu.imageset/Vector.png new file mode 100644 index 0000000..384f876 Binary files /dev/null and b/Sources/allin/allin/Assets.xcassets/menu.imageset/Vector.png differ diff --git a/Sources/allin/allin/Extensions/UIColor.swift b/Sources/allin/allin/Extensions/UIColor.swift new file mode 100644 index 0000000..8089fff --- /dev/null +++ b/Sources/allin/allin/Extensions/UIColor.swift @@ -0,0 +1,28 @@ +// +// UIColor.swift +// AllIn +// +// Created by étudiant on 20/09/2023. +// + +import SwiftUI + +extension UIColor { + convenience init(hexString: String) { + let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted) + var int = UInt64() + Scanner(string: hex).scanHexInt64(&int) + let a, r, g, b: UInt64 + switch hex.count { + case 3: // RGB (12-bit) + (a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17) + case 6: // RGB (24-bit) + (a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF) + case 8: // ARGB (32-bit) + (a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF) + default: + (a, r, g, b) = (255, 0, 0, 0) + } + self.init(red: CGFloat(r) / 255, green: CGFloat(g) / 255, blue: CGFloat(b) / 255, alpha: CGFloat(a) / 255) + } +} diff --git a/Sources/allin/allin/Views/CoinCounterView.swift b/Sources/allin/allin/Views/CoinCounterView.swift index 6addeef..338ac3d 100644 --- a/Sources/allin/allin/Views/CoinCounterView.swift +++ b/Sources/allin/allin/Views/CoinCounterView.swift @@ -8,16 +8,19 @@ import SwiftUI struct CoinCounterView: View { + var body: some View { HStack(alignment: .center) { Image("AllCoinsIcon") .resizable() - .frame(width: 25, height: 25, alignment: .leading) - Text("541") .fontWeight(.black) + .frame(width: 17, height: 17, alignment: .leading) + Text("541") + .fontWeight(.black) + .foregroundColor(Color("DarkGray")) } - .padding(.all) + .frame(width: 90, height: 40) .background(Color.white) - .cornerRadius(9999) + .cornerRadius(999) } diff --git a/Sources/allin/allin/Views/TopBarView.swift b/Sources/allin/allin/Views/TopBarView.swift index 2358f14..0bb9ab9 100644 --- a/Sources/allin/allin/Views/TopBarView.swift +++ b/Sources/allin/allin/Views/TopBarView.swift @@ -15,14 +15,21 @@ struct TopBarView: View { GeometryReader { geometry in ZStack() { HStack(){ + Image("menu") + .resizable() + .frame(width: 26,height: 15) + .padding(.leading, 30) + Spacer() + CoinCounterView() } .frame(width: geometry.size.width,alignment: .trailing) + .padding(.trailing, 20) Image("Icon") .resizable() - .frame(width: 45, height: 45, alignment: .bottom) + .frame(width: 40, height: 40, alignment: .bottom) .padding(.all, 22) }