- Parser additions, pagination

This commit is contained in:
Ty Clifford
2026-07-04 20:29:34 -04:00
parent c4c10c256c
commit bb93bf58fe
6 changed files with 167 additions and 11 deletions
+25 -2
View File
@@ -440,7 +440,7 @@ h2 {
.pagination {
display: flex;
flex-wrap: wrap;
gap: 0.8rem;
gap: 0.45rem;
align-items: center;
justify-content: center;
margin: 1.5rem 0;
@@ -448,7 +448,7 @@ h2 {
}
.pager {
min-width: 112px;
min-width: 44px;
border: 1px solid var(--line);
border-radius: var(--radius);
padding: 0.6rem 0.9rem;
@@ -457,6 +457,29 @@ h2 {
background: var(--surface);
}
.pager:first-child,
.pager:nth-last-child(2) {
min-width: 104px;
}
.pager--current {
color: #06100b;
border-color: color-mix(in srgb, var(--accent) 70%, white);
background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.pager--disabled {
cursor: not-allowed;
opacity: 0.48;
}
.pagination__summary {
flex-basis: 100%;
margin-top: 0.25rem;
text-align: center;
font-size: 0.92rem;
}
.side-rail {
display: grid;
align-content: start;
+12 -1
View File
@@ -30,11 +30,22 @@ $renderPagination = static function (array $pagination, callable $url): void { ?
<nav class="pagination" aria-label="Pagination">
<?php if ($pagination['has_previous']): ?>
<a class="pager" href="<?= $url((int) $pagination['previous']) ?>">Previous</a>
<?php else: ?>
<span class="pager pager--disabled" aria-disabled="true">Previous</span>
<?php endif; ?>
<span>Page <?= (int) $pagination['page'] ?> of <?= (int) $pagination['pages'] ?></span>
<?php foreach (($pagination['numbers'] ?? []) as $number): ?>
<?php if ((int) $number === (int) $pagination['page']): ?>
<span class="pager pager--current" aria-current="page"><?= (int) $number ?></span>
<?php else: ?>
<a class="pager pager--number" href="<?= $url((int) $number) ?>"><?= (int) $number ?></a>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($pagination['has_next']): ?>
<a class="pager" href="<?= $url((int) $pagination['next']) ?>">Next</a>
<?php else: ?>
<span class="pager pager--disabled" aria-disabled="true">Next</span>
<?php endif; ?>
<span class="pagination__summary">Page <?= (int) $pagination['page'] ?> of <?= (int) $pagination['pages'] ?> · <?= (int) $pagination['per_page'] ?> per page</span>
</nav>
<?php endif; ?>
<?php };