-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
212 additions
and
47 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
Projects/Core/Sources/Utility/Function/Float + String.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Float + String.swift | ||
// Core | ||
// | ||
// Created by Young Bin on 2023/08/15. | ||
// Copyright © 2023 team.humanwave. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public extension Float { | ||
func toString(floatingPoint: Int = 1) -> String { | ||
String(format: "%.\(floatingPoint)f", self) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
Projects/Core/Sources/Utility/UI/Animation/CustomInteractiveSpringAnimation.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// CustomInteractiveSpringAnimation.swift | ||
// Core | ||
// | ||
// Created by Young Bin on 2023/08/15. | ||
// Copyright © 2023 team.humanwave. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public extension Animation { | ||
// 테스트하고프면 https://www.cssportal.com/css-cubic-bezier-generator/ | ||
static func customInteractiveSpring(duration: CGFloat = 0.5) -> Animation { | ||
.timingCurve(0.175, 0.885, 0.32, 1.05, duration: 0.5) // default: 0.5 | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// DynamicText.swift | ||
// DSKit | ||
// | ||
// Created by Young Bin on 2023/08/15. | ||
// Copyright © 2023 team.humanwave. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public extension Text { | ||
static func keyme(_ text: String, font: Font.KeymeFont) -> Text { | ||
Text(text) | ||
.font(font.value) | ||
.kerning(font.size * (font.kerning / 100)) | ||
} | ||
} |
This file contains 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
51 changes: 51 additions & 0 deletions
51
Projects/DSKit/Sources/MyPage/Detail/ScoreAndPersonalityView.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// ScoreAndPersonalityView.swift | ||
// DSKit | ||
// | ||
// Created by Young Bin on 2023/08/15. | ||
// Copyright © 2023 team.humanwave. All rights reserved. | ||
// | ||
|
||
import Domain | ||
import SwiftUI | ||
|
||
public struct ScoreAndPersonalityView: View { | ||
private let title: String | ||
private let score: Float | ||
|
||
public init(circleData: CircleData) { | ||
self.title = circleData.metadata.keyword | ||
self.score = circleData.metadata.averageScore | ||
} | ||
|
||
public init(title: String, score: Float) { | ||
self.title = title | ||
self.score = score | ||
} | ||
|
||
public var body: some View { | ||
// 상단에 점수표시 | ||
VStack(spacing: 4) { | ||
Text.keyme(title, font: .body5) | ||
.padding(.horizontal, 10) | ||
.padding(.vertical, 5) | ||
.overlay( | ||
RoundedRectangle(cornerRadius: 16) | ||
.fill(Color.white.opacity(0.2)) | ||
.overlay { | ||
RoundedRectangle(cornerRadius: 16) | ||
.stroke(.white, lineWidth: 0.5) | ||
} | ||
) | ||
.foregroundColor(.white) | ||
|
||
HStack(alignment: .bottom) { | ||
Text.keyme(score.toString(), font: .detailPage) | ||
|
||
Text.keyme("점", font: .caption1) | ||
.offset(y: -7) | ||
} | ||
.foregroundColor(DSKitAsset.Color.keymeWhite.swiftUIColor.opacity(0.6)) | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.