summaryrefslogtreecommitdiff
path: root/internal/glightbox
diff options
from:
to:
context:
space:
mode:
authorGravatar Saya Andy <145215889+SayaAndy@users.noreply.github.com> 2025-10-18 22:54:30 +0700
committerGravatar GitHub <noreply@github.com> 2025-10-18 22:54:30 +0700
commit3266aae61dbaaba45e32d64d7faddaaa671f8b52 (patch)
tree09a444341fff609c2920c10c0b1eb8442a3ea5e0 /internal/glightbox
parentc47025d4d63d06c6eb396377f87ebdb26c6f3b34 (diff)
parent0aeed432c4fbce4a87b56e4dcb14b25065438300 (diff)
downloadweb-0.9.4.tar.gz
web-0.9.4.zip
v0.9.4 (#14)v0.9.4
- [feat: uninterruptable lightbox](https://github.com/SayaAndy/saya-today-web/commit/7a65150afeb67ab83ac2eb34194601033e3d647d) - [fix: disable horizontal order for masonry](https://github.com/SayaAndy/saya-today-web/commit/5216fe419f15bab38add61084e46d052ad117aa2) - fix: image description taking up all the height in glightbox - feat: raise width levels for columns count in gallery - [fix: show tooltips over leaflet map controls](https://github.com/SayaAndy/saya-today-web/commit/7275a7813d6ecaba344e25ddb5b24083e4861a76) - feat: raise width levels for thumbnails resolution - [fix: display theme wheel correctly in map page](https://github.com/SayaAndy/saya-today-web/commit/f87c9ca31061b232e7e3d71b8cb3c5895c9f77dc) - [fix: stretch map to feel empty space on the right](https://github.com/SayaAndy/saya-today-web/commit/0aeed432c4fbce4a87b56e4dcb14b25065438300)
Diffstat (limited to 'internal/glightbox')
-rw-r--r--internal/glightbox/html_renderer.go28
1 files changed, 11 insertions, 17 deletions
diff --git a/internal/glightbox/html_renderer.go b/internal/glightbox/html_renderer.go
index 44fbd4c..aad7984 100644
--- a/internal/glightbox/html_renderer.go
+++ b/internal/glightbox/html_renderer.go
@@ -110,19 +110,19 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte,
anchorlessCaptionHTML := r.anchorMatchRe.ReplaceAll(captionHTML, []byte("<span class=\"linklike\" $1 $3>$4</span>"))
elements = append(elements, fmt.Sprintf(`
- <a href="https://f003.backblazeb2.com/file/sayana-photos/full/%s" class="glightbox-%s grid-item %s grid-item-%s p-1"
- data-gallery="gallery-%s" data-title="%s" %s>
+ <a href="https://f003.backblazeb2.com/file/sayana-photos/full/%s" class="glightbox grid-item %s grid-item-%s p-1"
+ data-gallery="gallery" data-title="%s" %s>
<picture>
- <source media="(width < 640px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-320p/%s.webp" />
- <source media="(width < 1120px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-560p/%s.webp" />
- <source media="(width < 1600px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-800p/%s.webp" />
- <source media="(width < 2400px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-1200p/%s.webp" />
- <source media="(width >= 2400px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-1600p/%s.webp" />
- <img src="https://f003.backblazeb2.com/file/sayana-photos/webp-800p/%s.webp" />
+ <source media="(width < 800px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-320p/%s.webp" />
+ <source media="(width < 2400px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-560p/%s.webp" />
+ <source media="(width < 3200px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-800p/%s.webp" />
+ <source media="(width < 4000px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-1200p/%s.webp" />
+ <source media="(width >= 4000px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-1600p/%s.webp" />
+ <img src="https://f003.backblazeb2.com/file/sayana-photos/webp-560p/%s.webp" />
</picture>
<span class="grid-tooltip-text"><p>%s</p></span>
<span class="grid-item-index">%d</span>
- </a>`, img.URL, galleryID, strings.Join(tagClassList, " "), galleryID, galleryID, dayDate.Format("2006-01-02 15:04:05 -07:00"), dataDescriptionAttribute, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, anchorlessCaptionHTML, i+1))
+ </a>`, img.URL, strings.Join(tagClassList, " "), galleryID, dayDate.Format("2006-01-02 15:04:05 -07:00"), dataDescriptionAttribute, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, anchorlessCaptionHTML, i+1))
if glightboxDescId != "" {
elements = append(elements, fmt.Sprintf(`
@@ -144,16 +144,10 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte,
w.WriteString(fmt.Sprintf(`
<script>
- var lightbox_%s = GLightbox({
- selector: '.glightbox-%s',
- moreLength: 0
- });
-
var msnry_%s = new Masonry('.masonry-grid-%s', {
itemSelector: '.grid-item-%s',
columnWidth: '.grid-sizer-%s',
- percentPosition: true,
- horizontalOrder: true
+ percentPosition: true
});
var imgLoad_%s_timer;
@@ -171,7 +165,7 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte,
initMasonryLayout_%s = null;
imgLoad_%s = null;
});
-</script>`, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID))
+</script>`, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID))
}
return ast.WalkContinue, nil