feat: implement infinite scroll on the author page
All checks were successful
Deploy Theme / deploy (push) Successful in 12s
All checks were successful
Deploy Theme / deploy (push) Successful in 12s
This commit is contained in:
17
author.hbs
17
author.hbs
@@ -65,7 +65,22 @@
|
|||||||
{{#foreach posts}}
|
{{#foreach posts}}
|
||||||
{{> "post-card"}}
|
{{> "post-card"}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
||||||
|
{{#if pagination.next}}
|
||||||
|
<div id="pagination-trigger"
|
||||||
|
hx-get="{{page_url pagination.next}}"
|
||||||
|
hx-trigger="revealed"
|
||||||
|
hx-select="#posts-container > *"
|
||||||
|
hx-target="this"
|
||||||
|
hx-swap="outerHTML"
|
||||||
|
hx-indicator="#loading-spinner"
|
||||||
|
class="col-span-full h-1">
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{pagination}}
|
<div id="loading-spinner" class="htmx-indicator text-center py-12">
|
||||||
|
<div class="inline-block animate-spin rounded-full h-10 w-10 border-4 border-[var(--brand-primary)] border-t-transparent"></div>
|
||||||
|
<p class="text-[var(--text-secondary)] mt-4 font-medium tracking-wide">Loading more posts...</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user