Web2: possible to shake a webcontrol or webcontainer?

some more comments from @AlbertoD

you can’t call these methods too quickly to reset the style. you may use timer.calllater
I tried this and it works nice. thanks Alberto.

Method

Public Sub ResetRectangleStyle()
  Rectangle1.Style.Value("animation") = ""
End Sub

Button Pressed event

Rectangle1.Style.Value("animation") = "shake 0.5s"
Timer.CallLater(500, AddressOf ResetRectangleStyle )

for the records, I used this on a webcontainer and it works fine.

3 Likes

Here a different shake animation, just left/right:

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

From here.

1 Like

I finally used the horizontal one from CSShake