Add Gallery page (per-event albums + lightbox); remove video-thumbnail blur
- New multilingual Gallery page (en/mk/si) with 9 event albums and a keyboard-accessible lightbox (prev/next scoped per album) - Reuses existing event photos; links each album to its event post - New css/pages/_gallery.css + setupGallery() lightbox in main.js - "Gallery" link added to the "What We Do" nav (desktop + mobile) site-wide - Gallery URLs added to sitemap.xml with hreflang - Landing "Every Student Has a Story": removed backdrop blur on the video thumbnail, kept the bluish gradient tint Note: images/original/ (458 MB of raw source photos, gitignored + unused by the site) moved out of the working tree to reclaim disk. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
f5dfd8830e
commit
d085e3376a
218 files changed
+1837
-2
No files matched your search
@@ -833,6 +833,60 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ===================================================================
|
||||
* GALLERY LIGHTBOX (per-album photo viewer)
|
||||
* ===================================================================
|
||||
*/
|
||||
function setupGallery() {
|
||||
var lb = document.getElementById('gallery-lightbox');
|
||||
if (!lb) return;
|
||||
var img = lb.querySelector('.lightbox-img');
|
||||
var cap = lb.querySelector('.lightbox-caption');
|
||||
var group = [];
|
||||
var idx = 0;
|
||||
|
||||
function render() {
|
||||
var it = group[idx];
|
||||
img.setAttribute('src', it.full);
|
||||
img.setAttribute('alt', it.caption || '');
|
||||
cap.textContent = (it.caption || '') + (group.length > 1 ? ' (' + (idx + 1) + '/' + group.length + ')' : '');
|
||||
}
|
||||
function open(grid, start) {
|
||||
group = Array.prototype.map.call(grid.querySelectorAll('.gallery-thumb'), function (b) {
|
||||
return { full: b.getAttribute('data-full'), caption: b.getAttribute('data-caption') || '' };
|
||||
});
|
||||
idx = start;
|
||||
render();
|
||||
lb.classList.add('is-open');
|
||||
lb.setAttribute('aria-hidden', 'false');
|
||||
document.documentElement.style.overflow = 'hidden';
|
||||
}
|
||||
function close() {
|
||||
lb.classList.remove('is-open');
|
||||
lb.setAttribute('aria-hidden', 'true');
|
||||
document.documentElement.style.overflow = '';
|
||||
img.setAttribute('src', '');
|
||||
}
|
||||
function step(d) { idx = (idx + d + group.length) % group.length; render(); }
|
||||
|
||||
document.querySelectorAll('.gallery-grid').forEach(function (grid) {
|
||||
grid.querySelectorAll('.gallery-thumb').forEach(function (btn, i) {
|
||||
btn.addEventListener('click', function () { open(grid, i); });
|
||||
});
|
||||
});
|
||||
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); });
|
||||
lb.addEventListener('click', function (e) { if (e.target === lb) close(); });
|
||||
document.addEventListener('keydown', function (e) {
|
||||
if (!lb.classList.contains('is-open')) return;
|
||||
if (e.key === 'Escape') close();
|
||||
else if (e.key === 'ArrowLeft') step(-1);
|
||||
else if (e.key === 'ArrowRight') step(1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ===================================================================
|
||||
* HUB USE-CASE CAROUSEL (auto-scrolling)
|
||||
@@ -863,5 +917,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
setupLanguageSuggestion();
|
||||
setupNewsletter();
|
||||
setupHubCarousel();
|
||||
setupGallery();
|
||||
|
||||
});
|
||||
Reference in new issue
Block a user