diff --git a/Gaze/Views/Onboarding/CompletionView.swift b/Gaze/Views/Onboarding/CompletionView.swift index 40102a0..513be02 100644 --- a/Gaze/Views/Onboarding/CompletionView.swift +++ b/Gaze/Views/Onboarding/CompletionView.swift @@ -8,8 +8,6 @@ import SwiftUI struct CompletionView: View { - var onComplete: () -> Void - var body: some View { VStack(spacing: 30) { Spacer() @@ -71,5 +69,5 @@ struct CompletionView: View { } #Preview { - CompletionView(onComplete: {}) + CompletionView() } diff --git a/Gaze/Views/Onboarding/OnboardingContainerView.swift b/Gaze/Views/Onboarding/OnboardingContainerView.swift index 7e57a85..88774bf 100644 --- a/Gaze/Views/Onboarding/OnboardingContainerView.swift +++ b/Gaze/Views/Onboarding/OnboardingContainerView.swift @@ -39,13 +39,11 @@ struct OnboardingContainerView: View { .ignoresSafeArea() VStack(spacing: 0) { TabView(selection: $currentPage) { - WelcomeView( - onContinue: { currentPage = 1 } - ) - .tag(0) - .tabItem { - Image(systemName: "hand.wave.fill") - } + WelcomeView() + .tag(0) + .tabItem { + Image(systemName: "hand.wave.fill") + } LookAwaySetupView( enabled: $lookAwayEnabled, @@ -83,31 +81,31 @@ struct OnboardingContainerView: View { Image(systemName: "gearshape.fill") } - CompletionView( - onComplete: { - completeOnboarding() + CompletionView() + .tag(5) + .tabItem { + Image(systemName: "checkmark.circle.fill") } - ) - .tag(5) - .tabItem { - Image(systemName: "checkmark.circle.fill") - } } .tabViewStyle(.automatic) - if currentPage >= 1 { + if currentPage >= 0 { HStack(spacing: 12) { - Button(action: { currentPage -= 1 }) { - HStack { - Image(systemName: "chevron.left") - Text("Back") + if currentPage > 0 { + Button(action: { currentPage -= 1 }) { + HStack { + Image(systemName: "chevron.left") + Text("Back") + } + .font(.headline) + .frame( + minWidth: 100, maxWidth: .infinity, minHeight: 44, + maxHeight: 44, alignment: .center + ) + .foregroundColor(.white) } - .font(.headline) - .frame(maxWidth: .infinity) - .padding() + .glassEffect(.regular.interactive()) } - .buttonStyle(.plain) - .glassEffect(.regular.interactive()) Button(action: { if currentPage == 5 { @@ -116,12 +114,18 @@ struct OnboardingContainerView: View { currentPage += 1 } }) { - Text(currentPage == 5 ? "Get Started" : "Continue") - .font(.headline) - .frame(maxWidth: .infinity) - .padding() + Text( + currentPage == 0 + ? "Let's Get Started" + : currentPage == 5 ? "Get Started" : "Continue" + ) + .font(.headline) + .frame( + minWidth: 100, maxWidth: .infinity, minHeight: 44, maxHeight: 44, + alignment: .center + ) + .foregroundColor(.white) } - .buttonStyle(.plain) .glassEffect(.regular.tint(currentPage == 5 ? .green : .blue).interactive()) } .padding(.horizontal, 40) @@ -226,3 +230,6 @@ struct OnboardingContainerView: View { }) } } +#Preview { + OnboardingContainerView(s) +} diff --git a/Gaze/Views/Onboarding/WelcomeView.swift b/Gaze/Views/Onboarding/WelcomeView.swift index 3ee670c..8d4f980 100644 --- a/Gaze/Views/Onboarding/WelcomeView.swift +++ b/Gaze/Views/Onboarding/WelcomeView.swift @@ -8,23 +8,21 @@ import SwiftUI struct WelcomeView: View { - var onContinue: () -> Void - var body: some View { VStack(spacing: 30) { Spacer() - + Image(systemName: "eye.fill") .font(.system(size: 80)) .foregroundColor(.blue) - + Text("Welcome to Gaze") .font(.system(size: 36, weight: .bold)) - + Text("Take care of your eyes and posture") .font(.title3) .foregroundColor(.secondary) - + VStack(alignment: .leading, spacing: 16) { FeatureRow(icon: "eye.circle", title: "Reduce Eye Strain", description: "Regular breaks help prevent digital eye strain") FeatureRow(icon: "eye.trianglebadge.exclamationmark", title: "Remember to Blink", description: "We blink less when focused on screens") @@ -32,20 +30,10 @@ struct WelcomeView: View { } .padding() .glassEffect(in: .rect(cornerRadius: 16)) - + Spacer() - - Button(action: onContinue) { - Text("Let's Get Started") - .font(.headline) - .frame(maxWidth: .infinity) - .padding() - } - .buttonStyle(.plain) - .glassEffect(.regular.tint(.blue).interactive()) - .padding(.horizontal, 40) } - .frame(width: 600, height: 500) + .frame(width: 600, height: 450) .padding() .background(.clear) } @@ -55,14 +43,14 @@ struct FeatureRow: View { let icon: String let title: String let description: String - + var body: some View { HStack(alignment: .top, spacing: 16) { Image(systemName: icon) .font(.title2) .foregroundColor(.blue) .frame(width: 30) - + VStack(alignment: .leading, spacing: 4) { Text(title) .font(.headline) @@ -75,5 +63,5 @@ struct FeatureRow: View { } #Preview { - WelcomeView(onContinue: {}) + WelcomeView() }