Skip to content

Instantly share code, notes, and snippets.

@victorbrndls
Created October 19, 2021 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorbrndls/ee568cae6fdb9c274b823800fb8ebf44 to your computer and use it in GitHub Desktop.
Save victorbrndls/ee568cae6fdb9c274b823800fb8ebf44 to your computer and use it in GitHub Desktop.
spring(
dampingRatio = Spring.DampingRatioHighBouncy,
stiffness = Spring.StiffnessMedium
)
tween(
durationMillis = 300,
delayMillis = 50,
easing = LinearOutSlowInEasing
)
// animates based on the snapshot values specified at different timestamps
keyframes {
durationMillis = 375
0.0f at 0 with LinearOutSlowInEasing // for 0-15 ms
0.2f at 15 with FastOutLinearInEasing // for 15-75 ms
0.4f at 75 // ms
0.4f at 225 // ms
}
// runs a animation repeatedly until it reaches the specified iteration count
repeatable(
iterations = 3,
animation = tween(durationMillis = 300),
repeatMode = RepeatMode.Reverse
)
// like repeatable, but it repeats for an infinite amount of iterations
infiniteRepeatable(
animation = tween(durationMillis = 300),
repeatMode = RepeatMode.Reverse
)
// immediately switches the value to the end value
snap(delayMillis = 50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment