Infinite scroll

This commit is contained in:
Cadence Fish
2020-01-13 04:39:50 +13:00
parent a3b4e2e64e
commit b5f163891c
7 changed files with 93 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
include includes/timeline_page.pug
include includes/next_page_button.pug
- const numberFormat = new Intl.NumberFormat().format
@@ -10,6 +11,7 @@ html
title
= `${user.data.full_name} (@${user.data.username}) | Bibliogram`
link(rel="stylesheet" type="text/css" href="/static/css/main.css")
script(src="/static/js/pagination.js" type="module")
body
.main-divider
header.profile-overview
@@ -34,16 +36,8 @@ html
|
| followed by
main.timeline
main#timeline.timeline
each page, pageIndex in user.timeline.pages
+timeline_page(page, pageIndex)
if user.timeline.hasNextPage()
div.next-page-container
-
const nu = new URL(url)
nu.searchParams.set("page", user.timeline.pages.length+1)
a(href=`${nu.search}#page-${user.timeline.pages.length+1}` data-cursor=user.timeline.page_info.end_cursor)#next-page.next-page Next page
else
div.page-number.no-more-pages
span.number No more posts.
+next_page_button(user, url)