You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.8 KiB

import SwiftUI
struct LaunchScreenView: View {
@State private var isAnimating = false
var body: some View {
ZStack {
//
LinearGradient(
gradient: Gradient(colors: [
Color(red: 0.1, green: 0.2, blue: 0.4),
Color(red: 0.2, green: 0.3, blue: 0.6)
]),
startPoint: .topLeading,
endPoint: .bottomTrailing
)
.ignoresSafeArea()
VStack(spacing: 30) {
//
ZStack {
Circle()
.fill(Color.white.opacity(0.2))
.frame(width: 120, height: 120)
.scaleEffect(isAnimating ? 1.1 : 1.0)
.animation(.easeInOut(duration: 2.0).repeatForever(autoreverses: true), value: isAnimating)
// QR
Image(systemName: "qrcode")
.font(.system(size: 60, weight: .light))
.foregroundColor(.white)
.rotationEffect(.degrees(isAnimating ? 360 : 0))
.animation(.linear(duration: 3.0).repeatForever(autoreverses: false), value: isAnimating)
}
//
VStack(spacing: 8) {
Text("MyQrCode")
.font(.system(size: 32, weight: .bold, design: .rounded))
.foregroundColor(.white)
Text("QR Code Scanner & Generator")
.font(.system(size: 16, weight: .medium))
.foregroundColor(.white.opacity(0.8))
}
.opacity(isAnimating ? 1.0 : 0.0)
.animation(.easeIn(duration: 1.0).delay(0.5), value: isAnimating)
//
HStack(spacing: 8) {
ForEach(0..<3) { index in
Circle()
.fill(Color.white)
.frame(width: 8, height: 8)
.scaleEffect(isAnimating ? 1.2 : 0.8)
.animation(
.easeInOut(duration: 0.6)
.repeatForever(autoreverses: true)
.delay(Double(index) * 0.2),
value: isAnimating
)
}
}
.opacity(isAnimating ? 1.0 : 0.0)
.animation(.easeIn(duration: 1.0).delay(1.0), value: isAnimating)
}
}
.onAppear {
isAnimating = true
}
}
}
#Preview {
LaunchScreenView()
}