<script>
const TOGGLE_BUTTON_SELECTOR = '#LIST';
const WIDGET_CLASSNAME = 'elfsight-app-e5a0fa2a-adf6-4d39-913e-1b602536db2c';
document.addEventListener('DOMContentLoaded', () => {
const toggleLayoutBtn = document.querySelector(TOGGLE_BUTTON_SELECTOR);
toggleLayoutBtn.addEventListener('click', () => {
const widgetContainer = document.querySelector(`.${WIDGET_CLASSNAME}`);
if (!widgetContainer) {
return;
}
const newWidgetContainer = document.createElement('div');
newWidgetContainer.setAttribute('data-elfsight-app-lazy', true);
newWidgetContainer.className = WIDGET_CLASSNAME;
const currentLayout = widgetContainer.getAttribute('data-elfsight-app-layout');
const newLayout = currentLayout === 'grid' ? 'list' : 'grid';
newWidgetContainer.setAttribute('data-elfsight-app-layout', newLayout);
widgetContainer.after(newWidgetContainer);
widgetContainer.remove();
});
})
</script>

