feat: refactor whole bunch of stuff

This commit is contained in:
Max Richter
2025-11-02 19:03:11 +01:00
parent 81ebc8f5e0
commit e6b90cb785
56 changed files with 753 additions and 360 deletions

View File

@@ -35,7 +35,7 @@ function thumbHashToRGBA(hash) {
for (let cx = cy ? 0 : 1; cx * ny < nx * (ny - cy); cx++) {
ac.push(
(((hash[ac_start + (ac_index >> 1)] >> ((ac_index++ & 1) << 2)) &
15) / 7.5 - 1) * scale,
15) / 7.5 - 1) * scale,
);
}
}
@@ -226,7 +226,7 @@ function rgbaToDataURL(w, h, rgba) {
return "data:image/png;base64," + btoa(String.fromCharCode(...bytes));
}
function updateThumbnailImages() {
function updateThumbhashImages() {
document.querySelectorAll("[data-thumb]").forEach((entry) => {
const hash = entry.getAttribute("data-thumb");
@@ -257,7 +257,7 @@ function updateThumbnailImages() {
child.style.opacity = 1;
child.style.filter = "blur(0px)";
setTimeout(() => {
entry.style.background = "";
//entry.style.background = "";
}, 400);
});
}
@@ -265,5 +265,5 @@ function updateThumbnailImages() {
});
}
globalThis.addEventListener("load", updateThumbnailImages);
globalThis.addEventListener("loading-finished", updateThumbnailImages);
globalThis.addEventListener("load", updateThumbhashImages);
globalThis.addEventListener("loading-finished", updateThumbhashImages);