Created
March 7, 2020 21:02
-
-
Save filimo/393c544de1169c9c41d2d78ed775ae3c to your computer and use it in GitHub Desktop.
This file contains 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
extension Color { | |
static let offWhite = Color(red: 225 / 255, green: 225 / 255, blue: 235 / 255) | |
} | |
struct SimpleButtonStyle: ButtonStyle { | |
func makeBody(configuration: Self.Configuration) -> some View { | |
configuration.label | |
.padding(30) | |
.background( | |
RoundedRectangle(cornerRadius: 20) | |
.fill(Color.offWhite) | |
.shadow(color: Color.black.opacity(0.2), radius: 10, x: 10, y: 10) | |
.shadow(color: Color.white.opacity(0.7), radius: 10, x: -5, y: -5) | |
) | |
} | |
} | |
struct Neomorphic2Demo: View { | |
var body: some View { | |
ZStack { | |
Color.offWhite | |
Button(action: { | |
print("Button tapped") | |
}) { | |
Text("Tap") | |
.foregroundColor(.gray) | |
} | |
.buttonStyle(SimpleButtonStyle()) | |
} | |
.edgesIgnoringSafeArea(.all) | |
} | |
} |
Author
filimo
commented
Mar 7, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment