diff --git a/_layouts/update.html b/_layouts/update.html index 2bbab70..38892c8 100644 --- a/_layouts/update.html +++ b/_layouts/update.html @@ -22,7 +22,6 @@

{{ page.author }}{% endif %} --> diff --git a/assets/css/styles.css b/assets/css/styles.css index 28edcbd..fc55c83 100755 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -30,6 +30,7 @@ title: CSS stylesheet :root { --root-size: 10px; --max-content-width: 100%; + --tari-purple: #9330ff; } /* body */ @@ -2522,6 +2523,35 @@ body.page- #call-to-action { } } +#pagination-controls { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + margin-top: 40px; +} + +#pagination-controls > a { + margin: 2px; + border-radius: 5px; +} + +#active-pagination { + background: var(--tari-purple); +} + +#active-pagination { + color: white !important; +} + +.page-link { + color: var(--tari-purple); +} + +.page-link:hover { + color: var(--tari-purple); +} + /* 404 */ .page404 { @@ -2567,3 +2597,5 @@ body.page- #call-to-action { font-family: Avenir-Light, 'Avenir-Light', 'Myriad Pro', Arial, Verdana !important; color: #ff0000; } + +/* Updates */ diff --git a/assets/js/pagination.js b/assets/js/pagination.js new file mode 100644 index 0000000..4f277c2 --- /dev/null +++ b/assets/js/pagination.js @@ -0,0 +1,36 @@ +$(document).ready(function() { + const itemsPerPage = 20; + const $posts = $('.blog-area .js-stagger-delay-post-panel'); + const totalPages = Math.ceil($posts.length / itemsPerPage); + let currentPage = 1; + + function showPage(page) { + $posts.hide(); + $posts.slice((page - 1) * itemsPerPage, page * itemsPerPage).show(); + } + + function createPaginationControls() { + const $paginationControls = $('#pagination-controls'); + $paginationControls.empty(); + for (let i = 1; i <= totalPages; i++) { + $paginationControls.append(`${i} `); + } + $paginationControls.find('.page-link').on('click', function(e) { + e.preventDefault(); + currentPage = $(this).data('page'); + showPage(currentPage); + updateActivePagination(); + }); + updateActivePagination(); + } + + function updateActivePagination() { + $('#pagination-controls .page-link').removeAttr('id'); + $(`#pagination-controls .page-link[data-page="${currentPage}"]`).attr('id', 'active-pagination'); + } + + console.log('loaded') + + createPaginationControls(); + showPage(currentPage); + }); \ No newline at end of file diff --git a/updates.html b/updates.html index eaa8215..ab7b83e 100644 --- a/updates.html +++ b/updates.html @@ -10,11 +10,10 @@ {% include newsletter-subscribe.html %}
-

Updates

-

The latest updates from developers contributing to the Tari protocol.

- -
-

Have questions or want to contribute? Join the community discussion on Discord or #tari-dev on Libera.Chat. You can also subscribe to these updates using the RSS Feed.

+

Updates

+

The latest updates from developers contributing to the Tari protocol.

+
+

Have questions or want to contribute? Join the community discussion on Discord or #tari-dev on Libera.Chat. You can also subscribe to these updates using the RSS Feed.

Updates

{% assign updates = site.updates | sort:"date" | reverse %} {% for post in updates %} {% include updates-area.html %} {% endfor %} +
+ +