Last active
October 24, 2023 03:35
-
-
Save jamestapping/171dfa9c32707d6fdc027f5311f51576 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
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
ScrollView { | |
VStack{ | |
CardViewItem() | |
} | |
.padding() | |
} | |
} | |
} | |
struct CardViewItem: View { | |
var body: some View { | |
ZStack { | |
RoundedRectangle(cornerRadius: 0) | |
.foregroundColor(.white) | |
HStack { | |
Image("blueWaves") | |
.resizable() | |
.scaledToFill() | |
.frame(width: 100, height: 100) | |
Text ("Constructive and destructive\nwaves") | |
.font(.custom("Inter-SemiBold", size: 16)) | |
.fontWeight(.semibold) | |
Spacer() | |
} | |
}.modifier(CardModifier()) | |
} | |
} | |
struct CardModifier: ViewModifier { | |
var cornerRadius:CGFloat = 12.0 | |
func body(content: Content) -> some View { | |
content | |
.cornerRadius(cornerRadius) | |
.shadow(color: Color.black.opacity(0.3), radius: 5, x: 0, y: 4) | |
} | |
} | |
#Preview { | |
ContentView() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment