Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [#481] ShareMatchView UI #483

Merged
merged 10 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added SoccerBeat/Common/Fonts/SF-Compact-Text-Thin.otf
Binary file not shown.
Binary file added SoccerBeat/Common/Fonts/SF-Pro-Text-Semibold.otf
Binary file not shown.
Binary file added SoccerBeat/Common/Fonts/TurretRoad-ExtraBold.ttf
Binary file not shown.
3 changes: 3 additions & 0 deletions SoccerBeat/Common/Resource/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<string>SF-Pro-Text-Medium.otf</string>
<string>SF-Pro-Text-Light.otf</string>
<string>SF-Pro-Text-MediumItalic.otf</string>
<string>SF-Pro-Text-Semibold.otf</string>
<string>SF-Compact-Text-Thin.otf</string>
<string>TurretRoad-ExtraBold.ttf</string>
</array>
</dict>
</plist>
12 changes: 12 additions & 0 deletions SoccerBeat/Common/Resource/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,9 @@
}
}
}
},
"GAMETIME" : {

},
"Heartbeat" : {
"localizations" : {
Expand Down Expand Up @@ -1553,6 +1556,9 @@
}
}
}
},
"SOCCERBEAT" : {

},
"SoccerBeat의 κ²½κΈ° 데이터 뢄석을 μœ„ν•΄ μ‚¬μš©λ©λ‹ˆλ‹€." : {
"comment" : "데이터 μ‚¬μš©μ²˜",
Expand Down Expand Up @@ -3386,6 +3392,9 @@
}
}
}
},
"μŠ€ν† λ¦¬ κ³΅μœ ν•˜κΈ°" : {

},
"μŠ€ν”„λ¦°νŠΈ" : {
"comment" : "μŠ€ν”„λ¦°νŠΈ",
Expand Down Expand Up @@ -4208,6 +4217,9 @@
}
}
}
},
"이미지 μ €μž₯ν•˜κΈ°" : {

},
"일" : {
"comment" : "λ‚ μ§œ λ‹¨μœ„ (2nd, 17th,_",
Expand Down
12 changes: 12 additions & 0 deletions SoccerBeat/Common/Utiles/Color+extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ extension ShapeStyle where Self == Color {
static var heatmap80: Self { .init(hex: 0xffdf30, alpha: 0.65)}
static var heatmap90: Self { .init(hex: 0xfff730, alpha: 0.65)}
// yellow


// MARK: - Share Match
static var shareButtonTint: Self {
Color(hex: 0x565656, alpha: 0.3)
}
}

extension ShapeStyle where Self == LinearGradient {
Expand Down Expand Up @@ -344,4 +350,10 @@ extension ShapeStyle where Self == LinearGradient {
let end = Color(hex: 0xFF007A)
return .linearGradient(colors: [start, end], startPoint: .topLeading, endPoint: .bottomTrailing)
}

static var grayGradient: Self {
let start = Color(hex: 0xFFFFFF)
let middle = Color(hex: 0xFFFFFF, alpha: 0.3)
return .linearGradient(colors: [start, middle], startPoint: .topLeading, endPoint: .bottomTrailing)
}
}
48 changes: 39 additions & 9 deletions SoccerBeat/Common/Utiles/Font+extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,27 +122,45 @@ extension Font {
// MARK: - NoAuthorization
public static let noAuthorizationTitleFont = Font.sfProText(size: 20, weight: .medium)
public static let noAuthorizationExplainFont = Font.sfProText(size: 16, weight: .medium)

// MARK: - ShareMatch
public static let shareButtonFont = Font.sfProText(size: 14, weight: .semibold)
}

extension Font {
static func sfCompactText(size fontSize: CGFloat, weight: SFCompactText = .regular) -> Font {
Font.custom("\(SFCompactText.fontName)-\(weight.capitalized)",
size: fontSize)
Font.custom(
"\(SFCompactText.fontName)-\(weight.capitalized)",
size: fontSize
)
}

static func sfProText(size fontSize: CGFloat, weight: SFProText = .blackItalic) -> Font {
Font.custom("\(SFProText.fontName)-\(weight.capitalized)",
size: fontSize)
Font.custom(
"\(SFProText.fontName)-\(weight.capitalized)",
size: fontSize
)
}

static func sfProDisplay(size fontSize: CGFloat, weight: SFProDisplay = .heavyItalic) -> Font {
Font.custom("\(SFProText.fontName)-\(weight.capitalized)",
size: fontSize)
Font.custom(
"\(SFProText.fontName)-\(weight.capitalized)",
size: fontSize
)
}

static func notoSans(size fontSize: CGFloat, weight: NotoSans = .regular) -> Font {
Font.custom("\(NotoSans.fontName)-\(weight.capitalized)",
size: fontSize)
Font.custom(
"\(NotoSans.fontName)-\(weight.capitalized)",
size: fontSize
)
}

static func turretRoad(size fontSize: CGFloat, weight: TurretRoad = .extraBold) -> Font {
Font.custom(
"\(TurretRoad.fontName)-\(weight.capitalized)",
size: fontSize
)
}
}

Expand All @@ -153,7 +171,8 @@ enum SFCompactText: String {
case lightItalic
case semiboldItalic
case regular

case thin

var capitalized: String {
self.rawValue.capitalized
}
Expand All @@ -166,6 +185,7 @@ enum SFProText: String {
case heavyItalic
case lightItalic
case regularItalic
case semibold
case semiboldItalic
case mediumItalic
case regular
Expand Down Expand Up @@ -201,3 +221,13 @@ enum NotoSans: String {
self.rawValue.capitalized
}
}

enum TurretRoad: String {
static let fontName = String(describing: Self.self)

case extraBold

var capitalized: String {
self.rawValue.capitalized
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ final class MatricsIndicator: NSObject, ObservableObject {
let sprintSpeed: Double = 5.56 // 2.78ms == 10km/h 비ꡐ에 μ‚¬μš©λ˜λŠ” μŠ€ν”„λ¦°νŠΈ λ³€μˆ˜ μƒμˆ˜ κ°’. ν˜„μž¬λŠ” 20km/h κΈ°μ€€

// 데이터 기둝 λ³€μˆ˜
var saveMinHeartRate: Int = 0
var saveMinHeartRate: Int = 300
var saveMaxHeartRate: Int = 0
var saveHeartRates: [Int] = []

Expand All @@ -88,7 +88,7 @@ final class MatricsIndicator: NSObject, ObservableObject {
return [
"MaxSpeed": Double(maxSpeedMPS.rounded(at: 2)), // m/s
"SprintCount": sprintCount,
"MinHeartRate": saveMinHeartRate,
"MinHeartRate": saveMinHeartRate == 300 ? 0 : saveMinHeartRate,
"MaxHeartRate": saveMaxHeartRate,
"HeartRates": saveHeartRates.map {String($0)}.joined(separator: ","),
"Vo2Max": Double(vo2Max.rounded(at: 1)),
Expand Down
25 changes: 23 additions & 2 deletions SoccerBeat/SoccerBeat.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@
BE4A91582B011C8B004AAFA3 /* SprintChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE4A91572B011C8B004AAFA3 /* SprintChart.swift */; };
BE4B72742BAAA87300034C0F /* Dictionary+extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE4B72732BAAA87300034C0F /* Dictionary+extension.swift */; };
BE4B72752BAAA87300034C0F /* Dictionary+extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE4B72732BAAA87300034C0F /* Dictionary+extension.swift */; };
BE58AF1E2D1D5C5C007A7C81 /* ShareMatchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE58AF1D2D1D5C5C007A7C81 /* ShareMatchView.swift */; };
BE58E6472CB7FC6F005B3E38 /* DetactStationaryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE58E6462CB7FC6F005B3E38 /* DetactStationaryView.swift */; };
BE7D01302D2BED0500C41019 /* SF-Pro-Text-Semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = BE7D012F2D2BED0500C41019 /* SF-Pro-Text-Semibold.otf */; };
BE7D01312D2BED0500C41019 /* SF-Pro-Text-Semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = BE7D012F2D2BED0500C41019 /* SF-Pro-Text-Semibold.otf */; };
BE7D01332D2D39A100C41019 /* SF-Compact-Text-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = BE7D01322D2D39A100C41019 /* SF-Compact-Text-Thin.otf */; };
BE7D01342D2D39A100C41019 /* SF-Compact-Text-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = BE7D01322D2D39A100C41019 /* SF-Compact-Text-Thin.otf */; };
BE7D01362D2D437E00C41019 /* TurretRoad-ExtraBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BE7D01352D2D437E00C41019 /* TurretRoad-ExtraBold.ttf */; };
BE7D01372D2D437E00C41019 /* TurretRoad-ExtraBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BE7D01352D2D437E00C41019 /* TurretRoad-ExtraBold.ttf */; };
BE87AC0C2C4B1D0700803A25 /* SkeletonUI in Frameworks */ = {isa = PBXBuildFile; productRef = BE87AC0B2C4B1D0700803A25 /* SkeletonUI */; };
BE91CF402BBE43BC00F0EB6F /* RadarChartShape.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE91CF3F2BBE43BC00F0EB6F /* RadarChartShape.swift */; };
BE93F1912B00937000C33756 /* TextBorder+extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE93F1902B00937000C33756 /* TextBorder+extension.swift */; };
Expand Down Expand Up @@ -262,7 +269,11 @@
BE4A91552B011A46004AAFA3 /* BPMChart.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BPMChart.swift; sourceTree = "<group>"; };
BE4A91572B011C8B004AAFA3 /* SprintChart.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SprintChart.swift; sourceTree = "<group>"; };
BE4B72732BAAA87300034C0F /* Dictionary+extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Dictionary+extension.swift"; sourceTree = "<group>"; };
BE58AF1D2D1D5C5C007A7C81 /* ShareMatchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareMatchView.swift; sourceTree = "<group>"; };
BE58E6462CB7FC6F005B3E38 /* DetactStationaryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetactStationaryView.swift; sourceTree = "<group>"; };
BE7D012F2D2BED0500C41019 /* SF-Pro-Text-Semibold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Text-Semibold.otf"; sourceTree = "<group>"; };
BE7D01322D2D39A100C41019 /* SF-Compact-Text-Thin.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Compact-Text-Thin.otf"; sourceTree = "<group>"; };
BE7D01352D2D437E00C41019 /* TurretRoad-ExtraBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "TurretRoad-ExtraBold.ttf"; sourceTree = "<group>"; };
BE91CF3F2BBE43BC00F0EB6F /* RadarChartShape.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadarChartShape.swift; sourceTree = "<group>"; };
BE93F1902B00937000C33756 /* TextBorder+extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TextBorder+extension.swift"; sourceTree = "<group>"; };
BE93F1932B009FA300C33756 /* ElapsedTimeFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElapsedTimeFormatter.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -655,6 +666,7 @@
isa = PBXGroup;
children = (
FBA3DA612B00E6EF0025AD7B /* ShareView.swift */,
BE58AF1D2D1D5C5C007A7C81 /* ShareMatchView.swift */,
);
path = Share;
sourceTree = "<group>";
Expand Down Expand Up @@ -854,6 +866,7 @@
BE323D412B0CC49500F289D4 /* SF-Pro-Text-Medium.otf */,
BE323D472B0CC5DE00F289D4 /* SF-Pro-Text-MediumItalic.otf */,
BE323D442B0CC4A700F289D4 /* SF-Pro-Text-Light.otf */,
BE7D012F2D2BED0500C41019 /* SF-Pro-Text-Semibold.otf */,
FBA3DA862B03B9F20025AD7B /* SF-Pro-Display-RegularItalic.otf */,
FBE203932AF1ED7B000E47FE /* NotoSansDisplay-BlackItalic.ttf */,
BE4069BD2AF1D22B00FA3030 /* NotoSans-Black.ttf */,
Expand All @@ -862,12 +875,14 @@
BE4069C42AF1F80C00FA3030 /* SF-Compact-Text-LightItalic.otf */,
BE4069C32AF1F80C00FA3030 /* SF-Compact-Text-Medium.otf */,
BE4069C22AF1F80C00FA3030 /* SF-Compact-Text-Regular.otf */,
BE7D01322D2D39A100C41019 /* SF-Compact-Text-Thin.otf */,
BE4069C52AF1F80D00FA3030 /* SF-Compact-Text-SemiboldItalic.otf */,
BE4069C12AF1F80C00FA3030 /* SF-Pro-Text-BlackItalic.otf */,
BE4069C62AF1F80D00FA3030 /* SF-Pro-Text-HeavyItalic.otf */,
BE4069E32AF27ADF00FA3030 /* SF-Pro-Text-LightItalic.otf */,
BED269752AFC6FB200153DE8 /* SF-Pro-Text-RegularItalic.otf */,
BEDE52412B04D69400BBFD94 /* SF-Pro-Text-SemiboldItalic.otf */,
BE7D01352D2D437E00C41019 /* TurretRoad-ExtraBold.ttf */,
);
path = Fonts;
sourceTree = "<group>";
Expand Down Expand Up @@ -976,6 +991,7 @@
BEA576442C704E7A00B88773 /* HeartRate.json in Resources */,
682D64B12AFE90A000D7F07B /* CardFlipEffect.mp3 in Resources */,
BE9B3AF02C89CE5500DE359D /* InfoPlist.xcstrings in Resources */,
BE7D01312D2BED0500C41019 /* SF-Pro-Text-Semibold.otf in Resources */,
BEA576462C704E8800B88773 /* TopSpeed.json in Resources */,
BA3654C62CDE88F20059FE9A /* SF-Pro-Display-HeavyItalic.otf in Resources */,
BA3654C72CDE88F20059FE9A /* SF-Pro-Text-MediumItalic.otf in Resources */,
Expand All @@ -985,6 +1001,7 @@
BA3654CB2CDE88F20059FE9A /* SF-Compact-Text-Regular.otf in Resources */,
BA3654CC2CDE88F20059FE9A /* SF-Compact-Text-SemiboldItalic.otf in Resources */,
BA3654CD2CDE88F20059FE9A /* NotoSans-Regular.ttf in Resources */,
BE7D01362D2D437E00C41019 /* TurretRoad-ExtraBold.ttf in Resources */,
BA3654CE2CDE88F20059FE9A /* NotoSans-BlackItalic.ttf in Resources */,
BA3654CF2CDE88F20059FE9A /* SF-Pro-Text-BlackItalic.otf in Resources */,
BA3654D02CDE88F20059FE9A /* SF-Pro-Text-Light.otf in Resources */,
Expand All @@ -999,6 +1016,7 @@
BA3654D92CDE88F20059FE9A /* SF-Pro-Text-LightItalic.otf in Resources */,
BEC953A32C75FDE400EFF3C2 /* Localizable.xcstrings in Resources */,
D3C5001A2AE36F3F00EFAEFF /* Preview Assets.xcassets in Resources */,
BE7D01342D2D39A100C41019 /* SF-Compact-Text-Thin.otf in Resources */,
BE0D7D7D2BD14B4800966FF7 /* PrivacyInfo.xcprivacy in Resources */,
D3C500172AE36F3F00EFAEFF /* Assets.xcassets in Resources */,
);
Expand All @@ -1018,9 +1036,12 @@
BE0D7D7E2BD14B4800966FF7 /* PrivacyInfo.xcprivacy in Resources */,
D3C5002C2AE36F4000EFAEFF /* Preview Assets.xcassets in Resources */,
BE9B3AF12C89CE5500DE359D /* InfoPlist.xcstrings in Resources */,
BE7D01372D2D437E00C41019 /* TurretRoad-ExtraBold.ttf in Resources */,
BA3654EF2CDE9C7F0059FE9A /* SF-Pro-Text-BlackItalic.otf in Resources */,
D3C500292AE36F4000EFAEFF /* Assets.xcassets in Resources */,
BE7D01302D2BED0500C41019 /* SF-Pro-Text-Semibold.otf in Resources */,
BA3654F32CDE9CB60059FE9A /* SF-Compact-Text-SemiboldItalic.otf in Resources */,
BE7D01332D2D39A100C41019 /* SF-Compact-Text-Thin.otf in Resources */,
BE1B6C732C7A961B0073C7D8 /* Phrase.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1121,6 +1142,7 @@
D37F6ABC2B0CDFAC00A37E4F /* HealthAlertView.swift in Sources */,
BEF479BE2BCA6C1C00C79362 /* LoadingView.swift in Sources */,
6851E6E32B0C8E7F007D1DD8 /* Text+extension.swift in Sources */,
BE58AF1E2D1D5C5C007A7C81 /* ShareMatchView.swift in Sources */,
686E998A2BD0DB4900B9FD56 /* NameFieldView.swift in Sources */,
682D64892AFDBF8C00D7F07B /* PhotoSelectButtonView.swift in Sources */,
BEDE523E2B03BFF800BBFD94 /* Analyzable.swift in Sources */,
Expand Down Expand Up @@ -1159,8 +1181,7 @@
680567242CCA9D0D00DB0B4F /* ShapeStyle+extension.swift in Sources */,
680567272CCA9D3500DB0B4F /* View+extension.swift in Sources */,
BE0639D82AE61BC2008D1D4E /* SplitControlsView.swift in Sources */,
BEA63A672B0AFDFF000A309D /* ActivityEnum.swift in Sources */,
BE360F022BA016EA00071C30 /* WorkoutManager_Watch+extensions.swift in Sources */,
BE360F022BA016EA00071C30 /* WorkoutManager_Watch.swift in Sources */,
683825052B06249F00FE9CDF /* SprintSheetView.swift in Sources */,
6898F2852AEFD7FC0075A573 /* SprintView.swift in Sources */,
6820884C2AF11EB200F51A3E /* PrecountView.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "instagram_logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Expand Up @@ -12,7 +12,8 @@ import CoreLocation
struct MatchDetailView: View {
@Environment(\.dismiss) private var dismiss
var workout: WorkoutData?

@State private var showShareView = false

var body: some View {
ZStack {
Image("BackgroundPattern")
Expand All @@ -26,6 +27,8 @@ struct MatchDetailView: View {
VStack {
Spacer()
.frame(height: 60)
FieldMovementView(workout: workout)

MatchTimeView(workout: workout)
Spacer()
.frame(height: 48)
Expand All @@ -37,7 +40,6 @@ struct MatchDetailView: View {
FieldRecordView(workout: workout)
Spacer()
.frame(height: 100)
FieldMovementView(workout: workout)
}
.padding()
}
Expand All @@ -52,10 +54,22 @@ struct MatchDetailView: View {
dismiss()
} label: {
Image(systemName: "chevron.backward")
.foregroundStyle(Color.white)
}
}
ToolbarItem(placement: .topBarTrailing) {
Button {
showShareView.toggle()
} label: {
Image(systemName: "square.and.arrow.up")
.foregroundStyle(.brightmint)
}
}
}
.foregroundStyle(Color.white)
.sheet(isPresented: $showShareView) {
ShareMatchView(matchData: workout ?? .example)
}

.scrollIndicators(.hidden)
}
}
Expand Down Expand Up @@ -474,7 +488,9 @@ struct FieldRecordDataView: View {

#Preview {
@StateObject var workoutManager = WorkoutManager.shared
return MatchDetailView(workout: WorkoutData.example)
.environmentObject(ProfileModel(workoutManager: workoutManager))
.environmentObject(workoutManager)
return NavigationView {
MatchDetailView(workout: WorkoutData.example)
.environmentObject(ProfileModel(workoutManager: workoutManager))
.environmentObject(workoutManager)
}
}
Loading