implement onboarding

update welcomeview to fit everything on screen
This commit is contained in:
neon443
2025-08-28 20:09:57 +01:00
parent ffc62b3f34
commit 02131e798c
4 changed files with 16 additions and 11 deletions

View File

@@ -22,13 +22,18 @@ struct ShhShellApp: App {
var body: some Scene { var body: some Scene {
WindowGroup { WindowGroup {
ContentView( if !NSUbiquitousKeyValueStore.default.bool(forKey: "shownOnboarding") {
handler: sshHandler, WelcomeView()
hostsManager: hostsManager, } else {
keyManager: keyManager ContentView(
) handler: sshHandler,
.colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark) hostsManager: hostsManager,
.tint(hostsManager.tint) keyManager: keyManager
)
.transition(.opacity)
.colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark)
.tint(hostsManager.tint)
}
} }
} }
} }

View File

@@ -11,7 +11,6 @@ struct AboutView: View {
@ObservedObject var hostsManager: HostsManager @ObservedObject var hostsManager: HostsManager
var body: some View { var body: some View {
ZStack { ZStack {
hostsManager.selectedTheme.background.suiColor.opacity(0.7) hostsManager.selectedTheme.background.suiColor.opacity(0.7)
.ignoresSafeArea(.all) .ignoresSafeArea(.all)

View File

@@ -38,6 +38,7 @@ struct WelcomeChunk: View {
.foregroundStyle(.gray) .foregroundStyle(.gray)
.font(.footnote) .font(.footnote)
.transition(.blurReplace) .transition(.blurReplace)
.lineLimit(nil)
.multilineTextAlignment(.leading) .multilineTextAlignment(.leading)
} }
} }

View File

@@ -32,7 +32,7 @@ struct WelcomeView: View {
.transition(.blurReplace) .transition(.blurReplace)
} }
} }
.padding(.top, time > 3 ? 50 : 0) // .padding(.top, time > 3 ? 25 : 0)
if time > 3 { if time > 3 {
Spacer() Spacer()
@@ -90,13 +90,13 @@ struct WelcomeView: View {
.clipShape(RoundedRectangle(cornerRadius: 50)) .clipShape(RoundedRectangle(cornerRadius: 50))
} }
.buttonStyle(.plain) .buttonStyle(.plain)
.frame(width: .infinity, height: 50) .frame(width: 300, height: 50)
.padding(.horizontal, 75) .padding(.horizontal, 75)
#endif #endif
} }
} }
.onDisappear { .onDisappear {
NSUbiquitousKeyValueStore.default.set(true, forKey: "shownOnboarding")
} }
.animation(.spring, value: time) .animation(.spring, value: time)
.preferredColorScheme(.dark) .preferredColorScheme(.dark)