Gallery: photos open lightbox, add project button, watermark our photos

Gallery flow:
- Album covers now open the photo lightbox directly (full album set), while
  the title/"Read the story" link opens the article. Previously the whole card
  linked to the article and photos were only at the bottom of it.
- Each album carries its full photo set in a hidden js-lightbox grid; added
  main.js support for [data-lightbox-target] cover triggers.
- Added the missing main.js include on the gallery page (its lightbox, mobile
  menu and language switcher never ran before).
- Lightbox gained an optional "Read the story ->" button (data-project-url /
  data-project-label) shown only for gallery albums.

Watermark:
- Baked a subtle "(c) msosorg.com" watermark (bottom-right, sized per image)
  into 114 of our own event/community photos. Stock/partner/logo/icon images
  excluded. Clean originals backed up to images/_originals/ (git-ignored); the
  script always re-derives from them so re-runs never stack.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
popovskikandClaude Opus 4.8 committed 2026-08-08 01:55:34 +02:00
1 parent 91d29121c0
commit e8604a9665
121 files changed
+519 -139

No files matched your search

+18
View File
@@ -873,11 +873,13 @@ document.addEventListener('DOMContentLoaded', function() {
'<button type="button" class="lightbox-prev" aria-label="Previous">&#10094;</button>' +
'<img class="lightbox-img" src="" alt="">' +
'<button type="button" class="lightbox-next" aria-label="Next">&#10095;</button>' +
'<a class="lightbox-project" href="#" hidden></a>' +
'<div class="lightbox-caption"></div>';
document.body.appendChild(lb);
var img = lb.querySelector('.lightbox-img');
var cap = lb.querySelector('.lightbox-caption');
var proj = lb.querySelector('.lightbox-project');
var group = [];
var idx = 0;
@@ -892,6 +894,15 @@ document.addEventListener('DOMContentLoaded', function() {
return { full: b.getAttribute('data-full'), caption: b.getAttribute('data-caption') || '' };
});
idx = start;
// Optional "go to project" link (present on gallery-page albums).
var purl = grid.getAttribute('data-project-url');
if (purl) {
proj.setAttribute('href', purl);
proj.textContent = grid.getAttribute('data-project-label') || 'View project';
proj.hidden = false;
} else {
proj.hidden = true;
}
render();
lb.classList.add('is-open');
lb.setAttribute('aria-hidden', 'false');
@@ -910,6 +921,13 @@ document.addEventListener('DOMContentLoaded', function() {
b.addEventListener('click', function () { open(grid, i); });
});
});
// Triggers that open a target gallery (e.g. gallery-page album covers).
document.querySelectorAll('[data-lightbox-target]').forEach(function (trig) {
trig.addEventListener('click', function () {
var g = document.getElementById(trig.getAttribute('data-lightbox-target'));
if (g) open(g, 0);
});
});
lb.querySelector('.lightbox-close').addEventListener('click', close);
lb.querySelector('.lightbox-prev').addEventListener('click', function () { step(-1); });
lb.querySelector('.lightbox-next').addEventListener('click', function () { step(1); });