summaryrefslogtreecommitdiff
path: root/internal/glightbox/html_renderer.go
diff options
from:
to:
context:
space:
mode:
authorGravatar Saya Andy <145215889+SayaAndy@users.noreply.github.com> 2025-11-04 14:49:41 +0300
committerGravatar GitHub <noreply@github.com> 2025-11-04 14:49:41 +0300
commit77a43ebb42d80e3c6bbdf39b16a38f0f3ec4b30c (patch)
treea098615be83bf760a4643e5752f990ef9f29fe98 /internal/glightbox/html_renderer.go
parentce86bf8e7a32a98aeab696bf38b0cc2f4ada4905 (diff)
parent05d7fe78450219e85ebe9c4372a20f8edd264d8d (diff)
downloadweb-77a43ebb42d80e3c6bbdf39b16a38f0f3ec4b30c.tar.gz
web-77a43ebb42d80e3c6bbdf39b16a38f0f3ec4b30c.zip
v0.11.3 (#20)v0.11.3
- [fix: correctly pack galleries on mobiles](https://github.com/SayaAndy/saya-today-web/commit/c52a07e3fa738135eaa5272d9f115e4740b60c61) - [feat: move published date info from header into start of the body](https://github.com/SayaAndy/saya-today-web/commit/05d7fe78450219e85ebe9c4372a20f8edd264d8d) - feat: show action date on any screen - feat: show short description together with dates in page's body - feat: switch masonry to packery - debug: log app shutdown more
Diffstat (limited to 'internal/glightbox/html_renderer.go')
-rw-r--r--internal/glightbox/html_renderer.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/glightbox/html_renderer.go b/internal/glightbox/html_renderer.go
index 7022793..b7b256a 100644
--- a/internal/glightbox/html_renderer.go
+++ b/internal/glightbox/html_renderer.go
@@ -133,9 +133,9 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte,
}
w.WriteString(fmt.Sprintf(`
-<div class="justify-content-center display-block">
+<div class="items-center flex flex-col">
<hr class="border-t-3 border-dotted border-main-hard mt-1 mb-2 w-[80%%] ml-auto mr-auto">
- <div class="grid masonry-grid-%s mx-auto">
+ <div class="grid masonry-grid-%s">
<div class="grid-sizer grid-sizer-%s"></div>
%s
</div>
@@ -144,11 +144,10 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte,
w.WriteString(fmt.Sprintf(`
<script>
- var msnry_%s = new Masonry('.masonry-grid-%s', {
+ var pckry_%s = new Packery('.masonry-grid-%s', {
itemSelector: '.grid-item-%s',
columnWidth: '.grid-sizer-%s',
- percentPosition: false,
- fitWidth: true
+ percentPosition: false
});
var imgLoad_%s_timer;
@@ -156,7 +155,7 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte,
function initMasonryLayout_%s(tm) {
clearTimeout(imgLoad_%s_timer);
- imgLoad_%s_timer = setTimeout(() => msnry_%s.layout(), 100);
+ imgLoad_%s_timer = setTimeout(() => pckry_%s.layout(), 100);
}
imgLoad_%s.on('progress', initMasonryLayout_%s);