Skip to content

Instantly share code, notes, and snippets.

View cyrilzakka's full-sized avatar
💭
coding...

Cyril Zakka, MD cyrilzakka

💭
coding...
View GitHub Profile
@cyrilzakka
cyrilzakka / ContentView.swift
Created September 25, 2023 20:05 — forked from alexwidua/ContentView.swift
SwiftUI Grid Animation
import SwiftUI
// 1. Use looped H/VStacks to create a grid
// 2. Conditionally increase spacing to grow/shrink the grid
// 3. Calculate the distance of each dot to the center and use the value to stagger the animation
//4. Add random delay on top of the staggered delay value
struct ContentView: View {
// const & state