Skip to content

Instantly share code, notes, and snippets.

@jamestapping
Last active October 24, 2023 03:35
Show Gist options
  • Save jamestapping/171dfa9c32707d6fdc027f5311f51576 to your computer and use it in GitHub Desktop.
Save jamestapping/171dfa9c32707d6fdc027f5311f51576 to your computer and use it in GitHub Desktop.
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