Add pagination and game cards to about page
This commit is contained in:
1 parent
cc085be17a
commit
5d04df8d54
5 files changed
+207
-45
No files matched your search
@@ -0,0 +1,38 @@
|
||||
<script lang="ts">
|
||||
let { currentPage = $bindable(), totalPages }: { currentPage: number; totalPages: number } = $props();
|
||||
</script>
|
||||
|
||||
{#if totalPages > 1}
|
||||
<nav class="pagination" aria-label="Pagination">
|
||||
<button disabled={currentPage === 1} onclick={() => currentPage--}>< prev</button>
|
||||
<span class="muted">page {currentPage} of {totalPages}</span>
|
||||
<button disabled={currentPage === totalPages} onclick={() => currentPage++}>next ></button>
|
||||
</nav>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.pagination {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-top: 1.25rem;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 0.1rem 0.6rem;
|
||||
background: none;
|
||||
border: 1px solid color-mix(in srgb, var(--foreground) 25%, transparent);
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
button:hover:not(:disabled) {
|
||||
border-color: var(--accent);
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: default;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user