mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
okay actually got scanlines
but fucked it over when applying it to the app
This commit is contained in:
@@ -9,6 +9,18 @@
|
|||||||
#include <SwiftUI/SwiftUI_Metal.h>
|
#include <SwiftUI/SwiftUI_Metal.h>
|
||||||
using namespace metal;
|
using namespace metal;
|
||||||
|
|
||||||
|
[[ stitchable ]] half4 crt(float2 pos, half4 color, float2 size, float time) {
|
||||||
|
float2 uv = pos/size;
|
||||||
|
|
||||||
|
// scanwave
|
||||||
|
half3 newCol = 0.75 + 0.5 + 0.5 * sin(time + uv.y*10 + half3(0));
|
||||||
|
|
||||||
|
//scanlines
|
||||||
|
newCol *= 0.5 + 0.5 * sin(uv.y * 1000.0 + half3(0));
|
||||||
|
half4 output = half4(color.xyz*newCol, 1);
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
//learning shaders stuff here
|
//learning shaders stuff here
|
||||||
[[ stitchable ]] half4 sinebow(float2 pos, half4 color, float2 size, float time) {
|
[[ stitchable ]] half4 sinebow(float2 pos, half4 color, float2 size, float time) {
|
||||||
float2 uv = (pos/size.x) * 2.0 - 1.0;
|
float2 uv = (pos/size.x) * 2.0 - 1.0;
|
||||||
|
|||||||
@@ -12,91 +12,103 @@ struct ContentView: View {
|
|||||||
@ObservedObject var hostsManager: HostsManager
|
@ObservedObject var hostsManager: HostsManager
|
||||||
@ObservedObject var keyManager: KeyManager
|
@ObservedObject var keyManager: KeyManager
|
||||||
|
|
||||||
|
@State private var spawnTime: Date = .now
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationStack {
|
TimelineView(.animation) { tl in
|
||||||
ZStack {
|
let time = tl.date.distance(to: spawnTime)
|
||||||
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
NavigationStack {
|
||||||
.ignoresSafeArea(.all)
|
ZStack {
|
||||||
List {
|
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||||
SessionsListView(
|
.ignoresSafeArea(.all)
|
||||||
handler: handler,
|
List {
|
||||||
hostsManager: hostsManager,
|
SessionsListView(
|
||||||
keyManager: keyManager
|
handler: handler,
|
||||||
)
|
|
||||||
|
|
||||||
RecentsView(
|
|
||||||
hostsManager: hostsManager,
|
|
||||||
keyManager: keyManager
|
|
||||||
)
|
|
||||||
|
|
||||||
HostsView(
|
|
||||||
handler: handler,
|
|
||||||
hostsManager: hostsManager,
|
|
||||||
keyManager: keyManager
|
|
||||||
)
|
|
||||||
|
|
||||||
Section() {
|
|
||||||
NavigationLink {
|
|
||||||
ThemeManagerView(hostsManager: hostsManager)
|
|
||||||
} label: {
|
|
||||||
Label("Themes", systemImage: "swatchpalette")
|
|
||||||
}
|
|
||||||
NavigationLink {
|
|
||||||
FontManagerView(hostsManager: hostsManager)
|
|
||||||
} label: {
|
|
||||||
Label("Fonts", systemImage: "textformat")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Section {
|
|
||||||
NavigationLink {
|
|
||||||
SnippetManagerView(hostsManager: hostsManager)
|
|
||||||
} label: {
|
|
||||||
Label("Snippets", systemImage: "paperclip")
|
|
||||||
}
|
|
||||||
|
|
||||||
NavigationLink {
|
|
||||||
KeyManagerView(hostsManager: hostsManager, keyManager: keyManager)
|
|
||||||
} label: {
|
|
||||||
Label("Keys", systemImage: "key.fill")
|
|
||||||
}
|
|
||||||
|
|
||||||
NavigationLink {
|
|
||||||
HostkeysView(hostsManager: hostsManager)
|
|
||||||
} label: {
|
|
||||||
Label("Hostkey Fingerprints", systemImage: "lock.display")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Section {
|
|
||||||
NavigationLink {
|
|
||||||
SettingsView(hostsManager: hostsManager, keyManager: keyManager)
|
|
||||||
} label: {
|
|
||||||
Label("Settings", systemImage: "gear")
|
|
||||||
}
|
|
||||||
NavigationLink {
|
|
||||||
AboutView(hostsManager: hostsManager)
|
|
||||||
} label: {
|
|
||||||
Label("About", systemImage: "info.square")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.scrollContentBackground(.hidden)
|
|
||||||
}
|
|
||||||
.navigationTitle("ShhShell")
|
|
||||||
.toolbar {
|
|
||||||
ToolbarItem(placement: .confirmationAction) {
|
|
||||||
NavigationLink {
|
|
||||||
ConnectionView(
|
|
||||||
handler: SSHHandler(host: Host.blank, keyManager: keyManager),
|
|
||||||
hostsManager: hostsManager,
|
hostsManager: hostsManager,
|
||||||
keyManager: keyManager
|
keyManager: keyManager
|
||||||
)
|
)
|
||||||
} label: {
|
|
||||||
Label("Add", systemImage: "plus")
|
RecentsView(
|
||||||
|
hostsManager: hostsManager,
|
||||||
|
keyManager: keyManager
|
||||||
|
)
|
||||||
|
|
||||||
|
HostsView(
|
||||||
|
handler: handler,
|
||||||
|
hostsManager: hostsManager,
|
||||||
|
keyManager: keyManager
|
||||||
|
)
|
||||||
|
|
||||||
|
Section() {
|
||||||
|
NavigationLink {
|
||||||
|
ThemeManagerView(hostsManager: hostsManager)
|
||||||
|
} label: {
|
||||||
|
Label("Themes", systemImage: "swatchpalette")
|
||||||
|
}
|
||||||
|
NavigationLink {
|
||||||
|
FontManagerView(hostsManager: hostsManager)
|
||||||
|
} label: {
|
||||||
|
Label("Fonts", systemImage: "textformat")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
NavigationLink {
|
||||||
|
SnippetManagerView(hostsManager: hostsManager)
|
||||||
|
} label: {
|
||||||
|
Label("Snippets", systemImage: "paperclip")
|
||||||
|
}
|
||||||
|
|
||||||
|
NavigationLink {
|
||||||
|
KeyManagerView(hostsManager: hostsManager, keyManager: keyManager)
|
||||||
|
} label: {
|
||||||
|
Label("Keys", systemImage: "key.fill")
|
||||||
|
}
|
||||||
|
|
||||||
|
NavigationLink {
|
||||||
|
HostkeysView(hostsManager: hostsManager)
|
||||||
|
} label: {
|
||||||
|
Label("Hostkey Fingerprints", systemImage: "lock.display")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
NavigationLink {
|
||||||
|
SettingsView(hostsManager: hostsManager, keyManager: keyManager)
|
||||||
|
} label: {
|
||||||
|
Label("Settings", systemImage: "gear")
|
||||||
|
}
|
||||||
|
NavigationLink {
|
||||||
|
AboutView(hostsManager: hostsManager)
|
||||||
|
} label: {
|
||||||
|
Label("About", systemImage: "info.square")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.scrollContentBackground(.hidden)
|
||||||
|
}
|
||||||
|
.navigationTitle("ShhShell")
|
||||||
|
.toolbar {
|
||||||
|
ToolbarItem(placement: .confirmationAction) {
|
||||||
|
NavigationLink {
|
||||||
|
ConnectionView(
|
||||||
|
handler: SSHHandler(host: Host.blank, keyManager: keyManager),
|
||||||
|
hostsManager: hostsManager,
|
||||||
|
keyManager: keyManager
|
||||||
|
)
|
||||||
|
} label: {
|
||||||
|
Label("Add", systemImage: "plus")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.visualEffect { content, proxy in
|
||||||
|
content
|
||||||
|
.colorEffect(ShaderLibrary.crt(
|
||||||
|
.float2(proxy.size),
|
||||||
|
.float(time)
|
||||||
|
))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user