Use an easing function for the transitions.