Files
ShhShell/ShhShell/Views/Terminal/CRTView.swift
2025-08-27 15:11:06 +01:00

34 lines
523 B
Swift

//
// CRTView.swift
// ShhShell
//
// Created by neon443 on 25/08/2025.
//
import SwiftUI
struct CRTView: View {
@State var startTime: Date = .now
var body: some View {
TimelineView(.animation) { tl in
let time = tl.date.distance(to: startTime)
Rectangle()
.foregroundStyle(.black.opacity(0.1))
.visualEffect { content, proxy in
content
.colorEffect(
ShaderLibrary.crt(
.float2(proxy.size),
.float(time)
)
)
}
}
}
}
#Preview {
CRTView()
}