document.addEventListener("DOMContentLoaded", function () { async function setCard(el, url, name, desc, labels, version, theme, authors) { const colorList = [ "#22c55e", "#14b8a6", "#ef4444", "#eab308", "#8b5cf6", "#f97316", "#3b82f6", ] let labelHTML = '' if (labels) { const labelArray = labels.split(',').map((label, index) => { const color = colorList[index % colorList.length] return `${label}` }) labelHTML = labelArray.join(' ') } const authorArray = authors.split(','); const authorDataArray = await Promise.all(authorArray.map(async (author) => { const response = await fetch(`https://api.github.com/users/${author.trim()}`); return await response.json(); })); let authorHTML = ''; authorDataArray.forEach((authorData, index) => { const marginLeft = index === 0 ? '0' : '-15px'; authorHTML += `
`; }); document.querySelectorAll('.author-container').forEach((container) => { const tooltip = container.querySelector('.tooltip'); container.addEventListener('mouseover', () => { tooltip.style.visibility = 'visible'; tooltip.style.opacity = '1'; }); container.addEventListener('mouseout', () => { tooltip.style.visibility = 'hidden'; tooltip.style.opacity = '0'; }); }); el.innerText = `