// retoor <retoor@molodetz.nl>

export class Avatar {
    static imgElement(username, size = 24) {
        const img = document.createElement("img");
        img.src = `/avatar/multiavatar/${encodeURIComponent(username)}?size=${size}`;
        img.className = "avatar-img";
        img.style.width = `${size}px`;
        img.style.height = `${size}px`;
        img.style.borderRadius = "50%";
        img.alt = "";
        img.loading = "lazy";
        return img;
    }
}

window.Avatar = Avatar;
