- Add VoiceOver labels and hints to all voting layouts, settings, widgets, onboarding screens, and entry cells - Add Reduce Motion support to button animations throughout the app - Ensure 44x44pt minimum touch targets on widget mood buttons - Enhance AccessibilityHelpers with Dynamic Type support, ScaledValue wrapper, and VoiceOver detection utilities - Gate premium features (Insights, Month/Year views) behind subscription - Update widgets to show subscription prompts for non-subscribers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
109 lines
3.6 KiB
Swift
109 lines
3.6 KiB
Swift
//
|
|
// OnboardingTime.swift
|
|
// Feels (iOS)
|
|
//
|
|
// Created by Trey Tartt on 1/20/22.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct OnboardingTime: View {
|
|
@ObservedObject var onboardingData: OnboardingData
|
|
|
|
var formatter: DateFormatter {
|
|
let dateFormatter = DateFormatter()
|
|
dateFormatter.timeStyle = .short
|
|
return dateFormatter
|
|
}
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
// Gradient background
|
|
LinearGradient(
|
|
colors: [Color(hex: "f093fb"), Color(hex: "f5576c")],
|
|
startPoint: .topLeading,
|
|
endPoint: .bottomTrailing
|
|
)
|
|
.ignoresSafeArea()
|
|
|
|
VStack(spacing: 0) {
|
|
Spacer()
|
|
|
|
// Icon
|
|
ZStack {
|
|
Circle()
|
|
.fill(.white.opacity(0.15))
|
|
.frame(width: 120, height: 120)
|
|
|
|
Image(systemName: "bell.fill")
|
|
.font(.system(size: 44))
|
|
.foregroundColor(.white)
|
|
}
|
|
.padding(.bottom, 32)
|
|
|
|
// Title
|
|
Text("When should we\nremind you?")
|
|
.font(.system(size: 28, weight: .bold, design: .rounded))
|
|
.foregroundColor(.white)
|
|
.multilineTextAlignment(.center)
|
|
.padding(.bottom, 12)
|
|
|
|
// Subtitle
|
|
Text("Pick a time that works for your daily check-in")
|
|
.font(.system(size: 16, weight: .medium))
|
|
.foregroundColor(.white.opacity(0.85))
|
|
.multilineTextAlignment(.center)
|
|
.padding(.horizontal, 40)
|
|
|
|
Spacer()
|
|
|
|
// Time picker card
|
|
VStack(spacing: 16) {
|
|
DatePicker("", selection: $onboardingData.date, displayedComponents: .hourAndMinute)
|
|
.datePickerStyle(.wheel)
|
|
.labelsHidden()
|
|
.colorScheme(.light)
|
|
.accessibilityLabel(String(localized: "Reminder time"))
|
|
.accessibilityHint(String(localized: "Select when you want to be reminded"))
|
|
}
|
|
.padding(.vertical, 20)
|
|
.padding(.horizontal, 24)
|
|
.background(
|
|
RoundedRectangle(cornerRadius: 24)
|
|
.fill(.white)
|
|
.shadow(color: .black.opacity(0.1), radius: 20, y: 10)
|
|
)
|
|
.padding(.horizontal, 30)
|
|
|
|
Spacer()
|
|
|
|
// Info text
|
|
HStack(spacing: 12) {
|
|
Image(systemName: "info.circle.fill")
|
|
.font(.system(size: 20))
|
|
.foregroundColor(.white.opacity(0.8))
|
|
.accessibilityHidden(true)
|
|
|
|
Text("You'll get a gentle reminder at \(formatter.string(from: onboardingData.date)) every day")
|
|
.font(.system(size: 14, weight: .medium))
|
|
.foregroundColor(.white.opacity(0.9))
|
|
}
|
|
.padding(.horizontal, 30)
|
|
.padding(.bottom, 80)
|
|
.accessibilityElement(children: .combine)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct OnboardingTime_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
Group {
|
|
OnboardingTime(onboardingData: OnboardingData())
|
|
|
|
OnboardingTime(onboardingData: OnboardingData())
|
|
.preferredColorScheme(.dark)
|
|
}
|
|
}
|
|
}
|