Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryanlintott/DefibHeart
https://github.com/ryanlintott/DefibHeart
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ryanlintott/DefibHeart
- Owner: ryanlintott
- Created: 2022-05-24T21:01:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-24T21:20:17.000Z (over 2 years ago)
- Last Synced: 2024-04-13T07:25:24.225Z (7 months ago)
- Language: Swift
- Size: 13.7 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- fucking-open-source-ios-apps - SwiftUI Series - DefibHeart animation
README
# DefibHeart
We spend a lot of time looking at heart icons but not thinking about the organ they represent. I've had my life saved by a defibrillator and I now have one with me at all times in the form of a pacemaker. I thought it would be a nice to use a defib to bring a heart animation to life.
![Defib Heart](https://user-images.githubusercontent.com/2143656/170134149-95c59fd9-4770-4ce2-b455-043589ef5fe0.gif)
*Submission for [SwiftUISeries](https://www.swiftuiseries.com) - Animations*
# How does it work?
- All values are linked to a single size value so it can easily be resized.
- I created an enum called Keyframe and cycled through the values to trigger each key of the animation in sequence. The delay parameter ensures each keyframe is appropriately staggered.
- The beating heart at the end was a bit tricky and required a local .animation modifier to override the other animations.
- The shapes are each drawn separately with some help from package I made called: