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 AnimatedBorder: View { | |
@State private var phase: CGFloat = 0 | |
let cornerRadius: CGFloat = 25 | |
let dashPattern: [CGFloat] = [15, 15] | |
let lineWidth: CGFloat = 4 | |
var body: some View { | |
ZStack { |
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 | |
import MetalKit | |
import simd | |
// MARK: - Metal View | |
struct MetalStarfieldView: UIViewRepresentable { | |
@Binding var speed: Double | |
@Binding var cameraShake: CGSize | |
let hyperdriveCallback: () -> Void |
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 Metal | |
import MetalKit | |
import SwiftUI | |
final class Coordinator: NSObject, MTKViewDelegate { | |
// MARK: Metal setup | |
private let device: MTLDevice | |
private let commandQueue: MTLCommandQueue | |
private let pipeline: MTLRenderPipelineState |
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 UIKit | |
import CoreImage | |
public extension UIImage { | |
/// Draws a rounded, solid‐color outline around this image’s alpha shape, | |
/// then composites the full-color image back in the center. | |
/// | |
/// - Parameters: | |
/// - strokeColor: the color of the ring | |
/// - strokeWidth: the thickness of the ring (in points) |
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
/* Flags */ | |
.flag { | |
display: flex; | |
width: 28px; | |
height: 28px; | |
align-items: center; | |
justify-content: center; | |
} | |
.flag:after { |