diff --git a/Outspire/OutspireApp.swift b/Outspire/OutspireApp.swift index 71e4a94..ca6ef84 100644 --- a/Outspire/OutspireApp.swift +++ b/Outspire/OutspireApp.swift @@ -42,7 +42,7 @@ struct OutspireApp: App { var body: some Scene { WindowGroup { - RootTabView() + SplashView() // <--- Updated: Set SplashView as the initial entry point .tint(AppColor.brand) .environmentObject(regionChecker) .environmentObject(notificationManager) diff --git a/Outspire/SplashView.swift b/Outspire/SplashView.swift new file mode 100644 index 0000000..5924a6d --- /dev/null +++ b/Outspire/SplashView.swift @@ -0,0 +1,44 @@ +import SwiftUI + +struct SplashView: View { + @State private var isActive = false + @State private var opacity = 0.0 + + var body: some View { + if isActive { + RootTabView() + } else { + VStack(spacing: 16) { + Text("Outspire") + .font(.system(size: 52, weight: .bold, design: .rounded)) + .foregroundColor(.primary) + + Text("All-in-one Campus App for WFLA") + .font(.system(size: 18, weight: .medium)) + .foregroundColor(.secondary) + .multilineTextAlignment(.center) + .padding(.horizontal, 32) + } + .opacity(opacity) + .frame(maxWidth: .infinity, maxHeight: .infinity) + .background(Color(UIColor.systemBackground)) + .onAppear { + withAnimation(.easeIn(duration: 1.0)) { + opacity = 1.0 + } + + DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) { + withAnimation { + isActive = true + } + } + } + } + } +} + +struct SplashView_Previews: PreviewProvider { + static var previews: some View { + SplashView() + } +}