website is now phone
This commit is contained in:
1 parent
f4457c5c17
commit
827f524107
16 files changed
+359
-175
No files matched your search
+2
-6
@@ -1,5 +1,4 @@
|
||||
// Gallery tab — thumbnails from gallery/manifest.json + full-size lightbox.
|
||||
// The manifest is (re)generated by generate_thumbnails.py.
|
||||
// manifest.json comes from generate_thumbnails.py
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const container = document.getElementById('gallery-container');
|
||||
const lightbox = document.getElementById('lightbox');
|
||||
@@ -8,8 +7,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
if (!container || !lightbox) return;
|
||||
|
||||
// Animated GIFs are served as MP4 (a few % of the size), so those
|
||||
// open in the <video>; everything else in the <img>.
|
||||
// gifs are converted to mp4 so those open in the video player
|
||||
const openLightbox = (src) => {
|
||||
const isVideo = src.endsWith('.mp4');
|
||||
lightboxImg.style.display = isVideo ? 'none' : 'block';
|
||||
@@ -26,13 +24,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const closeLightbox = () => {
|
||||
lightbox.style.display = 'none';
|
||||
lightboxImg.removeAttribute('src');
|
||||
// Stop playback and any download still in progress
|
||||
lightboxVideo.pause();
|
||||
lightboxVideo.removeAttribute('src');
|
||||
lightboxVideo.load();
|
||||
};
|
||||
|
||||
// Close on the X, on a click outside the media, or with Escape
|
||||
lightbox.addEventListener('click', (e) => {
|
||||
if (e.target !== lightboxImg && e.target !== lightboxVideo) closeLightbox();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user