Canvatorium Visio Lab 5010
Profile Cards with Placeholder Content.
Starting work on a reusable Profile Card, using placeholder content for now.
Lab code
struct Lab5010: View {
@State private var isClicked = false
var body: some View {
ProfilePlaceholderCard()
.frame(width: 400, height: 300)
.offset(z: 160)
}
}
Profile Placeholder Card
struct ProfilePlaceholderCard: View {
var body: some View {
VStack(alignment: .leading) {
// Header: image, name, title
HStack() {
Image(systemName: "person.fill")
.font(.largeTitle)
.frame(width: 60, height: 60)
.background(.regularMaterial, in: .rect(cornerRadius: 12))
VStack(alignment: .leading) {
Text("Lorem ipsum")
.font(.title)
.redacted(reason: .placeholder)
Text("consectetur")
.font(.subheadline)
.redacted(reason: .placeholder)
}
.padding(.leading, 12)
}
// Description / details
Text("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.")
.redacted(reason: .placeholder)
.padding(.top, 6)
Spacer()
// Footer: tags, additional info, etc.
HStack {
Text("#")
.font(.footnote)
Text("Lorem")
.font(.footnote)
.redacted(reason: .placeholder)
Text("Lorem")
.font(.footnote)
.redacted(reason: .placeholder)
Text("Lorem")
.font(.footnote)
.redacted(reason: .placeholder)
}
.padding(.top, 6)
}
.padding(12)
.glassBackgroundEffect(in: .rect)
.cornerRadius(12)
}
}