document.addEventListener("DOMContentLoaded", function () {
let items = document.querySelectorAll(".cms-list .w-dyn-item"); // Select CMS items
let loadMoreBtn = document.querySelector(".load-more-btn");
let itemsToShow = 6; // Number of items to show at first
let currentIndex = 0;
function showItems() {
for (let i = currentIndex; i < currentIndex + itemsToShow; i++) {
if (items[i]) items[i].style.display = "block";
}
currentIndex += itemsToShow;
if (currentIndex >= items.length) loadMoreBtn.style.display = "none"; // Hide button when all items are shown
}
showItems();
loadMoreBtn.addEventListener("click", showItems);
});