Skip to content

Instantly share code, notes, and snippets.

@pMalvasio
Last active August 12, 2020 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pMalvasio/12952b393bdb6e207104d3d7448e8ba4 to your computer and use it in GitHub Desktop.
Save pMalvasio/12952b393bdb6e207104d3d7448e8ba4 to your computer and use it in GitHub Desktop.
var body: some View {
ZStack {
Color.black.opacity(0.8)
.edgesIgnoringSafeArea(.all)
.blur(radius: 200)
ZStack {
Color.gray.opacity(0.5)
Circle()
.trim(from: 0.2, to: 1)
.stroke(
Color.white,
style: StrokeStyle(
lineWidth: 5,
lineCap: .round
)
)
.frame(width: width, height: height)
.shadow(color: Color.black.opacity(0.1), radius: 3, x: 0, y: 3)
.rotationEffect(.degrees(isAnimating ? 360 : 0))
.animation(
Animation.linear(duration: 1)
.repeatForever(autoreverses: false)
)
}
.frame(width: 80, height: 80)
.background(Color.white)
.cornerRadius(30)
.shadow(color: Color.white.opacity(0.3), radius: 5, x: 0, y: 5)
.shadow(color: Color.black.opacity(0.1), radius: 2, x: 0, y: 2)
.onAppear {
self.isAnimating = true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment