First version

This commit is contained in:
Christoph Hagen
2023-08-18 22:47:24 +02:00
parent 1d6e36e2de
commit bd87a4fb6f
48 changed files with 1453 additions and 30 deletions

View File

@@ -0,0 +1,53 @@
import SwiftUI
import SFSafeSymbols
struct CareerStationView: View {
let info: CareerStation
let borderSpacing: CGFloat
let borderWidth: CGFloat
var body: some View {
LeftBorderView(color: .accentColor, spacing: borderSpacing, borderWidth: borderWidth) {
VStack(alignment: .leading) {
HStack {
RightImageLabel(info.time, systemSymbol: .calendar)
.padding(.leading, -4)
Spacer()
RightImageLabel(info.location, systemSymbol: .pin)
}
.font(.caption)
.foregroundColor(.secondary)
Text(info.title)
.font(.headline)
.fontWeight(.regular)
if let subtitle = info.subtitle {
Text(subtitle)
.font(.subheadline)
.foregroundColor(.accentColor)
}
if let text = info.text {
Text(text)
.font(.caption)
.foregroundColor(.secondary)
}
}
}
}
}
struct CareerStationView_Previews: PreviewProvider {
static var previews: some View {
CareerStationView(info: .init(
time: "Jul 2020 - Jul 2023",
location: "Braunschweig, Germany",
title: "German Aerospace Center",
subtitle: "Systems engineer",
text: "Responsible for aircraft systems and avionics of a high-altitude solar drone, safety, and software."),
borderSpacing: 5,
borderWidth: 3)
.previewLayout(.fixed(width: 300, height: 100))
}
}

View File

@@ -0,0 +1,33 @@
import SwiftUI
struct PublicationView: View {
let info: Publication
let borderSpacing: CGFloat
let borderWidth: CGFloat
var body: some View {
LeftBorderView(color: .accentColor, spacing: borderSpacing, borderWidth: borderWidth) {
VStack(alignment: .leading) {
Text(info.venue)
.font(.caption)
.foregroundColor(.secondary)
Text(info.title)
.font(.subheadline)
.fontWeight(.regular)
}
}
}
}
struct PublicationView_Previews: PreviewProvider {
static var previews: some View {
PublicationView(info: .init(
venue: "My venue",
title: "The publication title"),
borderSpacing: 5,
borderWidth: 3)
}
}

View File

@@ -0,0 +1,32 @@
import SwiftUI
struct TopViewImage: View {
let image: String
let shadow: CGFloat
let lineWidth: CGFloat
var body: some View {
Image(image)
.resizable()
.aspectRatio(1, contentMode: .fit)
.clipShape(Circle())
.overlay {
Circle().stroke(.gray, lineWidth: lineWidth)
}
.shadow(radius: shadow)
.padding(lineWidth)
}
}
struct TopViewImage_Previews: PreviewProvider {
static var previews: some View {
TopViewImage(
image: "Cover",
shadow: 5,
lineWidth: 2)
.previewLayout(.fixed(width: 150, height: 150))
}
}