Simplify image galleries: folder download link, no per-image download

Remove FileBrowser API fetch, async lightbox logic, and per-image
download button. Add a single folder share link per collection page
next to Back to Hub. Lightbox is now fully synchronous.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-27 20:33:49 +02:00
parent 696bc9c2a7
commit 781d3ef1e7
4 changed files with 28 additions and 244 deletions

View File

@@ -212,14 +212,6 @@
letter-spacing: 0.05em;
}
.loading-indicator {
font-family: 'Share Tech Mono', monospace;
color: var(--accent);
font-size: 0.8rem;
margin-top: 0.5rem;
display: none;
}
</style>
</head>
<body>
@@ -228,7 +220,10 @@
<span class="subtitle">2026present Collection</span>
<h1>Exopraxist</h1>
</div>
<a href="images.html" class="nav-back">← Back to Hub</a>
<div class="nav-actions">
<a href="images.html" class="nav-back">← Back to Hub</a>
<a href="https://files.exopraxist.org/share/97AGC2WQ" class="nav-back" target="_blank">↓ Download Folder</a>
</div>
</header>
<main>
@@ -240,28 +235,22 @@
<button class="lightbox-btn close-btn" id="close-btn">CLOSE [ESC]</button>
<img id="lightbox-img" src="" alt="">
<div id="lightbox-filename"></div>
<div id="loading-indicator" class="loading-indicator">UPGRADING TO FULL RESOLUTION...</div>
<div class="lightbox-controls">
<button class="lightbox-btn" id="prev-btn">PREV</button>
<a href="#" id="dl-btn" class="lightbox-btn" target="_blank">DOWNLOAD</a>
<button class="lightbox-btn" id="next-btn">NEXT</button>
</div>
</div>
</div>
<script>
const COLLECTION_TOKEN = '97AGC2WQ';
const THUMBNAILS = ["jl_bg_intermediate3.jpg","jl_wallpaper_desktop_F.jpg"];
let fbIndex = null;
let currentIndex = -1;
const galleryEl = document.getElementById('gallery');
const lightboxEl = document.getElementById('lightbox');
const lightboxImg = document.getElementById('lightbox-img');
const lightboxFilename = document.getElementById('lightbox-filename');
const dlBtn = document.getElementById('dl-btn');
const loadingIndicator = document.getElementById('loading-indicator');
function renderGallery() {
THUMBNAILS.forEach((filename, index) => {
@@ -274,58 +263,16 @@
});
}
async function getFBIndex() {
if (fbIndex) return fbIndex;
try {
const res = await fetch(`https://files.exopraxist.org/api/public/share/${COLLECTION_TOKEN}`);
const data = await res.json();
fbIndex = {};
for (const item of data.items) {
const stem = item.name.replace(/\.[^.]+$/, '');
fbIndex[stem] = item.name;
}
} catch (e) {
console.error('FileBrowser fetch failed:', e);
fbIndex = {};
}
return fbIndex;
}
async function openLightbox(index) {
function openLightbox(index) {
currentIndex = index;
const thumbFilename = THUMBNAILS[currentIndex];
const thumbUrl = `Exopraxist/thumbnails/${thumbFilename}`;
lightboxImg.src = thumbUrl;
lightboxImg.src = `Exopraxist/thumbnails/${thumbFilename}`;
lightboxFilename.textContent = thumbFilename;
dlBtn.href = thumbUrl;
loadingIndicator.style.display = 'block';
lightboxEl.style.display = 'flex';
document.body.style.overflow = 'hidden';
const stem = thumbFilename.replace('.jpg', '');
const idx = await getFBIndex();
const originalName = idx[stem];
if (originalName) {
const fullResUrl = `https://files.exopraxist.org/api/public/dl/${COLLECTION_TOKEN}/${encodeURIComponent(originalName)}`;
if (currentIndex === index) {
const img = new Image();
img.onload = () => {
if (currentIndex === index) {
lightboxImg.src = fullResUrl;
dlBtn.href = fullResUrl;
loadingIndicator.style.display = 'none';
}
};
img.src = fullResUrl;
}
} else {
loadingIndicator.style.display = 'none';
}
}
function closeLightbox() {
lightboxEl.style.display = 'none';
lightboxImg.src = '';