Skip to content

Commit

Permalink
Zoom into featured item to have a better parallax effect
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Oct 4, 2023
1 parent 6f76d08 commit 61d16d3
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ private fun DefaultFeaturedPostItem(
Modifier.clip(MaterialTheme.shapes.extraLarge)
.aspectRatio(featuredImageAspectRatio)
.background(AppTheme.colorScheme.surfaceContainerLowest)
.graphicsLayer { translationX = pagerState.getOffsetFractionForPage(page) * 250f },
.graphicsLayer {
translationX = pagerState.getOffsetFractionForPage(page) * 250f
scaleX = 1.08f
scaleY = 1.08f
},
contentDescription = null,
contentScale = ContentScale.Crop,
)
Expand Down Expand Up @@ -168,7 +172,11 @@ private fun LargeScreenFeaturedPostItem(
.aspectRatio(featuredImageAspectRatio)
.weight(0.92f)
.background(AppTheme.colorScheme.surfaceContainerLowest)
.graphicsLayer { translationX = pagerState.getOffsetFractionForPage(page) * 250f },
.graphicsLayer {
translationX = pagerState.getOffsetFractionForPage(page) * 250f
scaleX = 1.08f
scaleY = 1.08f
},
contentDescription = null,
contentScale = ContentScale.Crop,
)
Expand Down

0 comments on commit 61d16d3

Please sign in to comment.