diff --git a/phpmon/Assets.xcassets/Tour/Contents.json b/phpmon/Assets.xcassets/Tour/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/phpmon/Assets.xcassets/Tour/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/phpmon/Assets.xcassets/Tour/Tour.Domains.imageset/Contents.json b/phpmon/Assets.xcassets/Tour/Tour.Domains.imageset/Contents.json new file mode 100644 index 0000000..87011c7 --- /dev/null +++ b/phpmon/Assets.xcassets/Tour/Tour.Domains.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "tour3.heic", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/phpmon/Assets.xcassets/Tour/Tour.Domains.imageset/tour3.heic b/phpmon/Assets.xcassets/Tour/Tour.Domains.imageset/tour3.heic new file mode 100644 index 0000000..2c64a6d Binary files /dev/null and b/phpmon/Assets.xcassets/Tour/Tour.Domains.imageset/tour3.heic differ diff --git a/phpmon/Assets.xcassets/Tour/Tour.Isolation.imageset/Contents.json b/phpmon/Assets.xcassets/Tour/Tour.Isolation.imageset/Contents.json new file mode 100644 index 0000000..4dfdc53 --- /dev/null +++ b/phpmon/Assets.xcassets/Tour/Tour.Isolation.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "tour4.heic", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/phpmon/Assets.xcassets/Tour/Tour.Isolation.imageset/tour4.heic b/phpmon/Assets.xcassets/Tour/Tour.Isolation.imageset/tour4.heic new file mode 100644 index 0000000..e9f37f8 Binary files /dev/null and b/phpmon/Assets.xcassets/Tour/Tour.Isolation.imageset/tour4.heic differ diff --git a/phpmon/Assets.xcassets/Tour/Tour.MenuBar.imageset/Contents.json b/phpmon/Assets.xcassets/Tour/Tour.MenuBar.imageset/Contents.json new file mode 100644 index 0000000..e430b0e --- /dev/null +++ b/phpmon/Assets.xcassets/Tour/Tour.MenuBar.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "tour2.heic", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/phpmon/Assets.xcassets/Tour/Tour.MenuBar.imageset/tour2.heic b/phpmon/Assets.xcassets/Tour/Tour.MenuBar.imageset/tour2.heic new file mode 100644 index 0000000..9bb7f6f Binary files /dev/null and b/phpmon/Assets.xcassets/Tour/Tour.MenuBar.imageset/tour2.heic differ diff --git a/phpmon/Domain/SwiftUI/Onboarding/OnboardingView.swift b/phpmon/Domain/SwiftUI/Onboarding/OnboardingView.swift index 1003b90..569e543 100644 --- a/phpmon/Domain/SwiftUI/Onboarding/OnboardingView.swift +++ b/phpmon/Domain/SwiftUI/Onboarding/OnboardingView.swift @@ -10,41 +10,66 @@ import SwiftUI struct OnboardingView: View { var body: some View { - HStack(alignment: .top) { - Image(nsImage: NSApp.applicationIconImage) - .resizable() - .padding() - .frame(width: 120, height: 120) - VStack(alignment: .leading) { - Text("Welcome to PHP Monitor!") + VStack(alignment: .center) { + Image(nsImage: NSApp.applicationIconImage) + .resizable() + .frame(width: 90, height: 90) + Text("onboarding.welcome".localized) .font(.title) .bold() .padding(.bottom, 5) - Text("If you're seeing this message, then the app has successfully started without any issues. That's honestly the hardest part — from now on I hope it's smooth sailing for you.") + Text("onboarding.explore".localized) .padding(.bottom) - VStack(alignment: .leading) { - Text("Switch PHP versions").font(.headline) - Text("Manage your domains").font(.headline) - Text("Domain-specific PHP version isolation").font(.headline) - Text("Find your configuration files").font(.headline) + TabView { + VStack { + Image("Tour.MenuBar") + .resizable() + .aspectRatio(contentMode: .fit) + .padding(.top) + Text("onboarding.tour.menu_bar".localized) + .padding(.init(top: 5, leading: 20, bottom: 20, trailing: 20)) + }.tabItem { Label("onboarding.tour.menu_bar.title".localized, systemImage: "") } + VStack { + Image("Tour.Domains") + .resizable() + .aspectRatio(contentMode: .fit) + .padding(.top) + Text("onboarding.tour.domains".localized) + .padding(.init(top: 5, leading: 20, bottom: 20, trailing: 20)) + }.tabItem { Label("onboarding.tour.domains.title".localized, systemImage: "") } + VStack { + Image("Tour.Isolation") + .resizable() + .aspectRatio(contentMode: .fit) + .padding(.top) + Text("onboarding.tour.isolation".localized) + .padding(.init(top: 5, leading: 20, bottom: 20, trailing: 20)) + }.tabItem { Label("onboarding.tour.isolation.title".localized, systemImage: "") } } - Text("I hope you find the app as useful as I do. Enjoy, and if you can, please consider supporting the app. Thank you!") - .padding(.top) - .padding(.bottom) - VStack(alignment: .leading) { - Button("Get Started") { - // - } + Text("onboarding.tour.once".localized) + .font(.subheadline) + .foregroundColor(.gray) + .padding(.top, 5) + Button("Close Tour") { + } - }.frame(maxWidth: .infinity) - }.padding(20) + } + .frame(maxWidth: .infinity) + .padding() } } struct OnboardingView_Previews: PreviewProvider { static var previews: some View { - OnboardingView().frame( - width: 600 - ) + Group { + OnboardingView().frame( + width: 600, + height: 600 + ) + OnboardingView().preferredColorScheme(.dark).frame( + width: 600, + height: 600 + ) + } } } diff --git a/phpmon/Localizable.strings b/phpmon/Localizable.strings index 36fd8a9..1bcc5c5 100644 --- a/phpmon/Localizable.strings +++ b/phpmon/Localizable.strings @@ -497,3 +497,15 @@ You can do this by running `composer global update` in your terminal. After that "alert.warnings.tld_issue.title" = "You are not using `.test` as the TLD for Valet."; "alert.warnings.tld_issue.subtitle" = "Using a non-default TLD may not work correctly and is not officially supported."; "alert.warnings.tld_issue.description" = "PHP Monitor will remain functional, but there might be issues: the app might not correctly show which domains have been secured. For optimal results, go to your Valet configuration file (config.json in the Valet directory) and change the TLD back to `test`."; + +// ONBOARDING + +"onboarding.welcome" = "Welcome to PHP Monitor!"; +"onboarding.explore" = "Explore some of the features below, or close the tour and get started."; +"onboarding.tour.menu_bar.title" = "Get Started"; +"onboarding.tour.menu_bar" = "PHP Monitor lives in your menu bar. From here, you can switch the globally linked PHP version, start or stop services, locate configuration files, and more."; +"onboarding.tour.domains.title" = "Domains"; +"onboarding.tour.domains" = "By opening the Domains window via the Menu Bar item, you can view which domains are linked and parked."; +"onboarding.tour.isolation.title" = "Isolation"; +"onboarding.tour.isolation" = "If you have Valet 3 installed, you can even use domain isolation by right-clicking on a given domain in the Domains window. This allows you to pick a specific version of PHP to use for that domain!"; +"onboarding.tour.once" = "You will only see the Welcome Tour once. You can re-open the Welcome Tour later via the menu bar icon.";