Last active
February 1, 2022 12:19
-
-
Save SarahAlsharif/990cd0d4bfa8b15652cda38dc4c20d8c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ShallowConcaveView : 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: 0.5) | |
.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.5) | |
.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