Created
August 25, 2025 22:48
-
-
Save Archetapp/81a6cb89ea95f48d59f06e472755f850 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ContentView: View { | |
| @State private var startDate = Date() | |
| var body: some View { | |
| VStack(spacing: 40) { | |
| // TV Frame | |
| VStack { | |
| Spacer() | |
| ZStack { | |
| // TV Outer Frame | |
| RoundedRectangle(cornerRadius: 15) | |
| .fill( | |
| LinearGradient( | |
| colors: [ | |
| Color.black, | |
| ], | |
| startPoint: .topLeading, | |
| endPoint: .bottomTrailing | |
| ) | |
| ) | |
| .shadow(color: .black.opacity(0.8), radius: 10, x: 0, y: 10) | |
| // CRT Screen Container | |
| VStack { | |
| GeometryReader { geo in | |
| ZStack { | |
| // Black screen background | |
| RoundedRectangle(cornerRadius: 8) | |
| .fill(Color.white.opacity(0.1)) | |
| // CRT Content | |
| ZStack { | |
| TimelineView(.animation) { _ in | |
| Image("someImage") | |
| .resizable() | |
| .scaledToFill() | |
| .blur(radius: 1.2) | |
| .layerEffect( | |
| ShaderLibrary.crtEffect( | |
| .float(-startDate.timeIntervalSinceNow), | |
| .float2(geo.size) | |
| ), | |
| maxSampleOffset: .zero | |
| ) | |
| .opacity(0.4) | |
| } | |
| Text("Brand") | |
| .fontWidth(.expanded) | |
| .font(.system(size: 32, weight: .heavy, design: .default)) | |
| .foregroundStyle(.white) | |
| .shadow(radius: 10) | |
| .layerEffect( | |
| ShaderLibrary.crtEffect( | |
| .float(-startDate.timeIntervalSinceNow), | |
| .float2(geo.size) | |
| ), | |
| maxSampleOffset: .zero | |
| ) | |
| } | |
| } | |
| .clipShape(RoundedRectangle(cornerRadius: 10)) | |
| } | |
| .aspectRatio(4/3, contentMode: .fit) | |
| } | |
| .padding(5) | |
| } | |
| .aspectRatio(4/3, contentMode: .fit) | |
| } | |
| .padding(.horizontal, 20) | |
| // Buttons Section | |
| VStack(spacing: 16) { | |
| Spacer() | |
| Button("Create Account") { | |
| // Action | |
| } | |
| .frame(maxWidth: .infinity) | |
| .frame(height: 50) | |
| .background( | |
| RoundedRectangle(cornerRadius: 25) | |
| .fill( | |
| LinearGradient( | |
| colors: [Color.white, Color.gray.opacity(0.9)], | |
| startPoint: .top, | |
| endPoint: .bottom | |
| ) | |
| ) | |
| ) | |
| .foregroundColor(.black) | |
| .font(.headline) | |
| .fontWeight(.semibold) | |
| Button("Sign In") { | |
| // Action | |
| } | |
| .frame(maxWidth: .infinity) | |
| .frame(height: 50) | |
| .background( | |
| RoundedRectangle(cornerRadius: 25) | |
| .stroke(Color.white, lineWidth: 2) | |
| ) | |
| .foregroundColor(.white) | |
| .font(.headline) | |
| .fontWeight(.semibold) | |
| } | |
| .padding(.horizontal, 40) | |
| Spacer() | |
| } | |
| .background( | |
| RadialGradient(stops: [ | |
| .init(color: Color(red: 0.1, green: 0.1, blue: 0.15), location: 0), | |
| .init(color: .black, location: 1) | |
| ], center: .center, startRadius: 10, endRadius: 1000) | |
| ) | |
| } | |
| } | |
| #Preview { | |
| ContentView() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment