Files
mobile-ios/Rosetta/Features/Splash/SplashView.swift
senseiGai 99a35302fa feat: Implement chat list and search functionality
- Added ChatListViewModel to manage chat list state and server search.
- Created ChatRowView for displaying individual chat rows.
- Developed SearchView and SearchViewModel for user search functionality.
- Introduced MainTabView for tab-based navigation between chats and settings.
- Implemented OnboardingPager for onboarding experience.
- Created SettingsView and SettingsViewModel for user settings management.
- Added SplashView for initial app launch experience.
2026-02-25 21:27:41 +05:00

58 lines
1.7 KiB
Swift

import SwiftUI
struct SplashView: View {
let onSplashComplete: () -> Void
@State private var logoScale: CGFloat = 0.3
@State private var logoOpacity: Double = 0
@State private var glowScale: CGFloat = 0.3
@State private var glowPulsing = false
var body: some View {
ZStack {
RosettaColors.Adaptive.background
.ignoresSafeArea()
ZStack {
// Glow behind logo
Circle()
.fill(Color(hex: 0x54A9EB).opacity(0.2))
.frame(width: 180, height: 180)
.scaleEffect(glowScale * (glowPulsing ? 1.1 : 1.0))
.opacity(logoOpacity)
// Logo
Image("RosettaIcon")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 150, height: 150)
.clipShape(Circle())
.scaleEffect(logoScale)
.opacity(logoOpacity)
}
}
.task {
try? await Task.sleep(for: .milliseconds(100))
withAnimation(.easeOut(duration: 0.6)) {
logoOpacity = 1
}
withAnimation(.spring(response: 0.6, dampingFraction: 0.6)) {
logoScale = 1
glowScale = 1
}
withAnimation(.easeInOut(duration: 0.8).repeatForever(autoreverses: true)) {
glowPulsing = true
}
try? await Task.sleep(for: .seconds(2))
onSplashComplete()
}
.accessibilityLabel("Rosetta")
}
}
#Preview {
SplashView(onSplashComplete: {})
}