Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【FEAT】テーマカラーを設定する #80

Merged
merged 6 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "0.900"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.200",
"green" : "0.100",
"red" : "0.100"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
20 changes: 0 additions & 20 deletions PrimePickApp/ColorAssets.xcassets/appBlue.colorset/Contents.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "1.000",
"red" : "0.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "1.000",
"red" : "0.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.500",
"green" : "0.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.500",
"green" : "0.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
2 changes: 1 addition & 1 deletion PrimePickApp/View/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct MainView: View {
var body: some View {
NavigationStack {
ZStack {
Color("appBlue")
Color.appBackground
.ignoresSafeArea()

VStack {
Expand Down
33 changes: 21 additions & 12 deletions PrimePickApp/View/Quiz/QuizButtonView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ struct QuizButtonView: View {

ZStack {
RoundedRectangle(cornerRadius: 25)
.stroke(Color.pink, lineWidth: 5)
.background(RoundedRectangle(cornerRadius: 25).fill(Color.white))
.stroke(Color.quizIncorrectButton, lineWidth: 5)
.background(RoundedRectangle(cornerRadius: 25).fill(Color.quizIncorrectButton.opacity(0.1)))
.frame(width: UIScreen.main.bounds.width * 2 / 5, height: UIScreen.main.bounds.height / 4)
.shadow(radius: 10)

Expand All @@ -48,16 +48,7 @@ struct QuizButtonView: View {

Spacer()

ZStack {
RoundedRectangle(cornerRadius: 25)
.stroke(Color.cyan, lineWidth: 5)
.background(RoundedRectangle(cornerRadius: 25).fill(Color.white))
.frame(width: UIScreen.main.bounds.width * 2 / 5, height: UIScreen.main.bounds.height / 4)
.shadow(radius: 10)

Text("✅")
.font(.custom("ArialRoundedMTBold", size: 80))
}
quizButton(option: "Correct")
.onTapGesture {
print("✅")
if quizData[quizNumber].isCorrect {
Expand Down Expand Up @@ -88,3 +79,21 @@ struct QuizButtonView: View {
}
}
}

private func quizButton(option: String) -> some View {
ZStack {
RoundedRectangle(cornerRadius: 25)
.stroke(option == "Correct" ? Color.quizCorrectButton : Color.quizIncorrectButton, lineWidth: 5)
.background(RoundedRectangle(cornerRadius: 25).fill(option == "Correct" ? Color.quizCorrectButton.opacity(0.1) : Color.quizIncorrectButton.opacity(0.1)))
.frame(width: UIScreen.main.bounds.width * 2 / 5, height: UIScreen.main.bounds.height / 4)
.shadow(radius: 10)

if option == "Correct" {
Text("✅")
.font(.custom("ArialRoundedMTBold", size: 80))
} else {
Text("❌")
.font(.custom("ArialRoundedMTBold", size: 80))
}
}
}
2 changes: 1 addition & 1 deletion PrimePickApp/View/Quiz/QuizView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct QuizView: View {

var body: some View {
ZStack {
Color("appBlue")
Color.appBackground
.ignoresSafeArea()

VStack(spacing: .zero) {
Expand Down