Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Updates commit arrow navigation

AuthorDave Jarvis <email>
Date2026-02-20 19:24:05 GMT-0800
Commit02deec2dbae1ddc265d3e8b9efe3a06861f9ffeb
Parentb0bdca5
pages/CommitsPage.php
if( $hasNext ) {
$nextUrl = $this->buildPageUrl( $pages[$current] );
+ $lastUrl = $this->buildPageUrl( $pages[$total - 1] );
echo '<a href="' . $nextUrl . '" class="page-link page-nav" ' .
'aria-label="next">' . $this->svgArrow( 'next' ) .
'</a>';
- } else {
- echo '<span class="page-link page-nav page-nav-hidden" ' .
- 'aria-hidden="true">' . $this->svgArrow( 'next' ) .
- '</span>';
- }
-
- if( $hasAll && $hasNext ) {
- $lastUrl = $this->buildPageUrl( $pages[$total - 1] );
echo '<a href="' . $lastUrl . '" class="page-link page-nav" ' .
'aria-label="last">' . $this->svgArrow( 'last' ) .
'</a>';
} else {
+ echo '<span class="page-link page-nav page-nav-hidden" ' .
+ 'aria-hidden="true">' . $this->svgArrow( 'next' ) .
+ '</span>';
+
echo '<span class="page-link page-nav page-nav-hidden" ' .
'aria-hidden="true">' . $this->svgArrow( 'last' ) .
private function svgArrow( string $type ): string {
$icons = [
- 'back' => '<path d="M2 12 L7 17 V14 H9 V10 H7 V7 Z" />',
- 'next' => '<path d="M22 12 L17 7 V10 H15 V14 H17 V17 Z" />',
- 'first' => '<path d="M2 12 L7 17 V14 H9 V10 H7 V7 Z" />' .
- '<path d="M9 12 L14 17 V14 H16 V10 H14 V7 Z" />',
- 'last' => '<path d="M15 12 L10 7 V10 H8 V14 H10 V17 Z" />' .
- '<path d="M22 12 L17 7 V10 H15 V14 H17 V17 Z" />',
+ 'back' => '<path d="M15 20 L7 12 L15 4" />',
+ 'next' => '<path d="M9 20 L17 12 L9 4" />',
+ 'first' => '<path d="M13 20 L5 12 L13 4 M19 20 L11 12 L19 4" />',
+ 'last' => '<path d="M11 20 L19 12 L11 4 M5 20 L13 12 L5 4" />',
];
$inner = $icons[$type] ?? '';
+ $svg = '<svg xmlns="http://www.w3.org/2000/svg" width="24" ' .
+ 'height="24" viewBox="0 0 24 24" fill="none" ' .
+ 'stroke="currentColor" stroke-width="2" ' .
+ 'stroke-linecap="round" stroke-linejoin="round" ' .
+ 'aria-label="' . $type . '" role="img">' .
+ '<title>' . $type . '</title>' . $inner . '</svg>';
- return '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" ' .
- 'viewBox="0 0 24 24" fill="#8b949e" aria-label="' . $type . '" role="img">' .
- '<title>' . $type . '</title>' . $inner . '</svg>';
+ return $svg;
}
styles/repo.css
.page-nav {
- min-width: calc(20px + 16px);
+ min-width: calc(24px + 16px);
display: inline-flex;
align-items: center;
Delta17 lines added, 18 lines removed, 1-line decrease