Skip to content

Instantly share code, notes, and snippets.

@karthironald
Created June 12, 2020 16:44
Show Gist options
  • Save karthironald/2d27309097b5c826b4211d9bb8fd47ee to your computer and use it in GitHub Desktop.
Save karthironald/2d27309097b5c826b4211d9bb8fd47ee to your computer and use it in GitHub Desktop.
import SwiftUI
struct ContentView: View {
var cornerRadius: CGFloat = 20
var body: some View {
VStack {
ZStack {
RoundedRectangle(cornerRadius: cornerRadius)
.fill(Color("kMainBg"))
.frame(width: 150, height: 150)
RoundedRectangle(cornerRadius: cornerRadius)
.fill(Color("kMainBg"))
.frame(width: 135, height: 135)
.blur(radius: 15)
.opacity(0.7)
.shadow(color: Color("kDarkShadow"), radius: 5, x: -10, y: -10)
RoundedRectangle(cornerRadius: cornerRadius)
.fill(Color("kMainBg"))
.frame(width: 135, height: 135)
.blur(radius: 15)
.opacity(0.7)
.shadow(color: Color("kLightShadow"), radius: 5, x: 10, y: 10)
.overlay(
Image(systemName: "3.circle.fill")
.resizable()
.frame(width: 40, height: 40)
.aspectRatio(contentMode: .fit)
.foregroundColor(.pink)
)
}
.mask(
RoundedRectangle(cornerRadius: cornerRadius)
)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color("kMainBg"))
.edgesIgnoringSafeArea(.all)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment