42 lines
1.2 KiB
Swift
42 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
struct SplashView: View {
|
|
@State private var isAnimating = false
|
|
@State private var showLogin = false
|
|
@EnvironmentObject private var authState: AuthState
|
|
|
|
var body: some View {
|
|
NavigationView {
|
|
ZStack {
|
|
// 背景渐变
|
|
LinearGradient(
|
|
gradient: Gradient(colors: [
|
|
Theme.Colors.primary, // Primary color with some transparency
|
|
Theme.Colors.primaryDark, // Darker shade of the primary color
|
|
]),
|
|
startPoint: .topLeading,
|
|
endPoint: .bottomTrailing
|
|
)
|
|
.edgesIgnoringSafeArea(.all)
|
|
VStack(spacing: 50) {
|
|
// FilmAnimation()
|
|
}
|
|
.padding()
|
|
}
|
|
.onAppear {
|
|
isAnimating = true
|
|
}
|
|
}
|
|
.navigationViewStyle(StackNavigationViewStyle())
|
|
}
|
|
}
|
|
|
|
// 预览
|
|
#if DEBUG
|
|
struct SplashView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
SplashView()
|
|
.environmentObject(AuthState.shared)
|
|
}
|
|
}
|
|
#endif |