instead of relying on 'animationend' we could rely on a custom event called 'action-hidden' or similar