Factor out boiler plate for CSS animations

use Sass mixins to remove repetitive boilerplate.