in hot-reload-runtime-jvm/src/main/kotlinUI/org/jetbrains/compose/hotReloadUI/MagicBorderEffect.kt [38:62]
override fun effectOverlay(state: ReloadState) {
EffectVisibility(
visible = state is ReloadState.Reloading
) {
// Animate a phase from 0..1 that loops, used to rotate the gradient around the border
val infinite = rememberInfiniteTransition(label = "magicBorder")
val phase by infinite.animateFloat(
initialValue = 0f,
targetValue = 1f,
animationSpec = infiniteRepeatable(
animation = tween(durationMillis = 4000, easing = FastOutSlowInEasing),
repeatMode = RepeatMode.Restart
), label = "magicBorderPhase"
)
Spacer(
Modifier.fillMaxSize().border(
border = BorderStroke(3.dp, Brush.sweepGradient(generateColorPalette(phase))),
shape = RoundedCornerShape(12.dp)
)
)
}
}