Forked from davejacobsen/Reminders App Icon in SwiftUI
Created
January 11, 2022 14:54
-
-
Save codeactual/3be149a82c5e6ba5b4b424ba3c165a36 to your computer and use it in GitHub Desktop.
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
| // | |
| // RemindersAppIcon.swift | |
| // RemindersAppIcon | |
| // | |
| // Created by David on 1/5/22. | |
| // | |
| import SwiftUI | |
| struct RemindersAppIcon: View { | |
| var body: some View { | |
| GeometryReader { geo in | |
| let iconHeight = geo.size.height | |
| ZStack { | |
| RoundedRectangle(cornerRadius: iconHeight * 0.2) | |
| .foregroundColor(Color.white) | |
| VStack(spacing: iconHeight * -0.25) { | |
| ReminderRow(color: .blue, iconHeight: iconHeight) | |
| ReminderRow(color: .red, iconHeight: iconHeight) | |
| ReminderRow(color: .orange, iconHeight: iconHeight) | |
| } | |
| } | |
| } | |
| } | |
| } | |
| struct ReminderRow: View { | |
| let color: Color | |
| let iconHeight: CGFloat | |
| var body: some View { | |
| HStack(spacing: iconHeight * 0.115) { | |
| ZStack { | |
| Circle() | |
| .frame(width: iconHeight * 0.1) | |
| Circle() | |
| .stroke(lineWidth: iconHeight * 0.015) | |
| .frame(width: iconHeight * 0.15) | |
| } | |
| .offset(x: iconHeight * -0.01, y: 0) | |
| .foregroundColor(color) | |
| RoundedRectangle(cornerRadius: iconHeight * 0.01) | |
| .frame(width: iconHeight * 0.5, height: iconHeight * 0.015) | |
| .foregroundColor(.gray.opacity(0.6)) | |
| .blur(radius: 0.3) | |
| } | |
| } | |
| } | |
| struct RemindersAppIcon_Previews: PreviewProvider { | |
| static var previews: some View { | |
| ZStack { | |
| RemindersAppIcon() | |
| .frame(width: 100, height: 100) | |
| } | |
| .frame(width: 150, height: 150) | |
| .background(Color.gray) | |
| .previewLayout(.sizeThatFits) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment