Skip to content

Commit

Permalink
added UI indicator of active pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
withoutwax13 committed Oct 1, 2024
1 parent 02d6b1e commit 7126c95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion site/js/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ function createPaginationControls() {
for (let i = 1; i <= totalPages; i++) {
const button = document.createElement("button");
button.textContent = i;
if (i === currentPage) {
button.classList.add("active");
}
button.addEventListener("click", () => {
currentPage = i;
renderEvents();
createPaginationControls();
});
paginationControls.appendChild(button);
}
}
}
4 changes: 4 additions & 0 deletions site/style/events.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@
.pagination button:hover:not(.active) {
background-color: #ddd;
}
.pagination button.active {
background-color: #689775;
color: white;
}

0 comments on commit 7126c95

Please sign in to comment.