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
enum Theme {
static let primary = Color("Primary")
static let secondary = Color("Secondary")
static let tertiary = Color("Tertiary")
}
@main
struct ArkitDoushiQiApp: App {
@AppStorage("isDarkMode") private var isDarkMode = false
var body: some Scene {

@ -16,7 +16,7 @@
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
"value" : "light"
}
],
"color" : {
@ -29,6 +29,19 @@
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"platform" : "ios",
"reference" : "darkTextColor"
},
"idiom" : "universal"
}
],
"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)
.padding(EdgeInsets(top: 10, leading: 32, bottom: 10, trailing: 32))
.controlSize(.large)
.foregroundColor(.white)
.foregroundColor(Color(UIColor(named: "Primary") ?? .black))
}
.buttonBorderShape(.roundedRectangle)
.buttonStyle(.borderedProminent)
.tint(.black)
.tint(Color(UIColor(named: "Tertiary") ?? .white))
}
}

@ -44,7 +44,7 @@ struct accessCameraView: UIViewControllerRepresentable {
}
struct PhotoButtonComponent: View {
let Text : String
let Value : String
@State private var showCamera = false
@State private var selectedImage: UIImage?
@State var image: UIImage?
@ -56,7 +56,7 @@ struct PhotoButtonComponent: View {
.scaledToFit()
}
Button("Open camera") {
Button(Value) {
self.showCamera.toggle()
}
.fullScreenCover(isPresented: self.$showCamera) {
@ -68,6 +68,6 @@ struct PhotoButtonComponent: View {
struct PhotoButtonComponent_Previews: PreviewProvider {
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: {
HStack {
Text(title)
.foregroundColor(.black)
.padding()
Spacer()
Text(selectedOption.rawValue.description)
.foregroundColor(.black)
.padding()
}
.frame(maxWidth: .infinity)

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

Loading…
Cancel
Save