I put “right” in quotes because, well, I’m opposed to gimmicky animations in web pages on principle. However, if you have to use them, they should be done efficiently.
To that end, I found this article on Medium from May 2014 that has a series of tips, at least four of which I’ve put into effect just this morning and one of which I never even knew existed before today.