generated from shilokuma-inc/template-app-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from shilokuma-inc/release/1.1.2
【Release】v1.1.1
- Loading branch information
Showing
11 changed files
with
229 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
PrimePickApp/QuizData/PrimeQuizEntity.swift → PrimePickApp/QuizData/QuizEntity.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// QuizContentView.swift | ||
// PrimePickApp | ||
// | ||
// Created by 村石 拓海 on 2024/05/31. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct QuizContentView: View { | ||
@Binding var quizNumber: Int | ||
let difficulty: Difficulty | ||
let quizData: [QuizEntity] | ||
|
||
var body: some View { | ||
GeometryReader { geometry in | ||
ZStack(alignment: .leading) { | ||
switch difficulty { | ||
case .easy: | ||
Color("appGreen") | ||
.opacity(0.5) | ||
.edgesIgnoringSafeArea(.all) | ||
case .normal: | ||
Color.blue | ||
.opacity(0.5) | ||
.edgesIgnoringSafeArea(.all) | ||
case .hard: | ||
Color.red | ||
.opacity(0.5) | ||
.edgesIgnoringSafeArea(.all) | ||
} | ||
|
||
VStack(spacing: .zero) { | ||
QuizIndexView(difficulty: difficulty, quizNumber: $quizNumber) | ||
.frame(height: geometry.size.height / 6) | ||
|
||
QuizNumberView( | ||
quizNumber: $quizNumber, | ||
difficulty: difficulty, | ||
quizData: quizData | ||
) | ||
.frame(height: geometry.size.height * 2 / 3) | ||
|
||
QuizTimeLimitView(difficulty: difficulty) | ||
.frame(height: geometry.size.height / 6) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
struct QuizContentView_Previews: PreviewProvider { | ||
@State static var quizNumber = 0 | ||
|
||
static var previews: some View { | ||
QuizContentView( | ||
quizNumber: $quizNumber, | ||
difficulty: .easy, | ||
quizData: [QuizEntity(quizId: 0, number: 3, isCorrect: true)] | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// QuizIndexView.swift | ||
// PrimePickApp | ||
// | ||
// Created by 村石 拓海 on 2024/05/22. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct QuizIndexView: View { | ||
let difficulty: Difficulty | ||
@Binding var quizNumber: Int | ||
|
||
var body: some View { | ||
Text("No.\(quizNumber + 1)") | ||
.font(.custom("ArialRoundedMTBold", size: 45)) | ||
.foregroundStyle(Color.gray) | ||
.padding(.horizontal, 16) | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// | ||
// QuizNumberView.swift | ||
// PrimePickApp | ||
// | ||
// Created by 村石 拓海 on 2024/05/17. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct QuizNumberView: View { | ||
@Binding var quizNumber: Int | ||
let difficulty: Difficulty | ||
let quizData: [QuizEntity] | ||
|
||
var body: some View { | ||
ZStack { | ||
quizNumberBackgroundView(difficulty: difficulty) | ||
|
||
quizNumberText( | ||
quizNumber: quizNumber, | ||
difficulty: difficulty, | ||
quizData: quizData | ||
) | ||
} | ||
} | ||
} | ||
|
||
private func quizNumberBackgroundView(difficulty: Difficulty) -> some View { | ||
let color = if difficulty == .easy { | ||
Color.appGreen | ||
} else if difficulty == .normal { | ||
Color.blue | ||
} else { | ||
Color.red | ||
} | ||
|
||
return RoundedRectangle(cornerRadius: 25) | ||
.stroke(color, lineWidth: 5) | ||
.frame(width: 300, height: 200) | ||
.shadow(radius: 10) | ||
.background( | ||
RoundedRectangle(cornerRadius: 25).fill(Color.white) | ||
) | ||
} | ||
|
||
private func quizNumberText(quizNumber: Int, difficulty: Difficulty, quizData: [QuizEntity]) -> some View { | ||
let size: CGFloat = if difficulty == .easy { | ||
180 | ||
} else { | ||
120 | ||
} | ||
|
||
return Text(quizData[quizNumber].number.description) | ||
.font(.custom("ArialRoundedMTBold", size: size)) | ||
.foregroundStyle(Color.gray) | ||
} | ||
|
||
struct QuizNumberView_Previews: PreviewProvider { | ||
@State static var quizNumber = 3 | ||
|
||
static var previews: some View { | ||
QuizNumberView( | ||
quizNumber: $quizNumber, | ||
difficulty: .easy, | ||
quizData: [QuizEntity(quizId: 0, number: 3, isCorrect: true)] | ||
) | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.