That can be done with CSS, so please read How to make CSS changes on your site.
The specific animation is defined on
https://github.com/discourse/discourse/blob/master/app/assets/stylesheets/common/base/topic-post.scss#L622