make the topbar perfectly

Menu
lucas delanier 2 years ago
parent 5f5ed3e41a
commit 92c80b9e24

@ -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 = "<group>";
};
ECF816C72ABB51E300DE30A4 /* Extensions */ = {
isa = PBXGroup;
children = (
);
path = Extensions;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Group 108.png",
"filename" : "Group 217.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 KiB

@ -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
}
}

@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

@ -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)
}
}

@ -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)
}

@ -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)
}

Loading…
Cancel
Save