summaryrefslogtreecommitdiffstats
path: root/public/js/album.js
diff options
context:
space:
mode:
authorKen D'Ambrosio <ken@jots.org>2026-05-10 14:38:04 +0000
committerKen D'Ambrosio <ken@jots.org>2026-05-10 14:38:04 +0000
commita7c16b99a4284826ac5ac0ace4ee0f760a548ff4 (patch)
treec8cb3679de1a88d3d8a54f787462aae944c91114 /public/js/album.js
parentfa36e54d878a3274f7728eb0b84c351b33f3c6ed (diff)
Add slideshow: root-level, shuffle, fullscreen, click-to-album
- Root slideshow: all_media_entries walks the full media tree so /slideshow/ shows every photo across all albums; Slideshow button always appears on the root album page - Shuffle and Full screen checkboxes sit next to the Slideshow button on the album page; options pass as ?shuffle=1&fullscreen=1 URL params - Fullscreen uses a tap-to-activate overlay (browsers block auto-entry on page load); webkit-prefixed for Safari; ⛶ button and F key for mid-session toggle - Fullscreen mode hides controls, counter, caption bar, and site header - Exiting fullscreen auto-pauses so the current photo stays visible - Click/tap anywhere in the stage navigates to the photo's album lightbox; reads the live src attribute instead of ssIdx to avoid a race where ssIdx advances during the cross-fade while the old photo is still on screen - layout.erb excluded from slideshow (layout: false) so the site header never appears there - CSS cache-busted with ?v=2 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'public/js/album.js')
-rw-r--r--public/js/album.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/public/js/album.js b/public/js/album.js
index fe492af..dd54ed2 100644
--- a/public/js/album.js
+++ b/public/js/album.js
@@ -128,6 +128,22 @@ window.addEventListener('DOMContentLoaded', () => {
});
})();
+// Slideshow launch options (Shuffle / Full screen checkboxes next to the button)
+(function () {
+ const link = document.getElementById('ss-launch');
+ if (!link) return;
+ const base = link.dataset.base;
+ function update() {
+ const p = [];
+ if (document.getElementById('ss-opt-shuffle').checked) p.push('shuffle=1');
+ if (document.getElementById('ss-opt-fullscreen').checked) p.push('fullscreen=1');
+ link.href = base + (p.length ? '?' + p.join('&') : '');
+ }
+ ['ss-opt-shuffle', 'ss-opt-fullscreen'].forEach(id =>
+ document.getElementById(id).addEventListener('change', update)
+ );
+})();
+
// Touch swipe
(function () {
let startX = null;