Skip to content

Commit

Permalink
[Feat] ShortcutIcon 수정
Browse files Browse the repository at this point in the history
- 기존 RoundedRectanlge -> sf symbol의 app 이미지 사용
  • Loading branch information
JMM00 committed May 2, 2024
1 parent 6b5861b commit 0968851
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 6 deletions.
24 changes: 24 additions & 0 deletions HappyAnding/HappyAnding/Assets.xcassets/app.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
3 changes: 3 additions & 0 deletions HappyAnding/HappyAnding/Assets.xcassets/app.imageset/app.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 13 additions & 6 deletions HappyAnding/HappyAnding/Views/Components/ShortcutIcon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import SwiftUI

//TODO: 추후 사이즈별 아이콘 크기 조절 필요
struct ShortcutIcon: View {
@Environment(\.colorScheme) var colorScheme

Expand All @@ -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)
}

0 comments on commit 0968851

Please sign in to comment.