Repository Public BSD-3-Clause
1// =============================================================================2// SP BOUCHER | SOFTWARE & RESEARCH3// ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4// =============================================================================5//6// PROJECT METADATA7// -----------------------------------------------------------------------------8// Project : ORIX Maps9// File : Apps/ORIXMaps/Sources/Onboarding/OnboardingView.swift10// Module : Onboarding11// Repository : https://git.spboucher.ai/orix-maps12// Created : 2026-11-2513// Last Modified : 2026-11-2514//15// =============================================================================16// AUTHOR & PROFESSIONAL AFFILIATION17// =============================================================================18//19// Author : Simon-Pierre Boucher20// Position : Professor of Finance21// Institution : Université du Québec en Outaouais (UQO)22// Department : Département des sciences administratives23// Organization : SP Boucher24//25// Website : https://spboucher.ai26// Git : https://git.spboucher.ai27//28// =============================================================================29// OFFICIAL CONTACT DIRECTORY30// =============================================================================31//32// General : info@spboucher.ai33// Professional : contact@spboucher.ai34// Direct : simon@spboucher.ai35// Research : research@spboucher.ai36// Development : dev@spboucher.ai37// Support : support@spboucher.ai38// Security/Admin : admin@spboucher.ai39// Notifications : notifications@spboucher.ai40//41// Preferred Contact: support@spboucher.ai42//43// =============================================================================44// COPYRIGHT & INTELLECTUAL PROPERTY45// =============================================================================46//47// Copyright (c) 202648// Simon-Pierre Boucher49//50// All rights reserved where applicable.51//52// This file is governed by the applicable project license,53// copyright notices, institutional agreements and relevant law.54//55// Unless expressly authorized by the applicable license or56// rights holder, copying, redistribution, sublicensing,57// publication and commercial exploitation are not permitted.58//59// Existing third-party rights and notices remain unaffected.60//61// =============================================================================62// CONFIDENTIALITY & SECURITY63// =============================================================================64//65// Classification : Public66// Distribution : Public repository; use is governed by the project license67// Security Contact : admin@spboucher.ai68//69// Access to this source does not independently grant permission70// to redistribute or disclose confidential materials.71//72// Do not embed credentials, private keys, access tokens,73// certificates or confidential personal information.74//75// =============================================================================76// LICENSE & MAINTENANCE77// =============================================================================78//79// License : Proprietary, all rights reserved (see license file)80// License File : LICENSE81// Maintainer : Simon-Pierre Boucher82// Technical Contact: dev@spboucher.ai83//84// =============================================================================85// END OF SP BOUCHER SOURCE HEADER86// =============================================================================8788import ORIXDesignSystem89import SwiftUI9091/// Three short pages: what the app is, how offline maps work, what it does with data. No permission is requested here.92struct OnboardingView: View {93 @Environment(AppModel.self) private var app94 @Environment(\.accessibilityReduceMotion) private var reduceMotion95 @State private var page = 09697 private struct Page { let symbol: String; let title: LocalizedStringKey; let text: LocalizedStringKey }98 private let pages = [99 Page(symbol: "map.fill", title: "Maps that belong to you", text: "ORIX Maps draws its own maps from open data. Download a region once, then explore, search and get directions with no connection."),100 Page(symbol: "arrow.down.circle.fill", title: "Download, then go offline", text: "The world map is built in. Regions add streets, places, addresses and routing. They stay on your device until you remove them."),101 Page(symbol: "lock.shield.fill", title: "Private by design", text: "No account, no ads, no tracking. Your searches, routes and position never leave this device. Position access is asked only when you use a feature that needs it."),102 ]103104 var body: some View {105 GeometryReader { proxy in106 ScrollView {107 content.frame(minHeight: proxy.size.height)108 }109 .scrollBounceBehavior(.basedOnSize)110 }111 .background(Color("LaunchBackground").ignoresSafeArea())112 }113114 private var content: some View {115 VStack(spacing: ORIX.Spacing.xl) {116 Spacer(minLength: 0)117 let p = pages[page]118 Image(systemName: p.symbol)119 .font(.system(size: 72, weight: .regular))120 .foregroundStyle(ORIX.Palette.accent)121 .symbolRenderingMode(.hierarchical)122 .accessibilityHidden(true)123 VStack(spacing: ORIX.Spacing.m) {124 Text(p.title).font(.largeTitle.weight(.bold)).multilineTextAlignment(.center).fixedSize(horizontal: false, vertical: true)125 .accessibilityAddTraits(.isHeader)126 Text(p.text).font(.body).foregroundStyle(.secondary).multilineTextAlignment(.center).fixedSize(horizontal: false, vertical: true)127 }128 .frame(maxWidth: 480)129 .id(page)130 .transition(reduceMotion ? .opacity : .asymmetric(insertion: .move(edge: .trailing).combined(with: .opacity), removal: .opacity))131 Spacer(minLength: 0)132 HStack(spacing: 8) {133 ForEach(pages.indices, id: \.self) { i in Circle().fill(i == page ? ORIX.Palette.accent : Color.secondary.opacity(0.3)).frame(width: 8, height: 8) }134 }135 .accessibilityElement()136 .accessibilityLabel(Text("Page \(page + 1) of \(pages.count)"))137 Button(page == pages.count - 1 ? "Open the map" : "Continue") {138 if page == pages.count - 1 { app.settings.hasCompletedOnboarding = true } else { withAnimation(ORIX.Motion.standard(reduceMotion: reduceMotion)) { page += 1 } }139 }140 .buttonStyle(PrimaryButtonStyle(tint: AppColor.primaryFill))141 .frame(maxWidth: 480)142 .accessibilityIdentifier("onboarding.next")143 Button("Skip") { app.settings.hasCompletedOnboarding = true }144 .font(.subheadline)145 .frame(minWidth: ORIX.minimumTarget, minHeight: ORIX.minimumTarget)146 .contentShape(.rect)147 .opacity(page == pages.count - 1 ? 0 : 1)148 .accessibilityHidden(page == pages.count - 1)149 .accessibilityIdentifier("onboarding.skip")150 }151 .padding(ORIX.Spacing.xl)152 .frame(maxWidth: .infinity)153 }154}155