feat: refactor pagination implementation

This commit is contained in:
Cory Dransfeldt 2023-03-26 17:35:46 -07:00
parent ee77555c32
commit da793fd1cc
No known key found for this signature in database
196 changed files with 2498 additions and 36 deletions

View file

@ -70,7 +70,22 @@
localStorage.theme = 'dark'
document.documentElement.classList.add('dark')
}
});
});;
(function() {
const pagination = document.getElementById('pagination');
if (pagination) {
pagination.addEventListener('change', (event) => {
const page = parseInt(event.target.value)
if (page === 1) {
window.location.href = '/'
} else {
window.location.href = `/${
event.target.value - 1
}/`
}
})
}
})()
</script>
</body>
</html>