Files
ShhShell/ShhShell/Views/Terminal/CRTView.swift
neon443 262411049f re add ios 16 support
shaders only show if 17+
blurReplace transitions are opacity with a white shadow for a short time
2025-08-31 22:42:43 +01:00

36 lines
567 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)
if #available(iOS 17, *) {
Rectangle()
.foregroundStyle(.black.opacity(1))
.visualEffect { content, proxy in
content
.colorEffect(
ShaderLibrary.crt(
.float2(proxy.size),
.float(time)
)
)
}
}
}
}
}
#Preview {
CRTView()
}