-
Notifications
You must be signed in to change notification settings - Fork 0
/
FirstLaunchView.swift
110 lines (101 loc) · 3.29 KB
/
FirstLaunchView.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//
// FirstLaunchView.swift
// Meine UniBi
//
// Created by Saadat Baig on 11.02.20.
// Copyright © 2020 Saadat Baig. All rights reserved.
//
import SwiftUI
// content base
struct DetailsView: View {
var title: String = "title"
var subTitle: String = "subtitle"
var imageName: String = "car.fill"
var body: some View {
HStack(alignment: .center) {
Image(systemName: imageName)
.font(.largeTitle)
.foregroundColor(Color.green)
.padding()
.accessibility(hidden: true)
VStack(alignment: .leading) {
Text(title)
.font(.headline)
.foregroundColor(.primary)
.accessibility(addTraits: .isHeader)
Text(subTitle)
.font(.body)
.foregroundColor(.secondary)
.fixedSize(horizontal: false, vertical: true)
}
}
.padding(.top)
}
}
// content container
struct DetailsContainerView: View {
var body: some View {
VStack(alignment: .leading) {
DetailsView(title: "Concise",
subTitle: "Everything you need is just a tap away.",
imageName: "exclamationmark.bubble.fill")
DetailsView(title: "Informative",
subTitle: "Need to know a professor's E-Mail?\nOr perhaps the way to V2-221?\nNo problem!",
imageName: "magnifyingglass.circle.fill")
DetailsView(title: "Made in Germany",
subTitle: "This application is entirely open-source and was made right here at the Bielefeld University.",
imageName: "heart.fill")
}
.padding(.horizontal)
}
}
// Header
struct HeaderView: View {
var body: some View {
VStack {
Text("My")
.customTitleText()
Text("UniBi")
.customTitleText()
.foregroundColor(Color.green)
}
}
}
struct FirstLaunchView: View {
var body: some View {
NavigationView{
ScrollView {
VStack(alignment: .center) {
Spacer()
HeaderView()
DetailsContainerView()
Spacer(minLength: 30)
NavigationLink(destination: HomeView()) {
Text("Continue")
.foregroundColor(.white)
.font(.headline)
.padding()
.frame(minWidth: 0, maxWidth: .infinity, alignment: .center)
.background(RoundedRectangle(cornerRadius: 15, style: .continuous)
.fill(Color.green))
.padding(.bottom)
}
.padding(.horizontal)
}
}
}
}
}
struct FirstLaunchView_Previews: PreviewProvider {
static var previews: some View {
FirstLaunchView()
}
}
// ext
extension Text {
func customTitleText() -> Text {
self
.fontWeight(.black)
.font(.system(size: 36))
}
}