Changed around line 1
+ const organelles = [
+ {
+ name: 'Nucleus',
+ count: 1,
+ color: '#FF5722',
+ description: 'The control center of the cell, containing DNA.'
+ },
+ {
+ name: 'Mitochondria',
+ count: 1000,
+ color: '#8BC34A',
+ description: 'The powerhouse of the cell, producing ATP.'
+ },
+ {
+ name: 'Ribosomes',
+ count: 10000,
+ color: '#9C27B0',
+ description: 'Protein synthesis factories.'
+ },
+ {
+ name: 'Endoplasmic Reticulum',
+ count: 1,
+ color: '#FFC107',
+ description: 'Membrane network for protein and lipid synthesis.'
+ },
+ {
+ name: 'Golgi Apparatus',
+ count: 1,
+ color: '#3F51B5',
+ description: 'Packaging and distribution center for cellular products.'
+ },
+ {
+ name: 'Lysosomes',
+ count: 300,
+ color: '#E91E63',
+ description: 'Cellular recycling centers containing digestive enzymes.'
+ }
+ ];
+
+ const cellContainer = document.querySelector('.cell-container');
+ const infoGrid = document.querySelector('.info-grid');
+
+ // Create organelle elements
+ organelles.forEach(organelle => {
+ // Create visual elements
+ for (let i = 0; i < organelle.count; i++) {
+ const el = document.createElement('div');
+ el.className = 'organelle';
+ el.style.backgroundColor = organelle.color;
+ el.style.left = `${Math.random() * 90}%`;
+ el.style.top = `${Math.random() * 90}%`;
+ el.style.animationDuration = `${3 + Math.random() * 4}s`;
+ cellContainer.appendChild(el);
+ }
+
+ // Create info cards
+ const card = document.createElement('div');
+ card.className = 'info-card';
+ card.innerHTML = `
+
${organelle.name}
+
${organelle.description}
+
Count: ${organelle.count}
+ `;
+ infoGrid.appendChild(card);
+ });
+
+ // Add interactivity
+ const organelleElements = document.querySelectorAll('.organelle');
+ organelleElements.forEach(el => {
+ el.addEventListener('click', () => {
+ el.style.backgroundColor = '#FF4081';
+ setTimeout(() => {
+ el.style.backgroundColor = el.dataset.originalColor;
+ }, 1000);
+ });
+ });