|
|
|
@ -8,57 +8,69 @@
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
|
|
struct MainMenuView: View {
|
|
|
|
|
|
|
|
|
|
@State private var showSplash = true
|
|
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
NavigationView {
|
|
|
|
|
VStack {
|
|
|
|
|
|
|
|
|
|
TitlePageFrame(Text: "DOU SHOU QI", ImageWidth: 200, ImageHeight: 200)
|
|
|
|
|
|
|
|
|
|
Spacer()
|
|
|
|
|
|
|
|
|
|
VStack {
|
|
|
|
|
HStack{
|
|
|
|
|
VStack(spacing: 25) {
|
|
|
|
|
MainMenuButton(text: "Play", destination: ScoreBoardView(), sound: "TitleScreenButtonSound", horizontalAlignment: .leading, topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
MainMenuButton(text: "Historique", destination: HistoricView(), sound: "TitleScreenButtonSound", horizontalAlignment: .leading, topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
MainMenuButton(text: "Best Scores", destination: ScoreBoardView(), sound: "TitleScreenButtonSound", horizontalAlignment: .leading, topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
MainMenuButton(text: "Players", destination: PlayersView(), sound: "TitleScreenButtonSound", horizontalAlignment: .leading, topRightCorner: 10, bottomRightCorner: 10)
|
|
|
|
|
if showSplash {
|
|
|
|
|
SplashScreenView()
|
|
|
|
|
.transition(.opacity)
|
|
|
|
|
.animation(.easeOut(duration: 3), value: showSplash)
|
|
|
|
|
.onAppear {
|
|
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 8) {
|
|
|
|
|
withAnimation {
|
|
|
|
|
showSplash = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Image(AppImages.SemiLion)
|
|
|
|
|
.resizable()
|
|
|
|
|
.aspectRatio(contentMode: .fit)
|
|
|
|
|
.frame(width: 200, height: 500)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Spacer()
|
|
|
|
|
HStack {
|
|
|
|
|
Text("Copyright @")
|
|
|
|
|
.font(.headline)
|
|
|
|
|
.frame(alignment: .trailing)
|
|
|
|
|
|
|
|
|
|
Text("Dou Shou Qi Team")
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
TitlePageFrame(Text: "DOU SHOU QI", ImageWidth: 200, ImageHeight: 200)
|
|
|
|
|
Spacer()
|
|
|
|
|
|
|
|
|
|
Text("2024")
|
|
|
|
|
.frame(alignment: .trailing)
|
|
|
|
|
}
|
|
|
|
|
.padding() // Ajout de padding pour éviter que le contenu ne touche la bordure
|
|
|
|
|
.background(Color.white) // Couleur de fond pour le HStack
|
|
|
|
|
.overlay(
|
|
|
|
|
Rectangle()
|
|
|
|
|
.stroke(Color.black, lineWidth: 1) // Couleur et épaisseur de la bordure
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Spacer()
|
|
|
|
|
.onAppear {
|
|
|
|
|
MusicPlayer.shared.playBackgroundMusic(music: "TitleScreenMusic")
|
|
|
|
|
VStack {
|
|
|
|
|
HStack {
|
|
|
|
|
VStack(spacing: 25) {
|
|
|
|
|
MainMenuButton(text: "Play", destination: ScoreBoardView(), sound: "TitleScreenButtonSound")
|
|
|
|
|
MainMenuButton(text: "Historique", destination: HistoricView(), sound: "TitleScreenButtonSound")
|
|
|
|
|
MainMenuButton(text: "Best Scores", destination: ScoreBoardView(), sound: "TitleScreenButtonSound")
|
|
|
|
|
MainMenuButton(text: "Players", destination: PlayersView(), sound: "TitleScreenButtonSound")
|
|
|
|
|
}
|
|
|
|
|
Image(AppImages.SemiLion)
|
|
|
|
|
.resizable()
|
|
|
|
|
.aspectRatio(contentMode: .fit)
|
|
|
|
|
.frame(width: 200, height: 500)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.onDisappear {
|
|
|
|
|
MusicPlayer.shared.stopBackgroundMusic()
|
|
|
|
|
Spacer()
|
|
|
|
|
HStack {
|
|
|
|
|
Text("Copyright @")
|
|
|
|
|
.font(.headline)
|
|
|
|
|
.frame(alignment: .trailing)
|
|
|
|
|
|
|
|
|
|
Text("Dou Shou Qi Team")
|
|
|
|
|
|
|
|
|
|
Spacer()
|
|
|
|
|
|
|
|
|
|
Text("2024")
|
|
|
|
|
.frame(alignment: .trailing)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.padding()
|
|
|
|
|
.background(Color.white)
|
|
|
|
|
.overlay(
|
|
|
|
|
Rectangle()
|
|
|
|
|
.stroke(Color.black, lineWidth: 1)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Spacer()
|
|
|
|
|
.onAppear {
|
|
|
|
|
MusicPlayer.shared.playBackgroundMusic(music: "TitleScreenMusic")
|
|
|
|
|
}
|
|
|
|
|
.onDisappear {
|
|
|
|
|
MusicPlayer.shared.stopBackgroundMusic()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|