diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mixins/post.pug | 2 | ||||
-rw-r--r-- | src/public/styles.css | 27 | ||||
-rw-r--r-- | src/views/comments.pug | 35 |
3 files changed, 34 insertions, 30 deletions
diff --git a/src/mixins/post.pug b/src/mixins/post.pug index 4ec7614..472cab2 100644 --- a/src/mixins/post.pug +++ b/src/mixins/post.pug | |||
@@ -47,7 +47,7 @@ mixin post(p, currentUrl) | |||
47 | img(src=url onclick=onclick) | 47 | img(src=url onclick=onclick) |
48 | else if isPostVideo(p) | 48 | else if isPostVideo(p) |
49 | - var decodedVideos = decodePostVideoUrls(p) | 49 | - var decodedVideos = decodePostVideoUrls(p) |
50 | video(autoplay="" muted="" data-dashjs-player="" onclick=`toggleDetails('${p.id}')` poster=decodedVideos[4] width="100px" height="100px") | 50 | video(autoplay="" playsinline="" muted="" data-dashjs-player="" onclick=`toggleDetails('${p.id}')` poster=decodedVideos[4] width="100px" height="100px") |
51 | // Scrubber | 51 | // Scrubber |
52 | source(src=decodedVideos[3]) | 52 | source(src=decodedVideos[3]) |
53 | else if isPostLink(p) | 53 | else if isPostLink(p) |
diff --git a/src/public/styles.css b/src/public/styles.css index bc0e1ec..deaf63d 100644 --- a/src/public/styles.css +++ b/src/public/styles.css | |||
@@ -11,9 +11,9 @@ | |||
11 | --link-visited-color: #999; | 11 | --link-visited-color: #999; |
12 | --accent: var(--link-color); | 12 | --accent: var(--link-color); |
13 | --error-text-color: red; | 13 | --error-text-color: red; |
14 | --border-radius-card: 8px; | 14 | --border-radius-card: 4vmin; |
15 | --border-radius-media: 6px; | 15 | --border-radius-media: 3vmin; |
16 | --border-radius-preview: 4px; | 16 | --border-radius-preview: 2vmin; |
17 | 17 | ||
18 | font-family: Inter, sans-serif; | 18 | font-family: Inter, sans-serif; |
19 | font-feature-settings: 'ss01' 1, 'kern' 1, 'liga' 1, 'cv05' 1, 'dlig' 1, 'ss01' 1, 'ss07' 1, 'ss08' 1; | 19 | font-feature-settings: 'ss01' 1, 'kern' 1, 'liga' 1, 'cv05' 1, 'dlig' 1, 'ss01' 1, 'ss07' 1, 'ss08' 1; |
@@ -302,6 +302,15 @@ summary::before { | |||
302 | object-fit: fill; | 302 | object-fit: fill; |
303 | } | 303 | } |
304 | 304 | ||
305 | .image-viewer.main-content img, | ||
306 | .image-viewer.main-content video { | ||
307 | max-height: 70vh; | ||
308 | } | ||
309 | |||
310 | .image-viewer.main-content a { | ||
311 | margin: unset; | ||
312 | } | ||
313 | |||
305 | .image-viewer a:has(img) { | 314 | .image-viewer a:has(img) { |
306 | font-size: 0rem; | 315 | font-size: 0rem; |
307 | padding: unset; | 316 | padding: unset; |
@@ -311,7 +320,8 @@ summary::before { | |||
311 | .image-viewer a { | 320 | .image-viewer a { |
312 | font-size: 1.5rem; | 321 | font-size: 1.5rem; |
313 | text-decoration: none; | 322 | text-decoration: none; |
314 | padding: 1rem; | 323 | padding: unset; |
324 | margin: 1rem; | ||
315 | } | 325 | } |
316 | 326 | ||
317 | .media-maximized { | 327 | .media-maximized { |
@@ -415,7 +425,7 @@ form { | |||
415 | } | 425 | } |
416 | .image-viewer a { | 426 | .image-viewer a { |
417 | font-size: 1rem; | 427 | font-size: 1rem; |
418 | margin: 0.5rem; | 428 | margin: 1rem; |
419 | padding: initial; | 429 | padding: initial; |
420 | } | 430 | } |
421 | .self-text.card { | 431 | .self-text.card { |
@@ -613,13 +623,6 @@ details:not([open]) summary::before { | |||
613 | padding-right: 10px; | 623 | padding-right: 10px; |
614 | } | 624 | } |
615 | 625 | ||
616 | details.compact { | ||
617 | /* | ||
618 | display: flex; | ||
619 | flex-basis: 100%; | ||
620 | */ | ||
621 | } | ||
622 | |||
623 | .footer { | 626 | .footer { |
624 | padding-bottom: 40px; | 627 | padding-bottom: 40px; |
625 | } | 628 | } |
diff --git a/src/views/comments.pug b/src/views/comments.pug index 1caf65a..1265609 100644 --- a/src/views/comments.pug +++ b/src/views/comments.pug | |||
@@ -47,23 +47,24 @@ html | |||
47 | h2.post-title | 47 | h2.post-title |
48 | != post.title | 48 | != post.title |
49 | 49 | ||
50 | if isPostGallery(post) | 50 | div.image-viewer.main-content |
51 | div.gallery | 51 | if isPostGallery(post) |
52 | each item in postGalleryItems(post) | 52 | div.gallery |
53 | div.gallery-item | 53 | each item in postGalleryItems(post) |
54 | div.gallery-item-idx | 54 | div.gallery-item |
55 | | #{`${item.idx}/${item.total}`} | 55 | a(href=`/media/${item.url}`) |
56 | a(href=`/media/${item.url}`) | 56 | img(src=item.url loading="lazy") |
57 | img(src=item.url loading="lazy") | 57 | div.gallery-item-idx |
58 | else if isPostImage(post) | 58 | | #{`${item.idx}/${item.total}`} |
59 | a(href=`/media/${post.url}`) | 59 | else if isPostImage(post) |
60 | img(src=post.url).post-media | 60 | a(href=`/media/${post.url}`) |
61 | else if isPostVideo(post) | 61 | img(src=post.url).post-media |
62 | - var url = post.secure_media.reddit_video.dash_url | 62 | else if isPostVideo(post) |
63 | video(controls data-dashjs-player src=`${url}`).post-media | 63 | - var url = post.secure_media.reddit_video.dash_url |
64 | else if isPostLink(post) | 64 | video(controls data-dashjs-player src=`${url}`).post-media |
65 | a(href=post.url) | 65 | else if isPostLink(post) |
66 | | #{post.url} | 66 | a(href=post.url) |
67 | | #{post.domain} ↗ | ||
67 | 68 | ||
68 | if post.selftext_html | 69 | if post.selftext_html |
69 | div.self-text | 70 | div.self-text |