feat: refactor whole bunch of stuff
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user