Interactive Karyotype Activity
// display each chromosome inside slot slotChromosomes.forEach(chrId => const chr = chromosomes.find(c => c.id === chrId); if (chr) const miniCard = document.createElement('div'); miniCard.className = 'chromosome-card'; miniCard.style.width = '52px'; miniCard.style.cursor = 'pointer'; miniCard.style.background = '#fff6e0'; miniCard.setAttribute('data-id', chr.id); miniCard.innerHTML = ` <div class="chr-icon">$getChromosomeIcon(chr.type)</div> <div class="chr-label">$chr.type === 'X' ? 'X' : (chr.type === 'Y' ? 'Y' : chr.type)</div> `; // allow to remove from slot by doubleclick miniCard.ondblclick = (e) => e.stopPropagation(); removeChromosomeFromSlot(chr.id, slotNumber); ; chromosomesContainer.appendChild(miniCard);