zat.dev/zds
atproto pds · mirror of https://tangled.org/zat.dev/zds
zds 0.25.1 Latest 2 packages, all images
0
0
// `drawings` is a server-generated map of known slots to local asset URLs.
for (const original of document.querySelectorAll('[data-icon-slot]')) {
const source = drawings[original.getAttribute('data-icon-slot')];
if (!source) continue;
const image = new Image();
image.alt = '';
image.setAttribute('aria-hidden', 'true');
image.className = original.getAttribute('class') || '';
image.classList.add('drawing-icon');
image.dataset.iconSlot = original.getAttribute('data-icon-slot');
image.onload = () => original.replaceWith(image);
// Leave the usable default in place if an image cannot be decoded or loaded.
image.src = source;
}