aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPortableProgrammer <[email protected]>2025-01-08 18:00:18 +0000
committerPortableProgrammer <[email protected]>2025-01-08 18:00:18 +0000
commit2c4522bef5c2f7b223b69d910a428c9c0eabb3d5 (patch)
treecf25e72c8e71a9cd48874f6719ad7a4149405091
parent3cd139f528f6c8d8186843e800672d16fd1c5558 (diff)
Remove `card`-specific `post` elements
-rw-r--r--src/mixins/post.pug53
-rw-r--r--src/public/styles.css40
2 files changed, 30 insertions, 63 deletions
diff --git a/src/mixins/post.pug b/src/mixins/post.pug
index 36ea1b8..df499e2 100644
--- a/src/mixins/post.pug
+++ b/src/mixins/post.pug
@@ -77,31 +77,28 @@ mixin post(p, currentUrl)
77 | #{p.domain} 77 | #{p.domain}
78 | ↗ 78 | ↗
79 79
80 if (isPostGallery(p) || isPostImage(p) || isPostVideo(p)) 80 if query.view == "compact" && (isPostGallery(p) || isPostImage(p) || isPostVideo(p))
81 details(id=`${p.id}`,class=`${query.view}`) 81 details(id=`${p.id}`)
82 summary.expand-post expand media 82 summary.expand-post expand media
83 div.image-viewer(class=`${query.view}`) 83 div.image-viewer
84 if isPostGallery(p) 84 if isPostGallery(p)
85 div.gallery(class=`${query.view}`) 85 div.gallery
86 each item in postGalleryItems(p) 86 each item in postGalleryItems(p)
87 div.gallery-item(class=`${query.view}`) 87 div.gallery-item
88 div.gallery-item-idx(class=`${query.view}`) 88 div.gallery-item-idx
89 | #{`${item.idx}/${item.total}`} 89 | #{`${item.idx}/${item.total}`}
90 a(href=`/media/${item.url}`) 90 a(href=`/media/${item.url}`)
91 img(src=item.url loading="lazy") 91 img(src=item.url loading="lazy")
92 else if isPostImage(p) 92 else if isPostImage(p)
93 a(href=`/media/${p.url}`) 93 a(href=`/media/${p.url}`)
94 img(src=p.url loading="lazy").post-media 94 img(src=p.url loading="lazy").post-media
95 else if isPostVideo(p) 95 else if isPostVideo(p)
96 video(controls="" muted="" data-dashjs-player="" preload="metadata" playsinline="" poster=decodedVideos[4] objectfit="contain" loading="lazy").post-media 96 video(controls="" muted="" data-dashjs-player="" preload="metadata" playsinline="" poster=decodedVideos[4] objectfit="contain" loading="lazy").post-media
97 //HLS 97 //HLS
98 source(src=decodedVideos[0]) 98 source(src=decodedVideos[0])
99 // Dash 99 // Dash
100 source(src=decodedVideos[1]) 100 source(src=decodedVideos[1])
101 // Fallback 101 // Fallback
102 source(src=decodedVideos[2]) 102 source(src=decodedVideos[2])
103 button(onclick=`toggleDetails('${p.id}')`,class=`${query.view}`) 103 button(onclick=`toggleDetails('${p.id}')`)
104 if (query.view == 'card') 104 | close
105 | ╳
106 else
107 | close
diff --git a/src/public/styles.css b/src/public/styles.css
index abc2f13..b1d1318 100644
--- a/src/public/styles.css
+++ b/src/public/styles.css
@@ -61,9 +61,14 @@ div.media-maximized.container.zoom {
61 overflow: auto; 61 overflow: auto;
62} 62}
63 63
64img.media-maximized {
65 cursor: zoom-in;
66}
67
64img.media-maximized.zoom { 68img.media-maximized.zoom {
65 max-width: unset; 69 max-width: unset;
66 max-height: unset; 70 max-height: unset;
71 cursor: zoom-out;
67} 72}
68 73
69main { 74main {
@@ -195,41 +200,6 @@ nav {
195 cursor: pointer; 200 cursor: pointer;
196} 201}
197 202
198.image-viewer.card {
199 /* Safari on iOS <= 17 */
200 -webkit-backdrop-filter: blur(2rem);
201 backdrop-filter: blur(2rem);
202 position: fixed;
203 inset: 0;
204 box-sizing: border-box;
205 display: flex;
206 height: 100%;
207 width: 100%;
208 justify-content: center;
209 align-items: center;
210 z-index: 100;
211}
212
213.image-viewer.card > button {
214 position: absolute;
215 top: 0;
216 right: 0;
217 margin: 1rem;
218 padding: initial;
219 height: 3rem;
220 width: 3rem;
221 font-size: 2rem;
222 border-radius: 100%;
223 cursor: pointer;
224}
225
226.image-viewer.card > a > img {
227 max-width: 100vw;
228 max-height: 100vh;
229 width: auto;
230 height: auto;
231}
232
233.gallery.card { 203.gallery.card {
234 align-items: center; 204 align-items: center;
235} 205}