diff options
| author | 2025-10-20 19:01:05 +0700 | |
|---|---|---|
| committer | 2025-10-20 19:01:05 +0700 | |
| commit | df20c871060ad88254f18d4a04f714edf59156f0 (patch) | |
| tree | 3161c1417a314ee13595fef6906969ac92172edf /internal/glightbox/html_renderer.go | |
| parent | 3266aae61dbaaba45e32d64d7faddaaa671f8b52 (diff) | |
| parent | 64397d4d27c14427ee8cb8d5a7618058d04f3737 (diff) | |
| download | web-df20c871060ad88254f18d4a04f714edf59156f0.tar.gz web-df20c871060ad88254f18d4a04f714edf59156f0.zip | |
v0.10.0 (#15)v0.10.0
- [feat: have toolbar on the top by default (only return to left if the
screen is short on
height)](https://github.com/SayaAndy/saya-today-web/commit/324c6df1ab878aa0c34f80c58f730e01aca1f4e9)
- feat: switch font to Andika
- [feat: add noise to plain color
backgrounds](https://github.com/SayaAndy/saya-today-web/commit/36d7f332e6c318064ff0cd6849f69854c7ba0d79)
- [feat: shorten toolbar in global map, paint map on the whole
screen](https://github.com/SayaAndy/saya-today-web/commit/2cbbaaa40019e452b41c98720af8c23759351200)
- [feat: redo language page with general page
layout](https://github.com/SayaAndy/saya-today-web/commit/f6c60d0a963817189854f5b42bc58a76ddb90d53)
- feat: move back button from header to toolbar
- feat: switch masonry to use rem units
- feat: fit masonry to center
- feat: make inset shadows more apparent
- feat: header font: less thick, non-italic and drops shadow
- [fix: home page header getting too close to right
border](https://github.com/SayaAndy/saya-today-web/commit/fdb8582f40168dbb0795358f1ea950a26f157b2d)
- feat: paint shadow off home page header
- fix: have toolbar buttons' href updated with language change
- fix: add missing underline in contacts panel
Diffstat (limited to 'internal/glightbox/html_renderer.go')
| -rw-r--r-- | internal/glightbox/html_renderer.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/internal/glightbox/html_renderer.go b/internal/glightbox/html_renderer.go index aad7984..deafb4d 100644 --- a/internal/glightbox/html_renderer.go +++ b/internal/glightbox/html_renderer.go @@ -134,12 +134,12 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte, w.WriteString(fmt.Sprintf(` <div class="justify-content-center display-block m-1"> - <hr class="border-t-3 border-dotted border-main-dark mt-1 mb-2 w-[80%%] ml-auto mr-auto"> + <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-sizer grid-sizer-%s"></div> %s </div> - <hr class="border-t-3 border-dotted border-main-dark mt-1 mb-2 w-[80%%] ml-auto mr-auto"> + <hr class="border-t-3 border-dotted border-main-hard mt-1 mb-2 w-[80%%] ml-auto mr-auto"> </div>`, galleryID, galleryID, strings.Join(elements, "\n"))) w.WriteString(fmt.Sprintf(` @@ -147,25 +147,29 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte, var msnry_%s = new Masonry('.masonry-grid-%s', { itemSelector: '.grid-item-%s', columnWidth: '.grid-sizer-%s', - percentPosition: true + percentPosition: false, + fitWidth: true }); var imgLoad_%s_timer; var imgLoad_%s = imagesLoaded('.masonry-grid-%s'); - function initMasonryLayout_%s() { + function initMasonryLayout_%s(tm) { clearTimeout(imgLoad_%s_timer); - imgLoad_%s_timer = setTimeout(() => msnry_%s.layout(), 500); + imgLoad_%s_timer = setTimeout(() => msnry_%s.layout(), 300); } imgLoad_%s.on('progress', initMasonryLayout_%s); + window.addEventListener('resize', initMasonryLayout_%s); + document.addEventListener('popout', (e) => { + window.removeEventListener('resize', initMasonryLayout_%s); imgLoad_%s.off('progress', initMasonryLayout_%s); initMasonryLayout_%s = null; imgLoad_%s = null; - }); -</script>`, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID)) + }, {once: true}); +</script>`, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID)) } return ast.WalkContinue, nil |