It is possible to animate the transition between DOM states using CSS and JavaScript.
Three different methods to render different user interfaces on mobile and desktop