-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHomeView.swift
74 lines (67 loc) · 2.32 KB
/
HomeView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import SwiftUI
struct CardView: View {
var title: String
var description: String
var iconName: String
var destination: AnyView
var body: some View {
VStack(alignment: .leading, spacing: 10) {
HStack {
Image(systemName: iconName)
.resizable()
.frame(width: 24, height: 24)
.padding(.trailing, 5)
Text(title)
.font(.headline)
}
.padding(.bottom, 5)
Text(description)
.font(.subheadline)
.foregroundColor(.secondary)
NavigationLink(destination: destination) {
Text("Go")
.font(.headline)
.padding()
.frame(maxWidth: .infinity)
.background(Color(UIColor.systemBlue))
.foregroundColor(.white)
.cornerRadius(10)
}
}
.padding()
.background(Color(UIColor.systemBackground))
.cornerRadius(10)
.shadow(radius: 5)
.padding(.horizontal)
}
}
struct HomeView: View {
var body: some View {
NavigationStack {
ScrollView {
VStack(alignment: .leading, spacing: 20) {
CardView(
title: "Access AR",
description: "Tap here to access AR and start popping bubbles.",
iconName: "arkit",
destination: AnyView(ARMeditationView())
)
CardView(
title: "Start Meditation",
description: "Begin a guided meditation session to relax and unwind.",
iconName: "leaf.arrow.circlepath",
destination: AnyView(MeditationView())
)
CardView(
title: "Track Medications in AR",
description: "View your medication schedule in augmented reality.",
iconName: "pills",
destination: AnyView(MedicationListView())
)
}
.padding(.top)
}
.navigationTitle("Home")
}
}
}