Add SPA post overlay

This commit is contained in:
Cadence Fish
2020-02-22 01:35:19 +13:00
parent 13e40259b7
commit aac358cd65
9 changed files with 317 additions and 103 deletions

View File

@@ -0,0 +1,17 @@
include ./display_structured
mixin post(post)
.post-page-divider
section.description-section
header.user-header
img(src=post.ownerPfpCacheP width=150 height=150 alt="").pfp
a.name(href=`/u/${post.getBasicOwner().username}`)= `${post.data.owner.full_name} (@${post.getBasicOwner().username})`
if post.getCaption()
p.structured-text.description
+display_structured(post.getStructuredCaption())
section.images-gallery
for entry in post.children
if entry.isVideo()
video(src=entry.getVideoUrlP() controls preload="auto" width=entry.data.dimensions.width height=entry.data.dimensions.height).sized-video
else
img(src=entry.getDisplayUrlP() alt=entry.getAlt() width=entry.data.dimensions.width height=entry.data.dimensions.height).sized-image

View File

@@ -11,5 +11,5 @@ mixin timeline_page(page, pageIndex)
- const suggestedSize = 260 //- from css :(
each image in page
- const thumbnail = image.getSuggestedThumbnailP(suggestedSize) //- use this as the src in case there are problems with srcset
a(href=`/p/${image.data.shortcode}`).sized-link
a(href=`/p/${image.data.shortcode}` data-shortcode=image.data.shortcode).sized-link
img(src=thumbnail.src alt=image.getAlt() width=thumbnail.config_width height=thumbnail.config_height srcset=image.getThumbnailSrcsetP() sizes=image.getThumbnailSizes()).sized-image