Bubble/Threaded/Components/ComingSoonView.swift

41 lines
963 B
Swift
Raw Normal View History

//Made by Lumaa
import SwiftUI
struct ComingSoonView: View {
2024-03-23 09:48:29 +01:00
init() {}
@State private var spin: CGFloat = 0
var body: some View {
VStack(spacing: 5) {
Text(String("👀"))
.font(.system(size: 62))
2024-03-23 09:48:29 +01:00
.padding()
.background(Color.gray.opacity(0.3))
.clipShape(Circle())
.tapToSpin(spin: $spin)
Text("coming-soon")
.font(.title.bold())
}
}
}
2024-03-23 09:48:29 +01:00
extension View {
func tapToSpin(spin: Binding<CGFloat>, defaultValue: CGFloat = 0) -> some View {
self
.rotation3DEffect(.degrees(spin.wrappedValue), axis: (x: 0, y: 1, z: 0))
.onTapGesture {
withAnimation(.spring.speed(0.8)) {
spin.wrappedValue = 360
}
spin.wrappedValue = defaultValue
}
}
}
#Preview {
ComingSoonView()
}