summaryrefslogtreecommitdiff
path: root/internal/glightbox/html_renderer.go
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'internal/glightbox/html_renderer.go')
-rw-r--r--internal/glightbox/html_renderer.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/internal/glightbox/html_renderer.go b/internal/glightbox/html_renderer.go
index b7b256a..7022793 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="items-center flex flex-col">
+<div class="justify-content-center display-block">
<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">
+ <div class="grid masonry-grid-%s mx-auto">
<div class="grid-sizer grid-sizer-%s"></div>
%s
</div>
@@ -144,10 +144,11 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte,
w.WriteString(fmt.Sprintf(`
<script>
- var pckry_%s = new Packery('.masonry-grid-%s', {
+ var msnry_%s = new Masonry('.masonry-grid-%s', {
itemSelector: '.grid-item-%s',
columnWidth: '.grid-sizer-%s',
- percentPosition: false
+ percentPosition: false,
+ fitWidth: true
});
var imgLoad_%s_timer;
@@ -155,7 +156,7 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte,
function initMasonryLayout_%s(tm) {
clearTimeout(imgLoad_%s_timer);
- imgLoad_%s_timer = setTimeout(() => pckry_%s.layout(), 100);
+ imgLoad_%s_timer = setTimeout(() => msnry_%s.layout(), 100);
}
imgLoad_%s.on('progress', initMasonryLayout_%s);