stremio/apps/ios/VMC/UI/RootView.swift
Jos Vooges | STH 303383ea4e Add server URL choice, email login, and login lock controls.
Clients can use VMC or a custom server with email/password or device code; API locks after 3 failed logins with admin unlock.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-10 01:32:35 +02:00

49 lines
1.3 KiB
Swift

import SwiftUI
struct RootView: View {
@EnvironmentObject private var app: AppModel
var body: some View {
ZStack {
McColors.bg.ignoresSafeArea()
switch app.phase {
case .boot:
SplashView()
case .server:
ServerChoiceScreen()
case .auth:
AuthChoiceScreen()
case .password:
PasswordLoginScreen()
case .link:
LinkScreen()
case .profiles:
ProfilesScreen()
case .main:
MainShell()
}
}
.animation(.easeInOut(duration: 0.28), value: app.phase)
}
}
struct SplashView: View {
@State private var pulse = false
var body: some View {
VStack(spacing: 18) {
Text("VMC")
.font(McFonts.brand)
.foregroundStyle(McColors.accent)
.scaleEffect(pulse ? 1.04 : 0.96)
.shadow(color: McColors.accent.opacity(0.45), radius: pulse ? 24 : 8)
ProgressView()
.tint(McColors.textDim)
}
.onAppear {
withAnimation(.easeInOut(duration: 1.1).repeatForever(autoreverses: true)) {
pulse = true
}
}
}
}