Skip to content

Instantly share code, notes, and snippets.

@StarWars
StarWars / Spiral.swift
Created January 5, 2025 19:32 — forked from Koshimizu-Takehito/Spiral.swift
アルキメデスのらせん
import SwiftUI
struct ContentView: View {
@State var start = Date()
var body: some View {
TimelineView(.animation) { context in
let time = context.date.timeIntervalSince(start) / 120
let rotation = 0.8 + 0.2 * abs((cos(.pi * time) + 1.0) / 2.0)
Canvas { context, size in