Morph DOM elements from one state to another with smooth transitions