Created
June 27, 2025 10:54
-
-
Save georgecartridge/7a97b8b89e7243a8a7a9aa43d97512eb to your computer and use it in GitHub Desktop.
This is a staggered text animation based on the Arc onboarding intro - using the AnimateText swift package (https://github.com/jasudev/AnimateText)
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
| public struct StaggerTextEffect: ATTextAnimateEffect { | |
| public var data: ATElementData | |
| public var userInfo: Any? | |
| public init(_ data: ATElementData, _ userInfo: Any?) { | |
| self.data = data | |
| self.userInfo = userInfo | |
| } | |
| public func body(content: Content) -> some View { | |
| content | |
| .opacity(data.value) | |
| .blur(radius: 10 - 10 * data.value) | |
| .rotation3DEffect(Angle(degrees: 20 * data.invValue), axis: (x: 0, y: 0, z: 1), anchor: .bottomLeading, anchorZ: 0, perspective: 0.7) | |
| .offset(x: 0, y: data.invValue * (data.size.height * 1)) | |
| .animation(.spring(duration: 0.6, bounce: 0.26).delay(Double(data.index) * 0.02), value: data.value) | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can then use it in a view: