Add colors(GameparametersMenuView): still needs to implement them

everywhere
pull/17/head
Johan LACHENAL 11 months ago
parent 08e1b83027
commit 586d7396a5

@ -7,7 +7,14 @@
import SwiftUI import SwiftUI
enum Theme {
static let primary = Color("Primary")
static let secondary = Color("Secondary")
static let tertiary = Color("Tertiary")
}
@main @main
struct ArkitDoushiQiApp: App { struct ArkitDoushiQiApp: App {
@AppStorage("isDarkMode") private var isDarkMode = false @AppStorage("isDarkMode") private var isDarkMode = false
var body: some Scene { var body: some Scene {

@ -16,7 +16,7 @@
"appearances" : [ "appearances" : [
{ {
"appearance" : "luminosity", "appearance" : "luminosity",
"value" : "dark" "value" : "light"
} }
], ],
"color" : { "color" : {
@ -29,6 +29,19 @@
} }
}, },
"idiom" : "universal" "idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"platform" : "ios",
"reference" : "darkTextColor"
},
"idiom" : "universal"
} }
], ],
"info" : { "info" : {

@ -0,0 +1,56 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "light"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -0,0 +1,56 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "light"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -0,0 +1,51 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "light"
}
],
"color" : {
"platform" : "ios",
"reference" : "darkTextColor"
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -25,11 +25,11 @@ struct ButtonComponent<Content : View>: View {
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32)) .padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
.controlSize(.large) .controlSize(.large)
.foregroundColor(.white) .foregroundColor(Color(UIColor(named: "Primary") ?? .black))
} }
.buttonBorderShape(.roundedRectangle) .buttonBorderShape(.roundedRectangle)
.buttonStyle(.borderedProminent) .buttonStyle(.borderedProminent)
.tint(.black) .tint(Color(UIColor(named: "Tertiary") ?? .white))
} }
} }

@ -44,7 +44,7 @@ struct accessCameraView: UIViewControllerRepresentable {
} }
struct PhotoButtonComponent: View { struct PhotoButtonComponent: View {
let Text : String let Value : String
@State private var showCamera = false @State private var showCamera = false
@State private var selectedImage: UIImage? @State private var selectedImage: UIImage?
@State var image: UIImage? @State var image: UIImage?
@ -56,7 +56,7 @@ struct PhotoButtonComponent: View {
.scaledToFit() .scaledToFit()
} }
Button("Open camera") { Button(Value) {
self.showCamera.toggle() self.showCamera.toggle()
} }
.fullScreenCover(isPresented: self.$showCamera) { .fullScreenCover(isPresented: self.$showCamera) {
@ -68,6 +68,6 @@ struct PhotoButtonComponent: View {
struct PhotoButtonComponent_Previews: PreviewProvider { struct PhotoButtonComponent_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
PhotoButtonComponent(Text : "Prendre Photo") PhotoButtonComponent(Value : "Prendre Photo")
} }
} }

@ -33,11 +33,9 @@ struct PickerComponent<EnumType: RawRepresentable & Identifiable & Hashable>: Vi
} label: { } label: {
HStack { HStack {
Text(title) Text(title)
.foregroundColor(.black)
.padding() .padding()
Spacer() Spacer()
Text(selectedOption.rawValue.description) Text(selectedOption.rawValue.description)
.foregroundColor(.black)
.padding() .padding()
} }
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)

@ -41,8 +41,9 @@ struct GameParametersMenuView: View {
EditComponent(explanation: "Nom du joueur 2",value: "Joueur 2") EditComponent(explanation: "Nom du joueur 2",value: "Joueur 2")
ButtonComponent(title: "Lancer la partie") { ButtonComponent(title: "Lancer la partie") {
GameView() GameView()
} }.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
}.frame(maxHeight: .infinity, alignment: .top) }
.frame(maxHeight: .infinity, alignment: .top)
} }
} }

Loading…
Cancel
Save