From 70b43ecb8adccce1edf24eb1d630d6e07ea25b27 Mon Sep 17 00:00:00 2001 From: talksik Date: Mon, 13 Dec 2021 03:00:24 -0800 Subject: [PATCH] getting a basic template created, but still messy --- .../Templates/OnboardingTemplateView.swift | 99 ++++++++++++++++++- .../Views/WelcomeView/WelcomeView.swift | 72 +------------- 2 files changed, 97 insertions(+), 74 deletions(-) diff --git a/nirvana-ios/Views/Templates/OnboardingTemplateView.swift b/nirvana-ios/Views/Templates/OnboardingTemplateView.swift index 8c476bc..beb398e 100644 --- a/nirvana-ios/Views/Templates/OnboardingTemplateView.swift +++ b/nirvana-ios/Views/Templates/OnboardingTemplateView.swift @@ -8,16 +8,109 @@ import SwiftUI struct OnboardingTemplateView: View { + let screenWidth = UIScreen.main.bounds.width + let screenHeight = UIScreen.main.bounds.height + + private let headerText: String + private let imageName:String + + private let mainLeadingActionText:String + private let mainHighlightedActionText:String + private let mainTrailingActionText:String + + private let subActionText:String + + private var bottomActionArea:AnyView - init() { - + init(hdrText:String = "Welcome to Nirvana", + imgName:String = "undraw_calling_re_mgft", + mainLeadingActText:String = "Your ", + mainHighlightedActText: String = "minimalist ", + mainTrailingActText:String = "social media.", + subActText: String = "this is the test of the main thing.", + bottomActArea:AnyView = AnyView(Text("this is the action area"))) { + self.headerText = hdrText + self.imageName = imgName + self.mainLeadingActionText = mainLeadingActText + self.mainHighlightedActionText = mainHighlightedActText + self.mainTrailingActionText = mainTrailingActText + self.subActionText = subActText + self.bottomActionArea = bottomActArea } var body: some View { VStack(alignment: .leading, spacing: 0) { + // nav bar + HeaderView() - } + VStack { + // illustration + Image("undraw_friendship_mni7") + .renderingMode(.original) + .resizable() + .aspectRatio(contentMode: .fit) + + VStack(alignment: .leading) { + + Text("Your ") + .font(.title) + .foregroundColor(NirvanaColor.black) + + Text("minimalist ") + .font(.title) + .foregroundColor(NirvanaColor.teal) + + Text("social media.") + .font(.title) + .foregroundColor(NirvanaColor.black) + + Text("tired of the rat race on insta, tik-tok, snap, meta?") + .foregroundColor(Color.gray) + .padding(.top, 5) + .fixedSize(horizontal: false, vertical: true) + + Spacer() + } + .frame(maxWidth: screenWidth - 20) + + + VStack(alignment: .center) { + NavigationLink(destination: HomeView()) { + Text("Start Your Detox") + .bold() + .foregroundColor(NirvanaColor.white) + .frame(maxWidth: .infinity) + .padding(.vertical, 20) + .background(NirvanaColor.teal) + .clipShape(Capsule()) + .shadow(radius:10) + } + + + Button( + action: { + print("link to website learn more clicked") + }, + label: { + Text("Learn More") + .bold() + }) + + //learn more button to usenirvana.com + } + .padding(.top, 20) + + } + .padding() + .frame(maxWidth: screenWidth - 20) + + Spacer() + } // Vstack + .accentColor(NirvanaColor.teal) + .background(NirvanaColor.bgLightGrey) + .navigationBarTitleDisplayMode(.inline) + // .background(RadialGradient(gradient: Gradient(colors: [NirvanaColor.teal.opacity(0.1), NirvanaColor.bgLightGrey, NirvanaColor.bgLightGrey]), center: .center, startRadius: 0, endRadius: 200) + // ) + } } diff --git a/nirvana-ios/Views/WelcomeView/WelcomeView.swift b/nirvana-ios/Views/WelcomeView/WelcomeView.swift index 97ab7be..068bc1c 100644 --- a/nirvana-ios/Views/WelcomeView/WelcomeView.swift +++ b/nirvana-ios/Views/WelcomeView/WelcomeView.swift @@ -12,77 +12,7 @@ struct WelcomeView: View { let screenHeight = UIScreen.main.bounds.height var body: some View { - VStack(spacing: 0) { - // nav bar - HeaderView() - - VStack { - // illustration - Image("undraw_friendship_mni7") - .renderingMode(.original) - .resizable() - .aspectRatio(contentMode: .fit) - - VStack(alignment: .leading) { - - Text("Your ") - .font(.title) - .foregroundColor(NirvanaColor.black) - + Text("minimalist ") - .font(.title) - .foregroundColor(NirvanaColor.teal) - + Text("social media.") - .font(.title) - .foregroundColor(NirvanaColor.black) - - Text("tired of the rat race on insta, tik-tok, snap, meta?") - .foregroundColor(Color.gray) - .padding(.top, 5) - .fixedSize(horizontal: false, vertical: true) - - Spacer() - } - .frame(maxWidth: screenWidth - 20) - - - VStack(alignment: .center) { - NavigationLink(destination: HomeView()) { - Text("Start Your Detox") - .bold() - .foregroundColor(NirvanaColor.white) - .frame(maxWidth: .infinity) - .padding(.vertical, 20) - .background(NirvanaColor.teal) - .clipShape(Capsule()) - .shadow(radius:10) - } - - - Button( - action: { - print("link to website learn more clicked") - }, - label: { - Text("Learn More") - .bold() - }) - - //learn more button to usenirvana.com - } - .padding(.top, 20) - - } - .padding() - .frame(maxWidth: screenWidth - 20) - - Spacer() - } // Vstack - .accentColor(NirvanaColor.teal) - .background(NirvanaColor.bgLightGrey) - .navigationBarTitleDisplayMode(.inline) - // .background(RadialGradient(gradient: Gradient(colors: [NirvanaColor.teal.opacity(0.1), NirvanaColor.bgLightGrey, NirvanaColor.bgLightGrey]), center: .center, startRadius: 0, endRadius: 200) - // ) - + OnboardingTemplateView() } // View body } // View