Loading… toxins loaded • Powered by Flush GBI
${toxin.desc}
`; card.addEventListener('click', () => showModal(toxin.name)); grid.appendChild(card); }); } function applyFilters() { const searchTerm = document.getElementById('search').value.toLowerCase(); const categoryFilter = document.getElementById('catFilter').value; const severityFilter = document.getElementById('sevFilter').value; const cards = document.querySelectorAll('.card'); let visibleCount = 0; cards.forEach(card => { const text = card.textContent.toLowerCase(); const category = card.dataset.cat; const severity = card.dataset.sev; const matchesSearch = !searchTerm || text.includes(searchTerm); const matchesCategory = categoryFilter === 'all' || category === categoryFilter; const matchesSeverity = severityFilter === 'all' || severity === severityFilter; if (matchesSearch && matchesCategory && matchesSeverity) { card.style.display = 'block'; visibleCount++; } else { card.style.display = 'none'; } }); console.log(`Showing ${visibleCount} of ${toxinData.length} toxins`); } function showModal(toxinName) { const toxin = toxinData.find(t => t.name === toxinName); if (!toxin) { console.error('Toxin not found:', toxinName); return; } let modalHTML = `${toxin.origin}
`; } if (toxin.exposure) { modalHTML += `${toxin.exposure}
`; } if (toxin.effects) { modalHTML += `${toxin.effects}
`; } if (toxin.mechanism) { modalHTML += `${toxin.mechanism}
`; } modalHTML += `${toxin.combat}
`; if (toxin.interactions) { modalHTML += `${toxin.interactions}
`; } if (toxin.sources) { modalHTML += `Common sources: ${toxin.sources}
`; } if (toxin.atRisk) { modalHTML += `At-risk populations: ${toxin.atRisk}
`; } if (toxin.regulatory) { modalHTML += `Regulatory limits: ${toxin.regulatory}
`; } document.getElementById('modalContent').innerHTML = modalHTML; document.getElementById('modal').classList.add('show'); } function closeModal() { document.getElementById('modal').classList.remove('show'); } document.getElementById('modal').addEventListener('click', (e) => { if (e.target.id === 'modal') { closeModal(); } }); document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && document.getElementById('modal').classList.contains('show')) { closeModal(); } });