This commit is contained in:
talksik
2021-12-19 23:22:20 -08:00
parent cd9b495a02
commit db72d0dc1f
2 changed files with 99 additions and 3 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ import NavigationStack
struct ContentView: View {
var body: some View {
NavigationStackView {
RouterView()
Onboarding_One()
}
}
}
@@ -6,15 +6,111 @@
//
import SwiftUI
import NavigationStack
struct Onboarding_One: View {
@EnvironmentObject var navigationStack: NavigationStack
@State var onboardingStepNumber = 0
var body: some View {
OnboardingTemplateView(imgName: "undraw_through_the_park_lxnl", mainLeadingActText: "Be", mainHighlightedActText: "yourself", mainTrailingActText: "again.", subActText: "No more endless feeds, media, fomo, anxiety...focus on you and be more present.")
let stepViews = [
self.stepContent(imageName: "undraw_through_the_park_lxnl", leadingText: "Be", midText: "yourself", trailingText: "again", subText: "No more endless feeds, media, fomo, anxiety...focus on you and be more present."),
self.stepContent(imageName: "undraw_through_the_park_lxnl", leadingText: "Be", midText: "yourself", trailingText: "again", subText: "No more endless feeds, media, fomo, anxiety...focus on you and be more present."),
self.stepContent(imageName: "undraw_through_the_park_lxnl", leadingText: "Be", midText: "yourself", trailingText: "again", subText: "No more endless feeds, media, fomo, anxiety...focus on you and be more present.")
]
ZStack {
// bg
WavesGlassBackgroundView()
// programmatic back button
ZStack(alignment: .topLeading) {
Color.clear
Button {
self.navigationStack.pop()
} label: {
Label("back", systemImage:"chevron.left")
.labelStyle(.iconOnly)
.font(.title2)
}
.padding()
}
VStack(alignment: .center) {
LogoHeaderView()
TabView {
self.stepContent(imageName: "undraw_through_the_park_lxnl", leadingText: "Be", midText: "yourself", trailingText: "again", subText: "No more endless feeds, media, fomo, anxiety...focus on you and be more present.")
self.stepContent(imageName: "undraw_through_the_park_lxnl", leadingText: "Be", midText: "yourself", trailingText: "again", subText: "No more endless feeds, media, fomo, anxiety...focus on you and be more present.")
self.stepContent(imageName: "undraw_through_the_park_lxnl", leadingText: "Be", midText: "yourself", trailingText: "again", subText: "No more endless feeds, media, fomo, anxiety...focus on you and be more present.")
}
Spacer()
// bottom controls
HStack {
Button {
self.navigationStack.push(AddBasicInfoView())
} label: {
Text("Skip")
.foregroundColor(Color.white.opacity(0.7))
}
Spacer()
Button {
self.onboardingStepNumber = (self.onboardingStepNumber + 1) % stepViews.count
} label: {
Label("Next", systemImage: "arrow.right")
.font(.title2)
.foregroundColor(NirvanaColor.teal)
}
}
.padding()
.frame(maxWidth: .infinity)
}
.frame(maxWidth: UIScreen.main.bounds.width - 30)
// OnboardingTemplateView(imgName: "undraw_through_the_park_lxnl", mainLeadingActText: "Be", mainHighlightedActText: "yourself", mainTrailingActText: "again.", subActText: "No more endless feeds, media, fomo, anxiety...focus on you and be more present.")
}
}
private func stepContent(imageName: String, leadingText: String, midText: String, trailingText: String, subText: String) -> some View {
VStack {
Image(imageName)
.renderingMode(.original)
.resizable()
.aspectRatio(contentMode: .fit)
VStack(alignment: .leading) {
Text(leadingText + " ")
.font(.largeTitle)
.foregroundColor(NirvanaColor.black)
.fontWeight(.medium)
+ Text(midText + " ")
.font(.largeTitle)
.foregroundColor(NirvanaColor.teal)
.fontWeight(.medium)
+ Text(trailingText)
.font(.largeTitle)
.foregroundColor(NirvanaColor.black)
.fontWeight(.medium)
Text(subText)
.font(.headline)
.foregroundColor(Color.black.opacity(0.7))
.padding(.top, 5)
}
}
}
}
struct Onboarding_One_Previews: PreviewProvider {
static var previews: some View {
Onboarding_One()
Onboarding_One().environmentObject(AuthSessionStore())
}
}