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() loadFonts()
loadSnippets() loadSnippets()
loadHistory() loadHistory()
withAnimation {
self.shownOnboarding = UserDefaults.standard.bool(forKey: "shownOnboarding") self.shownOnboarding = UserDefaults.standard.bool(forKey: "shownOnboarding")
} }
}
func setOnboarding(to newValue: Bool) { func setOnboarding(to newValue: Bool) {
self.shownOnboarding = newValue withAnimation { self.shownOnboarding = newValue }
UserDefaults.standard.set(newValue, forKey: "shownOnboarding") UserDefaults.standard.set(newValue, forKey: "shownOnboarding")
} }

View File

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

View File

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

View File

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