diff --git a/Threaded/Components/ComingSoonView.swift b/Threaded/Components/ComingSoonView.swift index ff1e7e3..0165869 100644 --- a/Threaded/Components/ComingSoonView.swift +++ b/Threaded/Components/ComingSoonView.swift @@ -3,19 +3,18 @@ import SwiftUI struct ComingSoonView: View { + init() {} + @State private var spin: CGFloat = 0 var body: some View { VStack(spacing: 5) { Text(String("👀")) .font(.system(size: 62)) - .rotation3DEffect(.degrees(spin), axis: (x: 0, y: 1, z: 0)) - .onTapGesture { - withAnimation(.spring.speed(0.8)) { - spin = 360 - } - spin = 0 - } + .padding() + .background(Color.gray.opacity(0.3)) + .clipShape(Circle()) + .tapToSpin(spin: $spin) Text("coming-soon") .font(.title.bold()) @@ -23,6 +22,19 @@ struct ComingSoonView: View { } } +extension View { + func tapToSpin(spin: Binding, 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() } diff --git a/Threaded/Views/Settings/RestrictedView.swift b/Threaded/Views/Settings/RestrictedView.swift new file mode 100644 index 0000000..b866288 --- /dev/null +++ b/Threaded/Views/Settings/RestrictedView.swift @@ -0,0 +1,13 @@ +//Made by Lumaa + +import SwiftUI + +struct RestrictedView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +#Preview { + RestrictedView() +}