Can you please implement Transitions API (single-document)? It provides a mechanism for easily creating animated transitions between different DOM states, while also updating the DOM contents in a single step. This API is specific to single-document transitions, support for same-origin cross-document transitions is being planned.
For more details: https://www.w3.org/TR/css-view-transitions-1/