forked from GetStream/stream-chat-swiftui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLaunchScreen.swift
46 lines (43 loc) · 1.55 KB
/
LaunchScreen.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// Copyright © 2024 Stream.io Inc. All rights reserved.
//
import SwiftUI
struct StreamLogoLaunch: View {
@State private var move = false
let streamBlue = Color(#colorLiteral(red: 0, green: 0.368627451, blue: 1, alpha: 1))
@State private var swinging = false
var body: some View {
ZStack {
streamBlue
.opacity(0.25)
.ignoresSafeArea()
ZStack {
Image("STREAMMARK")
.scaleEffect(0.6)
.rotationEffect(
.degrees(swinging ? -10 : 10),
anchor: swinging ? .bottomLeading : .bottomTrailing
)
.offset(y: -15)
.animation(.easeInOut(duration: 1).repeatCount(14, autoreverses: true), value: swinging)
VStack(spacing: -46) {
Image("stream_wave")
.offset(y: 20)
.offset(x: move ? -160 : 160)
.animation(.linear(duration: 14), value: move)
Image("stream_wave")
.offset(y: 10)
.offset(x: move ? -150 : 150)
.animation(.linear(duration: 14), value: move)
.onAppear {
move.toggle()
swinging.toggle()
}
}
.mask(Image("wave_top"))
}
// Change size here
.scaleEffect(2)
}
}
}