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 Star: Hashable, Identifiable { | |
| var id = UUID() | |
| var color: Color | |
| var speed: Double | |
| static var sun: Star { | |
| Star(color: .red.mix(with: .orange, by: 0.2), speed: 1) | |
| } |
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 | |
| // MARK: - Exercise Data Model | |
| struct ExerciseSet: Identifiable { | |
| let id = UUID() | |
| var weight: Double | |
| var reps: Int | |
| var isCompleted: Bool = false | |
| } |
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 FinancialHealthSheetPreview: View { | |
| @State private var showFinancialHealthSheet = false | |
| var body: some View { | |
| VStack { | |
| Button(action: { | |
| showFinancialHealthSheet.toggle() | |
| }, label: { | |
| HStack { |
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 var start: Date = .now | |
| var body: some View { | |
| TimelineView(.animation) { context in | |
| let progress = context.date.timeIntervalSince(start) / 10 | |
| ZStack { | |
| Sphere(color: .red).frame(width: 30) |
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
| // Workout data model | |
| struct WorkoutData { | |
| let name: String | |
| let date: Date | |
| let duration: TimeInterval | |
| let exerciseCount: Int | |
| let effortPercentage: Double | |
| } | |
| struct WorkoutExpandedCard: View { |
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 | |
| // https://x.com/TAAT626/status/1895841081365053901 | |
| // https://gist.github.com/TAATHub/8f9e7d987c82ef0eea62d2e420d51144 | |
| struct CountdownView: View { | |
| @State private var counter = Counter() | |
| var body: some View { | |
| let radius = 120.0 | |
| 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
| // Modified TAATHub/GradientBorderAnimation.swift on 2025/03/01, Y.Nagatomo | |
| // https://gist.github.com/TAATHub/0d312611e0b31265f85d3c555bf43039 | |
| // Gradient Border Animation | |
| // See Also: https://x.com/sucodeee/status/1894700908824395843 | |
| import SwiftUI | |
| struct ContentView: View { | |
| @State var rotation: CGFloat = 0 | |
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
| // Copyright © 2025 MING | |
| // MIT License | |
| import SwiftUI | |
| struct ContentView: View { | |
| @State private var colorful: Bool = true | |
| @State private var dragLocation: CGPoint = .zero | |
| var body: some View { |
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
| // Gradient Border Animation | |
| // See Also: https://x.com/sucodeee/status/1894700908824395843 | |
| import SwiftUI | |
| struct ContentView: View { | |
| @State var rotation: CGFloat = 0 | |
| var body: some View { | |
| VStack(spacing: 40) { |
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 HPicker<SelectionValue, Content>: View where SelectionValue: Hashable, Content: View { | |
| private var items: [SelectionValue] | |
| private var numberOfDisplays: Int | |
| private var content: (SelectionValue) -> Content | |
| @Binding private var selection: SelectionValue? | |
| @State private var contentOffset: Double = 0 | |
| @State private var itemWidth: Double = 100.0 |