Skip to content

Commit 40781fa

Browse files
committed
add Setup
1 parent 3ac7a53 commit 40781fa

File tree

4 files changed

+199
-3
lines changed

4 files changed

+199
-3
lines changed

.DS_Store

0 Bytes
Binary file not shown.
Binary file not shown.

StosVPN.xcodeproj/xcuserdata/stossy11.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,52 @@
33
uuid = "E9FBFA8B-D737-454C-9876-DFFB697E8C2D"
44
type = "1"
55
version = "2.0">
6+
<Breakpoints>
7+
<BreakpointProxy
8+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
9+
<BreakpointContent
10+
uuid = "EBA30226-5BCA-4729-8062-C41AF6A700D2"
11+
shouldBeEnabled = "Yes"
12+
ignoreCount = "0"
13+
continueAfterRunningActions = "No"
14+
filePath = "StosVPN/ContentView.swift"
15+
startingColumnNumber = "9223372036854775807"
16+
endingColumnNumber = "9223372036854775807"
17+
startingLineNumber = "612"
18+
endingLineNumber = "612"
19+
landmarkName = "body"
20+
landmarkType = "24">
21+
<Locations>
22+
<Location
23+
uuid = "EBA30226-5BCA-4729-8062-C41AF6A700D2 - 41082001a4351f4b"
24+
shouldBeEnabled = "Yes"
25+
ignoreCount = "0"
26+
continueAfterRunningActions = "No"
27+
symbolName = "closure #3 () -&gt; SwiftUI.TupleView&lt;(SwiftUI.HStack&lt;SwiftUI.TupleView&lt;(SwiftUI.Text, SwiftUI.Spacer, SwiftUI.Text)&gt;&gt;, SwiftUI.Button&lt;SwiftUI.Text&gt;, SwiftUI.NavigationLink&lt;SwiftUI.Text, StosVPN.HelpView&gt;)&gt; in closure #1 () -&gt; SwiftUI.TupleView&lt;(SwiftUI.Section&lt;SwiftUI.Text, SwiftUI.TupleView&lt;(SwiftUI.Toggle&lt;SwiftUI.Text&gt;, SwiftUI.NavigationLink&lt;SwiftUI.Label&lt;SwiftUI.Text, SwiftUI.Image&gt;, StosVPN.ConnectionLogView&gt;)&gt;, SwiftUI.EmptyView&gt;, SwiftUI.Section&lt;SwiftUI.Text, SwiftUI.TupleView&lt;(SwiftUI.HStack&lt;SwiftUI.TupleView&lt;(SwiftUI.Text, SwiftUI.Spacer, &lt;&lt;opaque return type of SwiftUI.View.keyboardType(__C.UIKeyboardType) -&gt; some&gt;&gt;.0)&gt;&gt;, SwiftUI.HStack&lt;SwiftUI.TupleView&lt;(SwiftUI.Text, SwiftUI.Spacer, &lt;&lt;opaque return type of SwiftUI.View.keyboardType(__C.UIKeyboardType) -&gt; some&gt;&gt;.0)&gt;&gt;, SwiftUI.HStack&lt;SwiftUI.TupleView&lt;(SwiftUI.Text, SwiftUI.Spacer, &lt;&lt;opaque return type of SwiftUI.View.keyboardType(__C.UIKeyboardType) -&gt; some&gt;&gt;.0)&gt;&gt;)&gt;, SwiftUI.EmptyView&gt;, SwiftUI.Section&lt;SwiftUI.Text, SwiftUI.TupleView&lt;(SwiftUI.HStack&lt;SwiftUI.TupleView&lt;(SwiftUI.Text, SwiftUI.Spacer, SwiftUI.Text)&gt;&gt;, SwiftUI.Button&lt;SwiftUI.Text&gt;, SwiftUI.NavigationLink&lt;SwiftUI.Text, StosVPN.HelpView&gt;)&gt;, SwiftUI.EmptyView&gt;)&gt; in closure #1 () -&gt; &lt;&lt;opaque return type of SwiftUI.View.toolbar&lt;&#x3c4;_0_0 where &#x3c4;_1_0: SwiftUI.ToolbarContent&gt;(content: () -&gt; &#x3c4;_1_0) -&gt; some&gt;&gt;.0 in StosVPN.SettingsView.body.getter : some"
28+
moduleName = "StosVPN.debug.dylib"
29+
usesParentBreakpointCondition = "Yes"
30+
urlString = "file:///Users/stossy11/Developer/StosVPN/StosVPN/ContentView.swift"
31+
startingColumnNumber = "9223372036854775807"
32+
endingColumnNumber = "9223372036854775807"
33+
startingLineNumber = "613"
34+
endingLineNumber = "613">
35+
</Location>
36+
<Location
37+
uuid = "EBA30226-5BCA-4729-8062-C41AF6A700D2 - e2b02a9d9e8fd01"
38+
shouldBeEnabled = "Yes"
39+
ignoreCount = "0"
40+
continueAfterRunningActions = "No"
41+
symbolName = "closure #2 @Swift.MainActor () -&gt; () in closure #3 () -&gt; SwiftUI.TupleView&lt;(SwiftUI.HStack&lt;SwiftUI.TupleView&lt;(SwiftUI.Text, SwiftUI.Spacer, SwiftUI.Text)&gt;&gt;, SwiftUI.Button&lt;SwiftUI.Text&gt;, SwiftUI.NavigationLink&lt;SwiftUI.Text, StosVPN.HelpView&gt;)&gt; in closure #1 () -&gt; SwiftUI.TupleView&lt;(SwiftUI.Section&lt;SwiftUI.Text, SwiftUI.TupleView&lt;(SwiftUI.Toggle&lt;SwiftUI.Text&gt;, SwiftUI.NavigationLink&lt;SwiftUI.Label&lt;SwiftUI.Text, SwiftUI.Image&gt;, StosVPN.ConnectionLogView&gt;)&gt;, SwiftUI.EmptyView&gt;, SwiftUI.Section&lt;SwiftUI.Text, SwiftUI.TupleView&lt;(SwiftUI.HStack&lt;SwiftUI.TupleView&lt;(SwiftUI.Text, SwiftUI.Spacer, &lt;&lt;opaque return type of SwiftUI.View.keyboardType(__C.UIKeyboardType) -&gt; some&gt;&gt;.0)&gt;&gt;, SwiftUI.HStack&lt;SwiftUI.TupleView&lt;(SwiftUI.Text, SwiftUI.Spacer, &lt;&lt;opaque return type of SwiftUI.View.keyboardType(__C.UIKeyboardType) -&gt; some&gt;&gt;.0)&gt;&gt;, SwiftUI.HStack&lt;SwiftUI.TupleView&lt;(SwiftUI.Text, SwiftUI.Spacer, &lt;&lt;opaque return type of SwiftUI.View.keyboardType(__C.UIKeyboardType) -&gt; some&gt;&gt;.0)&gt;&gt;)&gt;, SwiftUI.EmptyView&gt;, SwiftUI.Section&lt;SwiftUI.Text, SwiftUI.TupleView&lt;(SwiftUI.HStack&lt;SwiftUI.TupleView&lt;(SwiftUI.Text, SwiftUI.Spacer, SwiftUI.Text)&gt;&gt;, SwiftUI.Button&lt;SwiftUI.Text&gt;, SwiftUI.NavigationLink&lt;SwiftUI.Text, StosVPN.HelpView&gt;)&gt;, SwiftUI.EmptyView&gt;)&gt; in closure #1 () -&gt; &lt;&lt;opaque return type of SwiftUI.View.toolbar&lt;&#x3c4;_0_0 where &#x3c4;_1_0: SwiftUI.ToolbarContent&gt;(content: () -&gt; &#x3c4;_1_0) -&gt; some&gt;&gt;.0 in StosVPN.SettingsView.body.getter : some"
42+
moduleName = "StosVPN.debug.dylib"
43+
usesParentBreakpointCondition = "Yes"
44+
urlString = "file:///Users/stossy11/Developer/StosVPN/StosVPN/ContentView.swift"
45+
startingColumnNumber = "9223372036854775807"
46+
endingColumnNumber = "9223372036854775807"
47+
startingLineNumber = "614"
48+
endingLineNumber = "614">
49+
</Location>
50+
</Locations>
51+
</BreakpointContent>
52+
</BreakpointProxy>
53+
</Breakpoints>
654
</Bucket>

StosVPN/ContentView.swift

Lines changed: 151 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ struct ContentView: View {
297297
@State private var showSettings = false
298298
@State var tunnel = false
299299
@AppStorage("autoConnect") private var autoConnect = false
300+
@AppStorage("hasNotCompletedSetup") private var hasNotCompletedSetup = true
300301

301302
var body: some View {
302303
NavigationStack {
@@ -335,10 +336,12 @@ struct ContentView: View {
335336
tunnelManager.startVPN()
336337
}
337338
}
338-
339339
.sheet(isPresented: $showSettings) {
340340
SettingsView()
341341
}
342+
.sheet(isPresented: $hasNotCompletedSetup) {
343+
SetupView()
344+
}
342345
}
343346
}
344347
}
@@ -607,8 +610,8 @@ struct SettingsView: View {
607610
.foregroundColor(.secondary)
608611
}
609612

610-
NavigationLink(destination: PrivacyPolicyView()) {
611-
Text("Privacy Policy")
613+
Button("Privacy Policy") {
614+
UIApplication.shared.open(URL(string: "https://github.com/stossy11/PrivacyPolicy/blob/main/PrivacyPolicy.md")!)
612615
}
613616

614617
NavigationLink(destination: HelpView()) {
@@ -727,6 +730,151 @@ struct HelpView: View {
727730
}
728731
}
729732

733+
struct SetupView: View {
734+
@Environment(\.dismiss) private var dismiss
735+
@AppStorage("hasNotCompletedSetup") private var hasNotCompletedSetup = true
736+
@State private var currentPage = 0
737+
738+
let pages = [
739+
SetupPage(
740+
title: "Welcome to StosVPN",
741+
description: "A simple local network tunnel for everyone",
742+
imageName: "checkmark.shield.fill",
743+
details: "StosVPN creates a local network interface on your device that anyone can use for development, testing, and accessing local servers."
744+
),
745+
SetupPage(
746+
title: "Why Use StosVPN?",
747+
description: "Perfect for developers and everyday users",
748+
imageName: "person.2.fill",
749+
details: "• Access local web servers and development environments\n• Test applications that require specific network configurations\n• Connect to local network services without complex setup\n• Create isolated network environments for testing"
750+
),
751+
SetupPage(
752+
title: "Easy to Use",
753+
description: "Just one tap to connect",
754+
imageName: "hand.tap.fill",
755+
details: "StosVPN is designed to be simple and straightforward. Just tap the connect button to establish a local network tunnel with pre-configured settings that work for most users."
756+
),
757+
SetupPage(
758+
title: "Privacy Focused",
759+
description: "Your data stays on your device",
760+
imageName: "lock.shield.fill",
761+
details: "StosVPN creates a local tunnel that doesn't route traffic through external servers. All network traffic remains on your device, ensuring your privacy and security."
762+
)
763+
]
764+
765+
var body: some View {
766+
NavigationStack {
767+
VStack {
768+
TabView(selection: $currentPage) {
769+
ForEach(0..<pages.count, id: \.self) { index in
770+
SetupPageView(page: pages[index])
771+
.tag(index)
772+
}
773+
}
774+
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .always))
775+
776+
Spacer()
777+
778+
if currentPage == pages.count - 1 {
779+
Button {
780+
hasNotCompletedSetup = false
781+
dismiss()
782+
} label: {
783+
Text("Get Started")
784+
.font(.headline)
785+
.fontWeight(.semibold)
786+
.frame(height: 50)
787+
.frame(maxWidth: .infinity)
788+
.background(
789+
LinearGradient(
790+
gradient: Gradient(colors: [Color.blue.opacity(0.8), Color.blue]),
791+
startPoint: .leading,
792+
endPoint: .trailing
793+
)
794+
)
795+
.foregroundColor(.white)
796+
.cornerRadius(10)
797+
.padding(.horizontal)
798+
}
799+
.padding(.bottom)
800+
} else {
801+
Button {
802+
withAnimation {
803+
currentPage += 1
804+
}
805+
} label: {
806+
Text("Next")
807+
.font(.headline)
808+
.fontWeight(.semibold)
809+
.frame(height: 50)
810+
.frame(maxWidth: .infinity)
811+
.background(
812+
LinearGradient(
813+
gradient: Gradient(colors: [Color.blue.opacity(0.8), Color.blue]),
814+
startPoint: .leading,
815+
endPoint: .trailing
816+
)
817+
)
818+
.foregroundColor(.white)
819+
.cornerRadius(10)
820+
.padding(.horizontal)
821+
}
822+
.padding(.bottom)
823+
}
824+
}
825+
.navigationTitle("Setup")
826+
.navigationBarTitleDisplayMode(.inline)
827+
.toolbar {
828+
ToolbarItem(placement: .topBarTrailing) {
829+
Button("Skip") {
830+
dismiss()
831+
}
832+
}
833+
}
834+
}
835+
}
836+
}
837+
838+
struct SetupPage {
839+
let title: String
840+
let description: String
841+
let imageName: String
842+
let details: String
843+
}
844+
845+
struct SetupPageView: View {
846+
let page: SetupPage
847+
848+
var body: some View {
849+
VStack(spacing: 30) {
850+
Image(systemName: page.imageName)
851+
.font(.system(size: 80))
852+
.foregroundColor(.blue)
853+
.padding(.top, 50)
854+
855+
Text(page.title)
856+
.font(.title)
857+
.fontWeight(.bold)
858+
.multilineTextAlignment(.center)
859+
860+
Text(page.description)
861+
.font(.headline)
862+
.foregroundColor(.secondary)
863+
.multilineTextAlignment(.center)
864+
865+
ScrollView {
866+
Text(page.details)
867+
.font(.body)
868+
.multilineTextAlignment(.leading)
869+
.padding(.horizontal)
870+
}
871+
872+
Spacer()
873+
}
874+
.padding()
875+
}
876+
}
877+
730878
#Preview {
731879
ContentView()
732880
}

0 commit comments

Comments
 (0)