Skip to content

Commit

Permalink
feat: 둘러보기 밈 이미지 비율 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jongnan committed Oct 1, 2024
1 parent 532fb19 commit 0091bd8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,34 @@ struct RecommendMemeImagesView: View {
.recommendSkeleton(
isShow: memes.isEmpty,
radius: 20,
width: memes.isEmpty ? 270 : .infinity,
height: 310
width: memes.isEmpty ? 280 : .infinity,
height: 280
)
}
.frame(height: 280)
.scrollIndicators(.never)
.scrollTargetBehavior(.viewAligned)
.scrollPosition(id: $currentMeme)
.contentMargins(.horizontal, 60.0)
.padding(.bottom, 16)

if let currentMeme, isMemeInfoHidden == false {
Text(currentMeme.title)
.font(Font.Heading.Small.medium)
.foregroundColor(Color.Text.primary)
.padding(.bottom, 4)

HashTagView(keywords: currentMeme.keywords)
.onTapGesture {
PPACAnalytics.shared
.log(
interaction: .click,
event: .tag,
page: .recommend
)
}
if let currentMeme {
if(isMemeInfoHidden == false) {
Text(currentMeme.title)
.font(Font.Heading.Small.medium)
.foregroundColor(Color.Text.primary)
.padding(.bottom, 4)

HashTagView(keywords: currentMeme.keywords)
.onTapGesture {
PPACAnalytics.shared
.log(
interaction: .click,
event: .tag,
page: .recommend
)
}
}
} else {
EmptyView()
.recommendSkeleton(isShow: true, radius: 4, width: 200, height: 16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public struct RecommendView: View {
}
.zIndex(2)
}
.frame(maxHeight: 480)
.frame(maxHeight: 450)
.onReadSize { size in
memeContentsHeight = size.height
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,18 @@ struct MemeImageView: View {
let isDimmed: Bool

@State var image: URL? = nil

@Binding var isLoadingImage: Bool

public var body: some View {
Rectangle()
.frame(width: 270, height: 310)
.frame(width: 280, height: 280)
.cornerRadius(20)
.foregroundColor(.black.opacity(isLoadingImage ? 1 : 0))
.overlay {
KFImage(URL(string: imageUrl))
.placeholder {
EmptyView()
.recommendSkeleton(isShow: true, radius: 20, width: 270, height: 310)
.recommendSkeleton(isShow: true, radius: 20, width: 280, height: 280)
}
.onSuccess { _ in
isLoadingImage = true
Expand All @@ -40,6 +39,7 @@ struct MemeImageView: View {
.foregroundStyle(Color.Background.dimmer)
}
}
.clipShape(RoundedRectangle(cornerRadius: 20))
.scrollTransition { content, phase in
content
.offset(x: phase.value * -3)
Expand All @@ -62,6 +62,7 @@ struct MemeImageBorderView: View {
Color.Border.primary.opacity(isLoadingImage ? 1 : 0),
lineWidth: 2
)
.frame(width: 280, height: 280)
.scrollTransition { content, phase in
content
.offset(x: phase.value * -3)
Expand All @@ -75,6 +76,6 @@ struct MemeImageBorderView: View {
imageUrl: "https://ppac-meme.s3.ap-northeast-2.amazonaws.com/17204513204087.jpg",
// imageUrl: "",
isDimmed: false,
isLoadingImage: .constant(false)
isLoadingImage: .constant(true)
)
}

0 comments on commit 0091bd8

Please sign in to comment.