-
Notifications
You must be signed in to change notification settings - Fork 0
✨[feat]: Feature/more info 팀약속 뷰 구현 #10
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6bf8022
✨[feat]: 팀소개 뷰 구현 #2
Roy-wonji 2bfa534
✨[feat]: 뷰 올라오는 애니메이션 추가 #2
Roy-wonji 6a3ec04
🪛[chore]: swift data 반영
Roy-wonji b589aec
🪛[chore]: pr 수정
Roy-wonji a54e84e
Merge branch 'develop' of https://github.com/SpartCodig-iOS/TeamIntro…
Roy-wonji File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
62 changes: 62 additions & 0 deletions
62
...duce/TeamIntroduce/Sources/DesignSytstem/Componet/Animation/StaggeredAppearModifier.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| // | ||
| // StaggeredAppearModifier.swift | ||
| // TeamIntroduce | ||
| // | ||
| // Created by Wonji Suh on 8/13/25. | ||
| // | ||
|
|
||
| import SwiftUI | ||
|
|
||
| struct StaggeredAppearModifier: ViewModifier { | ||
| let index: Int | ||
| @Binding var currentMaxIndex: Int | ||
|
|
||
| var baseDelay: Double = 0.25 | ||
| var stepDelay: Double = 0.15 | ||
| var hiddenYOffset: CGFloat = 12 | ||
| var animation: Animation = .spring(response: 0.5, dampingFraction: 0.85) | ||
|
|
||
| @Environment(\.accessibilityReduceMotion) private var reduceMotion | ||
|
|
||
| func body(content: Content) -> some View { | ||
| content | ||
| .opacity(index <= currentMaxIndex ? 1 : 0) | ||
| .offset(y: index <= currentMaxIndex ? 0 : hiddenYOffset) | ||
| .onAppear { | ||
| guard index > currentMaxIndex else { return } | ||
| guard !reduceMotion else { | ||
| currentMaxIndex = index | ||
| return | ||
| } | ||
|
|
||
| let delay = baseDelay + stepDelay * Double(index) | ||
| DispatchQueue.main.asyncAfter(deadline: .now() + delay) { | ||
| withAnimation(animation) { | ||
| currentMaxIndex = index | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| extension View { | ||
| func staggeredAppear( | ||
| index: Int, | ||
| currentMaxIndex: Binding<Int>, | ||
| baseDelay: Double = 0.25, | ||
| stepDelay: Double = 0.15, | ||
| hiddenYOffset: CGFloat = 12, | ||
| animation: Animation = .spring(response: 0.5, dampingFraction: 0.85) | ||
| ) -> some View { | ||
| modifier( | ||
| StaggeredAppearModifier( | ||
| index: index, | ||
| currentMaxIndex: currentMaxIndex, | ||
| baseDelay: baseDelay, | ||
| stepDelay: stepDelay, | ||
| hiddenYOffset: hiddenYOffset, | ||
| animation: animation | ||
| ) | ||
| ) | ||
| } | ||
| } |
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
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
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
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
28 changes: 28 additions & 0 deletions
28
TeamIntroduce/TeamIntroduce/Sources/Presnetaion/TeamAgreement/AgreeMentItem.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // | ||
| // AgreeMentItem.swift | ||
| // TeamIntroduce | ||
| // | ||
| // Created by Wonji Suh on 8/13/25. | ||
| // | ||
|
|
||
| import Foundation | ||
| import SwiftUI | ||
|
|
||
| struct AgreeMentItem: Identifiable { | ||
| let id = UUID() | ||
| let number: Int | ||
| let color: Color | ||
| let agreeMentTitle: String | ||
| let agreeMentSubTitle: String | ||
| } | ||
|
|
||
| extension AgreeMentItem { | ||
| static let items: [AgreeMentItem] = [ | ||
| .init(number: 1, color: .blue20, agreeMentTitle: "스크럼 시간", agreeMentSubTitle: "참여못하는 날은 노션에 미리 작성해두고, 당일 불참시 슬랙 DM 보내기"), | ||
| .init(number: 2, color: .green10, agreeMentTitle: "시간과 약속 준수", agreeMentSubTitle: "정해진 시간과 약속을 지켜 서로에 대한 신뢰를 쌓겠습니다."), | ||
| .init(number: 3, color: .lightPurple10, agreeMentTitle: "스크럼 참여시간 ", agreeMentSubTitle: "스크럼 하루 두번 (10:00, 20:00)"), | ||
| .init(number: 4, color: .orange10, agreeMentTitle: "GIT 커벤션 및 PR", agreeMentSubTitle: "git-flow, PR 머지(머지 할때는 스쿼시 머지)"), | ||
| .init(number: 5, color: .red10, agreeMentTitle: "점심시간", agreeMentSubTitle: "점심시간 12:30, 저녁시간 18:00 (1시간)") | ||
| ] | ||
| } | ||
|
|
141 changes: 141 additions & 0 deletions
141
TeamIntroduce/TeamIntroduce/Sources/Presnetaion/TeamAgreement/TeamAgreeMentView.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| // | ||
| // TeamAgreeMentView.swift | ||
| // TeamIntroduce | ||
| // | ||
| // Created by Wonji Suh on 8/13/25. | ||
| // | ||
|
|
||
| import SwiftUI | ||
|
|
||
| struct TeamAgreeMentView: View { | ||
| @ObservedObject var coordinator: IntroduceCoordinator | ||
|
|
||
| private let agreeMentItem = AgreeMentItem.items | ||
| @State private var currentMaxIndex: Int = -1 | ||
|
|
||
|
|
||
| var body: some View { | ||
| VStack { | ||
| Spacer() | ||
| .frame(height: 14) | ||
|
|
||
| CustomNavigationBackBar(text: "팀 약속") { | ||
| coordinator.goBack() | ||
| } | ||
|
|
||
|
|
||
| teamAgreeMentHeader() | ||
|
|
||
| agreeMentCard() | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| extension TeamAgreeMentView { | ||
|
|
||
| @ViewBuilder | ||
| private func teamAgreeMentHeader() -> some View { | ||
| VStack(spacing: 10) { | ||
| Image(asset: .teamiIntroduce) | ||
| .resizable() | ||
| .scaledToFit() | ||
| .frame(width: 56, height: 56) | ||
|
|
||
|
|
||
| HStack { | ||
| Spacer() | ||
|
|
||
| Text("우리의 약속") | ||
| .pretendardFont(family: .medium, size: 16) | ||
| .foregroundStyle(.textPrimary) | ||
|
|
||
| Spacer() | ||
| } | ||
|
|
||
|
|
||
| HStack { | ||
| Spacer() | ||
| TypingText( | ||
| text: "더 나은 팀이 되기 위해 함께 지켜나갈 소중한 약속들입니다.", | ||
| font: .pretendardFont(family: .bold, size: 16), | ||
| perChar: 0.06, | ||
| startDelay: 0.15, | ||
| showsCursor: false | ||
| ) | ||
| Spacer() | ||
| } | ||
| } | ||
| .cardStyle() | ||
| .padding(16) | ||
| } | ||
|
|
||
| @ViewBuilder | ||
| private func agreeMentCard() -> some View { | ||
| let indices = Array(agreeMentItem.indices) | ||
| ScrollView(.vertical) { | ||
| ForEach(indices, id: \.self) { index in | ||
| let item = agreeMentItem[index] | ||
| agreeMentListitem( | ||
| number: item.number, | ||
| agreeMentTitle: item.agreeMentTitle, | ||
| agreeMentSubTitle: item.agreeMentSubTitle, | ||
| circleColor: item.color, | ||
| fontColor: item.color | ||
| ) | ||
| .staggeredAppear(index: index, currentMaxIndex: $currentMaxIndex) | ||
| } | ||
| } | ||
| .scrollIndicators(.hidden) | ||
| } | ||
|
|
||
|
|
||
| @ViewBuilder | ||
| private func agreeMentListitem( | ||
| number: Int, | ||
| agreeMentTitle: String, | ||
| agreeMentSubTitle: String, | ||
| circleColor: Color, | ||
| fontColor: Color | ||
| ) -> some View { | ||
| VStack { | ||
| HStack { | ||
| Circle() | ||
| .fill(circleColor.opacity(0.3)) | ||
| .frame(width: 40, height: 40) | ||
| .overlay { | ||
| Text("\(number)") | ||
| .pretendardFont(family: .semiBold, size: 12) | ||
| .foregroundStyle(fontColor) | ||
| } | ||
|
|
||
| Spacer() | ||
| .frame(width: 10) | ||
|
|
||
| VStack(alignment: .leading) { | ||
| HStack { | ||
| Text(agreeMentTitle) | ||
| .pretendardFont(family: .regular, size: 12) | ||
| .foregroundStyle(.staticBlack) | ||
|
|
||
| Spacer() | ||
| } | ||
|
|
||
| Text(agreeMentSubTitle) | ||
| .pretendardFont(family: .regular, size: 12) | ||
| .foregroundStyle(.textPrimary) | ||
|
|
||
| } | ||
|
|
||
| Spacer() | ||
| } | ||
| .padding(.vertical, 16) | ||
| } | ||
| .cardStyle() | ||
| .padding(.horizontal, 16) | ||
| } | ||
| } | ||
|
|
||
| #Preview { | ||
| TeamAgreeMentView(coordinator: IntroduceCoordinator()) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 줄 간격 컨벤션을 맞추면 좋을 것 같은데
동일하게 가지 않으면 코드리뷰에서 이전에 했던 것들이 올라오네요 ~!