Skip to content

Commit

Permalink
[feat] 難易度ごとに背景色を変えました
Browse files Browse the repository at this point in the history
  • Loading branch information
mrs1669 committed May 22, 2024
1 parent 5a4168d commit c868550
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 12 additions & 0 deletions PrimePickApp/QuizTimeLimitView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ import SwiftUI

struct QuizTimeLimitView: View {
let difficulty: String
var borderColor: Color {
switch difficulty {
case "Easy":
return Color.green // Color.appGreen の代わりに Color.green を使っています
case "Normal":
return Color.blue
default:
return Color.red
}
}

@State private var progress: Double = 0.01

var body: some View {
Expand Down Expand Up @@ -65,6 +76,7 @@ struct QuizTimeLimitView: View {
.padding()

}
.border(borderColor, width: 5.0)
}
}

Expand Down
1 change: 0 additions & 1 deletion PrimePickApp/QuizView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ struct QuizView: View {

QuizTimeLimitView(difficulty: difficulty)
.frame(height: UIScreen.main.bounds.height / 12)
.border(Color.appGreen, width: 5.0)

Spacer()

Expand Down

0 comments on commit c868550

Please sign in to comment.