Hello, I am unable to add animation to my styled Div element in KotlinJs. I approached it as I would in simple HTML and CSS, but still not working.
I can’t find my mistake or any sample on the web.
styledDiv {
css {
val move = KeyframesBuilder().run {
rules.addAll(listOf(
0.invoke {
top= 0.px
left= 0.px
},
100.invoke {
top= 350.px
left= 350.px
}
))
}
val animation1 = Animation (
name = "$move",
duration = 5.s,
timing= Timing.linear,
delay= 0.s,
iterationCount= IterationCount.infinite,
direction= AnimationDirection.alternate,
fillMode= FillMode.both,
playState= PlayState.running
)
animation+= animation1
}
attrs.id= "box"
}