mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 05:19:13 +00:00
changed how the crt effect and terminal blend, now the colors arent washed out
This commit is contained in:
@@ -22,12 +22,12 @@ using namespace metal;
|
|||||||
|
|
||||||
//scanlines
|
//scanlines
|
||||||
half scanline = 0.5 + 0.5 * sin(uv.y * 1250.0);
|
half scanline = 0.5 + 0.5 * sin(uv.y * 1250.0);
|
||||||
scanline *= 0.5;
|
// scanline *= 0.5;
|
||||||
|
|
||||||
half3 newColor = scanwave*scanline;
|
half3 newColor = scanwave*scanline;
|
||||||
|
|
||||||
half alpha = 1 - scanline;
|
half alpha = 1 - scanline;
|
||||||
alpha *= 0.5;
|
alpha *= 1;
|
||||||
|
|
||||||
// half4 output = half4(layer.sample(pos).xyz*newCol, 1);
|
// half4 output = half4(layer.sample(pos).xyz*newCol, 1);
|
||||||
half4 output = half4(color.xyz*newColor*alpha, alpha);
|
half4 output = half4(color.xyz*newColor*alpha, alpha);
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func cursorStyleChanged(source: Terminal, newStyle: CursorStyle) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func startFeedLoop() {
|
func startFeedLoop() {
|
||||||
Task {
|
Task {
|
||||||
guard let handler else { return }
|
guard let handler else { return }
|
||||||
@@ -59,6 +63,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
|
|||||||
if let read = handler.readFromChannel() {
|
if let read = handler.readFromChannel() {
|
||||||
await MainActor.run {
|
await MainActor.run {
|
||||||
self.feed(text: read)
|
self.feed(text: read)
|
||||||
|
print(getTerminal().getCursorLocation())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try? await Task.sleep(nanoseconds: 10_000_000) //10ms
|
try? await Task.sleep(nanoseconds: 10_000_000) //10ms
|
||||||
|
|||||||
@@ -16,34 +16,35 @@ struct ShellView: View {
|
|||||||
|
|
||||||
@Environment(\.dismiss) var dismiss
|
@Environment(\.dismiss) var dismiss
|
||||||
|
|
||||||
@State var startTime: Date = .now
|
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationStack {
|
NavigationStack {
|
||||||
let time = startTime.timeIntervalSinceNow
|
|
||||||
ZStack {
|
ZStack {
|
||||||
hostsManager.selectedTheme.background.suiColor
|
hostsManager.selectedTheme.background.suiColor
|
||||||
.ignoresSafeArea(.all)
|
.ignoresSafeArea(.all)
|
||||||
|
|
||||||
TerminalController(handler: handler, hostsManager: hostsManager)
|
ZStack {
|
||||||
// .visualEffect { content, proxy in
|
TerminalController(handler: handler, hostsManager: hostsManager)
|
||||||
// content
|
.colorMultiply(Color(red: 0.95, green: 1, blue: 0.95, opacity: 1))
|
||||||
// .layerEffect(
|
.colorMultiply(.white)
|
||||||
// ShaderLibrary.crt(
|
// .visualEffect { content, proxy in
|
||||||
// .float2(proxy.size),
|
// content
|
||||||
// .float(time)
|
// .layerEffect(
|
||||||
// ),
|
// ShaderLibrary.crt(
|
||||||
// maxSampleOffset: .zero
|
// .float2(proxy.size),
|
||||||
// )
|
// .float(time)
|
||||||
// }
|
// ),
|
||||||
// .blendMode(.screen)
|
// maxSampleOffset: .zero
|
||||||
.overlay {
|
// )
|
||||||
if hostsManager.settings.filter == .crt {
|
// }
|
||||||
CRTView()
|
.overlay {
|
||||||
.opacity(0.75)
|
if hostsManager.settings.filter == .crt {
|
||||||
.allowsHitTesting(false)
|
CRTView()
|
||||||
|
.opacity(0.75)
|
||||||
|
.blendMode(.overlay)
|
||||||
|
.allowsHitTesting(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
Color.gray.opacity(0.2)
|
Color.gray.opacity(0.2)
|
||||||
|
|||||||
Reference in New Issue
Block a user