Skip to content

Instantly share code, notes, and snippets.

@navsing
Created January 6, 2023 19:07
Show Gist options
  • Save navsing/6736d2fcb2890679d6c93c9d1da55ecb to your computer and use it in GitHub Desktop.
Save navsing/6736d2fcb2890679d6c93c9d1da55ecb to your computer and use it in GitHub Desktop.
ZStack {
Color("bg").edgesIgnoringSafeArea(.all) //give the entire app the same background as the component's background
RoundedRectangle(cornerRadius: 20)
.fill(Color("bg")) //same background as the app
.frame(width: 280, height: 280)
.shadow(color: Color("dark"), radius: 5, x: -10, y: -10) //shadow left and top
.shadow(color: Color("light"), radius: 5, x: 10, y: 10).padding(.top, 32) //shadow right and bottom
.blur(radius: 5) //to show smooth transition
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment