diff options
author | Akshay <[email protected]> | 2024-10-31 19:35:52 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2024-10-31 19:35:52 +0000 |
commit | dff02621742483ddf14ee4bbc6b8555b8a67298f (patch) | |
tree | 5176668d26a6ee048037a7dacc976b7e09360b15 | |
parent | 6555c541e1d3ffeffc811e17dd1a69c1d3e0a314 (diff) |
more fixes for galleries
-rw-r--r-- | src/mixins/post.pug | 24 | ||||
-rw-r--r-- | src/public/styles.css | 7 | ||||
-rw-r--r-- | src/views/comments.pug | 8 |
3 files changed, 25 insertions, 14 deletions
diff --git a/src/mixins/post.pug b/src/mixins/post.pug index 006193f..8a66d53 100644 --- a/src/mixins/post.pug +++ b/src/mixins/post.pug | |||
@@ -7,6 +7,16 @@ mixin post(p) | |||
7 | a(href=`/comments/${p.id}`) | 7 | a(href=`/comments/${p.id}`) |
8 | != p.title | 8 | != p.title |
9 | span.domain (#{p.domain}) | 9 | span.domain (#{p.domain}) |
10 | div.info-container | ||
11 | p | ||
12 | | ↑ #{fmtnum(p.ups)} | ||
13 | | · | ||
14 | a(href=`/comments/${p.id}`) #{fmtnum (p.num_comments)} replies | ||
15 | | · | ||
16 | a(href=`/r/${p.subreddit}`) r/#{p.subreddit} | ||
17 | span.post-author | ||
18 | | · | ||
19 | by u/#{p.author} | ||
10 | div.media-preview | 20 | div.media-preview |
11 | if p.is_gallery && p.is_gallery == true | 21 | if p.is_gallery && p.is_gallery == true |
12 | if p.gallery_data | 22 | if p.gallery_data |
@@ -20,17 +30,6 @@ mixin post(p) | |||
20 | else if p.post_hint == "hosted:video" | 30 | else if p.post_hint == "hosted:video" |
21 | - var url = p.secure_media.reddit_video.dash_url | 31 | - var url = p.secure_media.reddit_video.dash_url |
22 | video(src=url data-dashjs-player width='100px' height='100px' onclick=`toggleDetails('${p.id}')`) | 32 | video(src=url data-dashjs-player width='100px' height='100px' onclick=`toggleDetails('${p.id}')`) |
23 | div.info-container | ||
24 | p | ||
25 | | ↑ #{fmtnum(p.ups)} | ||
26 | | · | ||
27 | | 💬 | ||
28 | a(href=`/comments/${p.id}`) #{fmtnum (p.num_comments)} | ||
29 | | · | ||
30 | a(href=`/r/${p.subreddit}`) r/#{p.subreddit} | ||
31 | span.post-author | ||
32 | | · | ||
33 | by u/#{p.author} | ||
34 | 33 | ||
35 | if p.is_gallery && p.is_gallery == true | 34 | if p.is_gallery && p.is_gallery == true |
36 | if p.gallery_data | 35 | if p.gallery_data |
@@ -52,7 +51,6 @@ mixin post(p) | |||
52 | details(id=`${p.id}`) | 51 | details(id=`${p.id}`) |
53 | summary expand video | 52 | summary expand video |
54 | - var url = p.secure_media.reddit_video.dash_url | 53 | - var url = p.secure_media.reddit_video.dash_url |
55 | a(href=url) | 54 | video(src=url controls data-dashjs-player).post-media |
56 | video(src=url controls data-dashjs-player).post-media | ||
57 | button(onclick=`toggleDetails('${p.id}')`) close | 55 | button(onclick=`toggleDetails('${p.id}')`) close |
58 | 56 | ||
diff --git a/src/public/styles.css b/src/public/styles.css index f619dcc..7a27e82 100644 --- a/src/public/styles.css +++ b/src/public/styles.css | |||
@@ -235,3 +235,10 @@ summary { | |||
235 | .footer { | 235 | .footer { |
236 | padding-bottom: 40px; | 236 | padding-bottom: 40px; |
237 | } | 237 | } |
238 | |||
239 | a { | ||
240 | white-space: normal; | ||
241 | word-wrap: break-word; | ||
242 | overflow-wrap: break-word; | ||
243 | } | ||
244 | |||
diff --git a/src/views/comments.pug b/src/views/comments.pug index 0898a9c..e335cae 100644 --- a/src/views/comments.pug +++ b/src/views/comments.pug | |||
@@ -14,7 +14,13 @@ html | |||
14 | h4 r/#{post.subreddit} | 14 | h4 r/#{post.subreddit} |
15 | h2 #{post.title} | 15 | h2 #{post.title} |
16 | 16 | ||
17 | if post.post_hint == 'image' | 17 | if post.is_gallery && post.is_gallery == true |
18 | if post.gallery_data | ||
19 | if post.gallery_data.items | ||
20 | each item in post.gallery_data.items | ||
21 | - var url = `https://i.redd.it/${item.media_id}.jpg` | ||
22 | img(src=url).post-media | ||
23 | if (post.post_hint == "image" || post.post_hint == "link") && post.thumbnail && post.thumbnail != "self" && post.thumbnail != "default" | ||
18 | img(src=post.url).post-media | 24 | img(src=post.url).post-media |
19 | else if post.post_hint == 'hosted:video' | 25 | else if post.post_hint == 'hosted:video' |
20 | - var url = post.secure_media.reddit_video.dash_url | 26 | - var url = post.secure_media.reddit_video.dash_url |