Skip to content

Instantly share code, notes, and snippets.

@zsoltk
Last active May 4, 2025 16:04
Show Gist options
  • Select an option

  • Save zsoltk/ed86882c60f8cb0d6a79c4b0dc2b8bfa to your computer and use it in GitHub Desktop.

Select an option

Save zsoltk/ed86882c60f8cb0d6a79c4b0dc2b8bfa to your computer and use it in GitHub Desktop.
class CardsTransitionHandler<T>(
private val transitionSpec: TransitionSpec<Cards.State, Float> = {
spring(stiffness = Spring.StiffnessVeryLow)
}
) : ModifierTransitionHandler<T, Cards.State>() {
private fun Cards.State.toProps() =
when (this) {
is Queued -> queued
is Bottom -> bottom
is Top -> top
is VoteLike -> voteLike
is VotePass -> votePass
}
override fun createModifier(
modifier: Modifier,
transition: Transition<Cards.State>,
descriptor: TransitionDescriptor<T, Cards.State>
): Modifier = modifier.composed {
val rotation = transition.animateFloat(
transitionSpec = transitionSpec,
targetValueByState = { it.toProps().rotation })
val scale = transition.animateFloat(
transitionSpec = transitionSpec,
targetValueByState = { it.toProps().scale })
val dpOffsetX = transition.animateFloat(
transitionSpec = transitionSpec,
targetValueByState = { it.toProps().offsetX.value })
val zIndex = transition.animateFloat(
transitionSpec = transitionSpec,
targetValueByState = { it.toProps().zIndex })
return@composed this
.offset {
IntOffset(x = (this.density * (dpOffsetX.value)).roundToInt(), y = 0)
}
.zIndex(zIndex.value)
.graphicsLayer(
rotationZ = rotation.value
)
.scale(scale.value)
}
}
@MkRezz21
Copy link

MkRezz21 commented May 4, 2025

Hey all! The other night, I was just scrolling through random dating suggestions and ended up clicking on https://www.onadate.com/local-milfs.html. I didn’t have high hopes at first, but the vibe of the site really surprised me. It’s simple, focused, and easy to meet people who actually want to talk and connect. I liked that conversations weren't forced and everyone seemed genuinely interested in getting to know each other without endless small talk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment