

index.html
<nav class="abacus" aria-label="Pagination">
<button class="abacus-end abacus-prev" type="button"></button>
<div class="abacus-rail"></div>
<button class="abacus-end abacus-next" type="button"></button>
</nav>
abacus.css
.abacus-end {
position: relative;
z-index: 2;
flex: none;
display: grid;
place-items: center;
width: var(--abacus-post);
height: calc(var(--abacus-bead-h) + 10px);
margin: 0;
padding: 0;
border: 0;abacus.js
export function init(root, {
pages = 9,
page = 1,
window: win = 7, // beads shown at once when there are more than 12 pages (odd numbers work best)
onChange,
onPreview, // called while a bead is pulled, with the page it would land on
drag = true, // pull beads along the rod with a finger or the mouse
duration = 440, // ms a bead takes to cross the gap and settle
stagger = 40, // ms between beads in a chain
labels = {},
} = {}) {Abacus
$5Pagination where numbered beads slide along a metal rod and clack into place
11.3 KB0 depsNavigation







