Merge pull request 'dev_views' (#9) from dev_views into dev_views_Players
Reviewed-on: #9pull/10/head
commit
36a55cedda
@ -1,5 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict/>
|
<dict>
|
||||||
|
<key>UIAppFonts</key>
|
||||||
|
<array>
|
||||||
|
<string>samurai.ttf</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
Binary file not shown.
@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// Fonts.swift
|
||||||
|
// DouShouQi_App
|
||||||
|
//
|
||||||
|
// Created by Rémi REGNAULT on 27/05/2024.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
public struct Fonts {
|
||||||
|
static let title = "samurai"
|
||||||
|
}
|
Binary file not shown.
@ -1,69 +0,0 @@
|
|||||||
//
|
|
||||||
// MainMenuView.swift
|
|
||||||
// DouShouQi_App
|
|
||||||
//
|
|
||||||
// Created by Rémi REGNAULT on 16/05/2024.
|
|
||||||
//
|
|
||||||
|
|
||||||
import SwiftUI
|
|
||||||
|
|
||||||
struct MainMenuView: View {
|
|
||||||
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")
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Spacer()
|
|
||||||
HStack {
|
|
||||||
Text("Copyright @")
|
|
||||||
.font(.headline)
|
|
||||||
.frame(alignment: .trailing)
|
|
||||||
|
|
||||||
Text("Dou Shou Qi Team")
|
|
||||||
|
|
||||||
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")
|
|
||||||
}
|
|
||||||
.onDisappear {
|
|
||||||
MusicPlayer.shared.stopBackgroundMusic()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct MainMenuView_Previews: PreviewProvider {
|
|
||||||
static var previews: some View {
|
|
||||||
MainMenuView()
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,83 @@
|
|||||||
|
//
|
||||||
|
// MainMenuView.swift
|
||||||
|
// DouShouQi_App
|
||||||
|
//
|
||||||
|
// Created by Rémi REGNAULT on 16/05/2024.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct MainMenuView: View {
|
||||||
|
|
||||||
|
@State private var showSplash = true
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
NavigationView {
|
||||||
|
VStack {
|
||||||
|
if showSplash {
|
||||||
|
SplashScreenView()
|
||||||
|
.transition(.opacity)
|
||||||
|
.animation(.easeOut(duration: 3), value: showSplash)
|
||||||
|
.onAppear {
|
||||||
|
DispatchQueue.main.asyncAfter(deadline: .now() + 8) {
|
||||||
|
withAnimation {
|
||||||
|
showSplash = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
TitlePageFrame(Text: "DOU SHOU QI", ImageWidth: 200, ImageHeight: 200)
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct MainMenuView_Previews: PreviewProvider {
|
||||||
|
static var previews: some View {
|
||||||
|
MainMenuView()
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
//
|
||||||
|
// SplashScreenView.swift
|
||||||
|
// DouShouQi_App
|
||||||
|
//
|
||||||
|
// Created by étudiant on 27/05/2024.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct SplashScreenView: View {
|
||||||
|
var body: some View {
|
||||||
|
TitlePageFrame(Text: "DOU SHOU QI", ImageWidth: 200, ImageHeight: 200)
|
||||||
|
.onAppear {
|
||||||
|
playSound(named: "SplashScreenSound")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SplashScreenView_Previews: PreviewProvider {
|
||||||
|
static var previews: some View {
|
||||||
|
SplashScreenView()
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue