From 0968851ade69f71ded31ac20f72f26dcadefcc3b Mon Sep 17 00:00:00 2001 From: jeonjimin Date: Thu, 2 May 2024 17:06:40 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20ShortcutIcon=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 기존 RoundedRectanlge -> sf symbol의 app 이미지 사용 --- .../app.imageset/Contents.json | 24 +++++++++++++++++++ .../Assets.xcassets/app.imageset/app.svg | 3 +++ .../appLarge.imageset/Contents.json | 24 +++++++++++++++++++ .../appLarge.imageset/appLarge.svg | 3 +++ .../Views/Components/ShortcutIcon.swift | 19 ++++++++++----- 5 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 HappyAnding/HappyAnding/Assets.xcassets/app.imageset/Contents.json create mode 100644 HappyAnding/HappyAnding/Assets.xcassets/app.imageset/app.svg create mode 100644 HappyAnding/HappyAnding/Assets.xcassets/appLarge.imageset/Contents.json create mode 100644 HappyAnding/HappyAnding/Assets.xcassets/appLarge.imageset/appLarge.svg diff --git a/HappyAnding/HappyAnding/Assets.xcassets/app.imageset/Contents.json b/HappyAnding/HappyAnding/Assets.xcassets/app.imageset/Contents.json new file mode 100644 index 00000000..2be286fa --- /dev/null +++ b/HappyAnding/HappyAnding/Assets.xcassets/app.imageset/Contents.json @@ -0,0 +1,24 @@ +{ + "images" : [ + { + "filename" : "app.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/HappyAnding/HappyAnding/Assets.xcassets/app.imageset/app.svg b/HappyAnding/HappyAnding/Assets.xcassets/app.imageset/app.svg new file mode 100644 index 00000000..c70e67bf --- /dev/null +++ b/HappyAnding/HappyAnding/Assets.xcassets/app.imageset/app.svg @@ -0,0 +1,3 @@ + + + diff --git a/HappyAnding/HappyAnding/Assets.xcassets/appLarge.imageset/Contents.json b/HappyAnding/HappyAnding/Assets.xcassets/appLarge.imageset/Contents.json new file mode 100644 index 00000000..2d4082a0 --- /dev/null +++ b/HappyAnding/HappyAnding/Assets.xcassets/appLarge.imageset/Contents.json @@ -0,0 +1,24 @@ +{ + "images" : [ + { + "filename" : "appLarge.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/HappyAnding/HappyAnding/Assets.xcassets/appLarge.imageset/appLarge.svg b/HappyAnding/HappyAnding/Assets.xcassets/appLarge.imageset/appLarge.svg new file mode 100644 index 00000000..c4fb9a0c --- /dev/null +++ b/HappyAnding/HappyAnding/Assets.xcassets/appLarge.imageset/appLarge.svg @@ -0,0 +1,3 @@ + + + diff --git a/HappyAnding/HappyAnding/Views/Components/ShortcutIcon.swift b/HappyAnding/HappyAnding/Views/Components/ShortcutIcon.swift index 22798259..e00b6905 100644 --- a/HappyAnding/HappyAnding/Views/Components/ShortcutIcon.swift +++ b/HappyAnding/HappyAnding/Views/Components/ShortcutIcon.swift @@ -7,6 +7,7 @@ import SwiftUI +//TODO: 추후 사이즈별 아이콘 크기 조절 필요 struct ShortcutIcon: View { @Environment(\.colorScheme) var colorScheme @@ -16,17 +17,23 @@ struct ShortcutIcon: View { var body: some View { ZStack { - RoundedRectangle(cornerRadius: 13) - .foregroundStyle(SCZColor.colors[color]?.color(for: colorScheme).fillGradient() ?? Color.clear.toGradient()) - .roundedBorder(cornerRadius: 13, color: .white, isNormalBlend: true, opacity: 0.24) + Image(systemName: "app.fill") + .resizable() + .scaledToFit() .frame(width: size, height: size) + .foregroundStyle(SCZColor.colors[color]?.color(for: colorScheme).fillGradient() ?? Color.clear.toGradient()) + Image(size>50 ? "appLarge" : "app") + .resizable() + .scaledToFit() + .frame(width: size, height: size) + .foregroundStyle(SCZColor.colors[color]?.color(for: colorScheme).strokeGradient() ?? Color.clear.toGradient()) Image(systemName: sfSymbol) - .font(.system(size: size/2 - 5)) + .font(.system(size: size/2)) .foregroundStyle(Color.white) } } } - + #Preview { - ShortcutIcon(sfSymbol: "play.rectangle.fill", color: "Red", size: 56) + ShortcutIcon(sfSymbol: "alarm.fill", color: "Yellow", size: 96) }