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 {
WindowGroup {
ContentView(
handler: sshHandler,
hostsManager: hostsManager,
keyManager: keyManager
)
.colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark)
.tint(hostsManager.tint)
if !NSUbiquitousKeyValueStore.default.bool(forKey: "shownOnboarding") {
WelcomeView()
} else {
ContentView(
handler: sshHandler,
hostsManager: hostsManager,
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
var body: some View {
ZStack {
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
.ignoresSafeArea(.all)

View File

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

View File

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