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 a907480d1e
6 changed files with 37 additions and 96 deletions

View File

@@ -18,7 +18,9 @@ struct HostSymbolPreview: View {
symbol.image
.resizable().scaledToFit()
.symbolRenderingMode(.monochrome)
Text(label)
if !label.isEmpty {
Text(label)
}
}
} else {
ZStack(alignment: .center) {

View File

@@ -59,28 +59,17 @@ struct KeyImporterView: View {
}
.preferredColorScheme(.dark)
.overlay(alignment: .bottom) {
if #available(iOS 26, *) {
Button {
} label: {
Text("Import")
Button {
keyManager.importKey(type: keyType, priv: privkeyStr, name: keyName)
UINotificationFeedbackGenerator().notificationOccurred(.success)
dismiss()
} label: {
Text("Import")
.font(.title)
.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)
}
} else {
content
if prominent {
content.buttonStyle(.borderedProminent)
} else {
content
}
}
}
}

View File

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