solarium complete

idr most of ts
cleaned up stuff
remove glassbutton
This commit is contained in:
neon443
2025-09-10 21:09:28 +01:00
parent 0b83009b39
commit 7b127127e7
5 changed files with 34 additions and 95 deletions

View File

@@ -96,7 +96,6 @@
A9C897EF2DF1A9A400EF9A5F /* SSHHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C897EE2DF1A9A400EF9A5F /* SSHHandler.swift */; }; A9C897EF2DF1A9A400EF9A5F /* SSHHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C897EE2DF1A9A400EF9A5F /* SSHHandler.swift */; };
A9CC786B2E4E681400FAEE58 /* RecentsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CC786A2E4E681400FAEE58 /* RecentsView.swift */; }; A9CC786B2E4E681400FAEE58 /* RecentsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CC786A2E4E681400FAEE58 /* RecentsView.swift */; };
A9CC786D2E4F534600FAEE58 /* History.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CC786C2E4F534600FAEE58 /* History.swift */; }; A9CC786D2E4F534600FAEE58 /* History.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CC786C2E4F534600FAEE58 /* History.swift */; };
A9D45DD92E7204FF00BA9E4A /* GlassButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D45DD82E7204FF00BA9E4A /* GlassButton.swift */; };
A9D819292E0E904200442D38 /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D819282E0E904200442D38 /* Theme.swift */; }; A9D819292E0E904200442D38 /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D819282E0E904200442D38 /* Theme.swift */; };
A9D8192D2E0E9EB500442D38 /* ThemeManagerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D8192C2E0E9EB500442D38 /* ThemeManagerView.swift */; }; A9D8192D2E0E9EB500442D38 /* ThemeManagerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D8192C2E0E9EB500442D38 /* ThemeManagerView.swift */; };
A9D8192F2E0F1BEE00442D38 /* ThemeButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D8192E2E0F1BEE00442D38 /* ThemeButton.swift */; }; A9D8192F2E0F1BEE00442D38 /* ThemeButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D8192E2E0F1BEE00442D38 /* ThemeButton.swift */; };
@@ -239,7 +238,6 @@
A9C897EE2DF1A9A400EF9A5F /* SSHHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSHHandler.swift; sourceTree = "<group>"; }; A9C897EE2DF1A9A400EF9A5F /* SSHHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSHHandler.swift; sourceTree = "<group>"; };
A9CC786A2E4E681400FAEE58 /* RecentsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentsView.swift; sourceTree = "<group>"; }; A9CC786A2E4E681400FAEE58 /* RecentsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentsView.swift; sourceTree = "<group>"; };
A9CC786C2E4F534600FAEE58 /* History.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = History.swift; sourceTree = "<group>"; }; A9CC786C2E4F534600FAEE58 /* History.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = History.swift; sourceTree = "<group>"; };
A9D45DD82E7204FF00BA9E4A /* GlassButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlassButton.swift; sourceTree = "<group>"; };
A9D819282E0E904200442D38 /* Theme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = "<group>"; }; A9D819282E0E904200442D38 /* Theme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = "<group>"; };
A9D8192C2E0E9EB500442D38 /* ThemeManagerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeManagerView.swift; sourceTree = "<group>"; }; A9D8192C2E0E9EB500442D38 /* ThemeManagerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeManagerView.swift; sourceTree = "<group>"; };
A9D8192E2E0F1BEE00442D38 /* ThemeButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeButton.swift; sourceTree = "<group>"; }; A9D8192E2E0F1BEE00442D38 /* ThemeButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeButton.swift; sourceTree = "<group>"; };
@@ -548,7 +546,6 @@
A93143C52DF61FE300FCD5DB /* ViewModifiers.swift */, A93143C52DF61FE300FCD5DB /* ViewModifiers.swift */,
A96C90A02E12B87900724253 /* TextBox.swift */, A96C90A02E12B87900724253 /* TextBox.swift */,
A9835C3B2E17CCA500969508 /* TrafficLights.swift */, A9835C3B2E17CCA500969508 /* TrafficLights.swift */,
A9D45DD82E7204FF00BA9E4A /* GlassButton.swift */,
); );
path = Misc; path = Misc;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -911,7 +908,6 @@
A9FD37552E143D23005319A8 /* SecKeyConvertible.swift in Sources */, A9FD37552E143D23005319A8 /* SecKeyConvertible.swift in Sources */,
A94B832F2E5B929C00EBA09C /* Backgrounder.swift in Sources */, A94B832F2E5B929C00EBA09C /* Backgrounder.swift in Sources */,
A96C6AFE2E0C43B600F377FE /* Keypair.swift in Sources */, A96C6AFE2E0C43B600F377FE /* Keypair.swift in Sources */,
A9D45DD92E7204FF00BA9E4A /* GlassButton.swift in Sources */,
A90B38322E3E8FC9002B56FC /* AboutView.swift in Sources */, A90B38322E3E8FC9002B56FC /* AboutView.swift in Sources */,
A9C4140C2E096DB7005E3047 /* SSHError.swift in Sources */, A9C4140C2E096DB7005E3047 /* SSHError.swift in Sources */,
A96BE6AA2E116EC000C0FEE9 /* TerminalViewContainer.swift in Sources */, A96BE6AA2E116EC000C0FEE9 /* TerminalViewContainer.swift in Sources */,

View File

@@ -59,28 +59,17 @@ struct KeyImporterView: View {
} }
.preferredColorScheme(.dark) .preferredColorScheme(.dark)
.overlay(alignment: .bottom) { .overlay(alignment: .bottom) {
if #available(iOS 26, *) { Button {
Button { keyManager.importKey(type: keyType, priv: privkeyStr, name: keyName)
UINotificationFeedbackGenerator().notificationOccurred(.success)
} label: { dismiss()
Text("Import") } label: {
Text("Import")
.font(.title) .font(.title)
.bold() .bold()
}
.modifier(glassButton(prominent: true))
} else {
Button() {
keyManager.importKey(type: keyType, priv: privkeyStr, name: keyName)
UINotificationFeedbackGenerator().notificationOccurred(.success)
dismiss()
} label: {
Text("Import")
.font(.title)
.bold()
}
.buttonStyle(.borderedProminent)
.padding(.bottom, 15)
} }
.modifier(glassButton(prominent: true))
.padding(.bottom, 15)
} }
} }
} }

View File

@@ -1,49 +0,0 @@
//
// GlassButton.swift
// ShhShell
//
// Created by neon443 on 10/09/2025.
//
import SwiftUI
struct GlassButton<Label: View>: View {
var action: (() -> Void)
var prominent: Bool = false
@ViewBuilder var label: Label
@ViewBuilder var fallbackLabel: Label
var body: some View {
if #available(iOS 26, *) {
Button {
action()
} label: {
label
}
.buttonStyle(.glassProminent)
} else {
Button {
action()
} label: {
fallbackLabel
}
}
}
}
#Preview {
GlassButton(
action: {
},
prominent: true,
label: {
Text("iOS 26+")
.padding(5)
},
fallbackLabel: {
Text("iOS 26+")
.padding(5)
}
)
}

View File

@@ -23,7 +23,11 @@ struct glassButton: ViewModifier {
content.buttonStyle(.glass) content.buttonStyle(.glass)
} }
} else { } else {
content if prominent {
content.buttonStyle(.borderedProminent)
} else {
content
}
} }
} }
} }

View File

@@ -17,12 +17,12 @@ struct WelcomeView: View {
VStack { VStack {
VStack(spacing: 20) { VStack(spacing: 20) {
if time > 0.1 { if time > 0.1 {
Image("regular") Image("regular")
.resizable().scaledToFit() .resizable().scaledToFit()
.frame(width: 100) .frame(width: 100)
.clipShape(RoundedRectangle(cornerRadius: 22)) .clipShape(RoundedRectangle(cornerRadius: 22))
.shadow(color: .white, radius: time > 0.25 ? 5 : 0) .shadow(color: .white, radius: time > 0.25 ? 5 : 0)
.transition(.scale) .transition(.scale)
} }
if time > 2 { if time > 2 {
Text("Welcome") Text("Welcome")
@@ -33,7 +33,7 @@ struct WelcomeView: View {
.shadow(color: .white, radius: time > 2.25 ? 0 : 5) .shadow(color: .white, radius: time > 2.25 ? 0 : 5)
} }
} }
// .padding(.top, time > 3 ? 25 : 0) // .padding(.top, time > 3 ? 25 : 0)
if time > 3 { if time > 3 {
Spacer() Spacer()
@@ -74,28 +74,27 @@ struct WelcomeView: View {
Spacer() Spacer()
} }
if time > 9 { if time > 9 {
#if swift(>=6.2)
Button("Continue") {
hostsManager.setOnboarding(to: true)
}
.modifier(glassButton(prominent: true))
#else
Button { Button {
hostsManager.setOnboarding(to: true) hostsManager.setOnboarding(to: true)
} label: { } label: {
ZStack { if #available(iOS 19, *) {
Color.terminalGreen
Text("Continue") Text("Continue")
.monospaced() .monospaced()
.bold() .font(.title)
.foregroundStyle(.black) .foregroundStyle(.black)
} else {
ZStack {
Color.terminalGreen
Text("Continue")
.monospaced()
.bold()
.foregroundStyle(.black)
}
.clipShape(RoundedRectangle(cornerRadius: 50))
} }
.clipShape(RoundedRectangle(cornerRadius: 50))
} }
.buttonStyle(.plain) .tint(.terminalGreen)
.frame(width: 300, height: 50) .modifier(glassButton(prominent: true))
.padding(.horizontal, 75)
#endif
} }
} }
.animation(.spring, value: time) .animation(.spring, value: time)