import { createLayout, utils } from 'animejs';
const [ $button ] = utils.$('.controls button');
const layout = createLayout('.layout-container');
function animateLayout() {
// Record the current state of the layout
layout.record();
// Update the layout state
const first = layout.root.firstElementChild;
if (first) layout.root.append(first);
// Animate to the new state
layout.animate();
}
$button.addEventListener('click', animateLayout);