mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 05:19:13 +00:00
34 lines
523 B
Swift
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()
|
|
}
|