small upds

This commit is contained in:
neon443
2025-09-24 22:22:33 +01:00
parent 528f04d56b
commit 3b6e5d4a73
4 changed files with 26 additions and 14 deletions

View File

@@ -47,11 +47,13 @@ class HostsManager: ObservableObject, @unchecked Sendable {
loadFonts()
loadSnippets()
loadHistory()
self.shownOnboarding = UserDefaults.standard.bool(forKey: "shownOnboarding")
withAnimation {
self.shownOnboarding = UserDefaults.standard.bool(forKey: "shownOnboarding")
}
}
func setOnboarding(to newValue: Bool) {
self.shownOnboarding = newValue
withAnimation { self.shownOnboarding = newValue }
UserDefaults.standard.set(newValue, forKey: "shownOnboarding")
}

View File

@@ -22,18 +22,22 @@ struct ShhShellApp: App {
var body: some Scene {
WindowGroup {
Group {
ZStack {
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
.ignoresSafeArea(.all)
ContentView(
handler: sshHandler,
hostsManager: hostsManager,
keyManager: keyManager
)
.colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark)
.tint(hostsManager.tint)
if !hostsManager.shownOnboarding {
WelcomeView(hostsManager: hostsManager)
} else {
ContentView(
handler: sshHandler,
hostsManager: hostsManager,
keyManager: keyManager
)
.colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark)
.tint(hostsManager.tint)
.animation(.default, value: hostsManager.shownOnboarding)
.transition(.opacity)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(.black)
}
}
.transition(.opacity)

View File

@@ -50,6 +50,12 @@ struct AboutView: View {
}
}
Button {
hostsManager.setOnboarding(to: false)
} label: {
Text("Show Welcome")
}
NavigationLink {
ShaderTestingView()
} label: {

View File

@@ -17,7 +17,7 @@ struct WelcomeView: View {
VStack {
VStack(spacing: 20) {
if time > 0.1 {
Image("regular")
AppIcon.regular.image
.resizable().scaledToFit()
.frame(width: 100)
.clipShape(RoundedRectangle(cornerRadius: 22))