Skip to content

Commit ed9dbfa

Browse files
authored
Merge pull request #20 from hironaka-iori/main
UI UPDATE: Add `SplashView.swift`
2 parents b3a281c + d6dae54 commit ed9dbfa

2 files changed

Lines changed: 45 additions & 1 deletion

File tree

Outspire/OutspireApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct OutspireApp: App {
4242

4343
var body: some Scene {
4444
WindowGroup {
45-
RootTabView()
45+
SplashView() // <--- Updated: Set SplashView as the initial entry point
4646
.tint(AppColor.brand)
4747
.environmentObject(regionChecker)
4848
.environmentObject(notificationManager)

Outspire/SplashView.swift

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import SwiftUI
2+
3+
struct SplashView: View {
4+
@State private var isActive = false
5+
@State private var opacity = 0.0
6+
7+
var body: some View {
8+
if isActive {
9+
RootTabView()
10+
} else {
11+
VStack(spacing: 16) {
12+
Text("Outspire")
13+
.font(.system(size: 52, weight: .bold, design: .rounded))
14+
.foregroundColor(.primary)
15+
16+
Text("All-in-one Campus App for WFLA")
17+
.font(.system(size: 18, weight: .medium))
18+
.foregroundColor(.secondary)
19+
.multilineTextAlignment(.center)
20+
.padding(.horizontal, 32)
21+
}
22+
.opacity(opacity)
23+
.frame(maxWidth: .infinity, maxHeight: .infinity)
24+
.background(Color(UIColor.systemBackground))
25+
.onAppear {
26+
withAnimation(.easeIn(duration: 1.0)) {
27+
opacity = 1.0
28+
}
29+
30+
DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) {
31+
withAnimation {
32+
isActive = true
33+
}
34+
}
35+
}
36+
}
37+
}
38+
}
39+
40+
struct SplashView_Previews: PreviewProvider {
41+
static var previews: some View {
42+
SplashView()
43+
}
44+
}

0 commit comments

Comments
 (0)