From 8294d9626f7e6e7a5f08e68229e16ec274530407 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Sun, 12 Jul 2026 20:22:17 +0200 Subject: [PATCH] Revert "jgfd" This reverts commit 11bf73acc2482aadeb9cacf07f9931b1870cfbd9. --- public/s/js/f0ckm.js | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/public/s/js/f0ckm.js b/public/s/js/f0ckm.js index c422726..1d1abe8 100644 --- a/public/s/js/f0ckm.js +++ b/public/s/js/f0ckm.js @@ -2861,43 +2861,21 @@ window.cancelAnimFrame = (function () { if (data.success) { if (replace) { if (_isInPlaceGridReload) { - // Same-grid reload: snapshot already-loaded backgrounds BEFORE destroying DOM, - // then carry them over to matching items in the new HTML so they appear instantly. - // Without this, every thumb goes blank on innerHTML swap because the new elements - // have no style.backgroundImage, and even cached image loads are async (1+ frames). - const _loadedBgs = new Map(); - posts.querySelectorAll('a.loaded[data-bg]').forEach(el => { - if (el.pathname && el.style.backgroundImage) { - _loadedBgs.set(el.pathname, el.style.backgroundImage); - } - }); - - // Fade out, swap, carry over, fade in + // Same-grid reload: fade out current content, swap, fade back in. + // .grid-fade-out has a 150ms opacity transition — we wait for it then swap. posts.classList.add('grid-fade-out'); const _doSwap = () => { posts.classList.remove('grid-fade-out'); posts.classList.add('grid-transition'); posts.classList.remove('show'); posts.innerHTML = data.html; - - // Re-apply loaded backgrounds to matching items — zero async work needed - posts.querySelectorAll('a[data-bg]').forEach(el => { - const bg = _loadedBgs.get(el.pathname); - if (bg) { - el.style.backgroundImage = bg; - el.classList.add('loaded'); - el.classList.remove('lazy-thumb'); - } - }); - window.updateVisitIndicators(); - window.initLazyLoading(); // only fires for truly new items not in _loadedBgs + window.initLazyLoading(); window.scrollTo(0, 0); requestAnimationFrame(() => posts.classList.add('show')); }; // Wait for the .grid-fade-out transition (150ms in CSS) setTimeout(_doSwap, 160); - } else { // Structural transition: content is already blank/replaced, just inject and show posts.innerHTML = data.html;