Skip to content

Instantly share code, notes, and snippets.

@SarahAlsharif
Last active February 1, 2022 12:18
Show Gist options
  • Save SarahAlsharif/addcaf32ef860ecb318fd28b37c17131 to your computer and use it in GitHub Desktop.
Save SarahAlsharif/addcaf32ef860ecb318fd28b37c17131 to your computer and use it in GitHub Desktop.
struct DeepConcaveView : View {
let cornerRadius : CGFloat
var body: some View {
ZStack {
RoundedRectangle(cornerRadius: cornerRadius)
.fill(Color(Colors.mainColor))
RoundedRectangle(cornerRadius: cornerRadius)
.stroke(Color(Colors.darkShadow), lineWidth: 2)
.blur(radius: 0.5)
.offset(x: 1, y: 1)
.mask(RoundedRectangle(cornerRadius: cornerRadius).fill(LinearGradient(colors:[Color(Colors.darkShadow), Color.clear], startPoint: .top, endPoint: .bottom)))
RoundedRectangle(cornerRadius: cornerRadius)
.stroke(Color(Colors.darkShadow), lineWidth: 6)
.blur(radius: 3)
.offset(x: 3, y: 3)
.mask(RoundedRectangle(cornerRadius: cornerRadius).fill(LinearGradient(colors: [Color(Colors.darkShadow), Color.clear], startPoint: .top, endPoint: .bottom)))
RoundedRectangle(cornerRadius: cornerRadius)
.stroke(Color(Colors.lightShadow), lineWidth: 2)
.blur(radius: 0.5)
.offset(x: -1, y: -1)
.mask(RoundedRectangle(cornerRadius: cornerRadius).fill(LinearGradient(colors: [Color.clear, Color(Colors.lightShadow)], startPoint: .top, endPoint: .bottom)))
RoundedRectangle(cornerRadius: cornerRadius)
.stroke(Color(Colors.lightShadow), lineWidth: 6)
.blur(radius: 3)
.offset(x: -3, y: -3)
.mask(RoundedRectangle(cornerRadius: cornerRadius).fill(LinearGradient(colors: [Color.clear, Color(Colors.lightShadow)], startPoint: .top, endPoint: .bottom)))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment