\n
\n\n \n
\n \n \n
\n \n \n
\n Create your family tree in seconds!
${role}
\nAge: ${age}
\n${job}
\n `;\n return member;\n}\n\nfunction generateFamilyTree(familyName, firstName) {\n const grandparents = [\n createMember(`${familyName} Senior`, 'Grandfather', getRandomAge(60, 70), getRandomJob()),\n createMember(`${familyName} Seniora`, 'Grandmother', getRandomAge(60, 70), getRandomJob())\n ];\n\n const parents = [\n createMember(`${familyName} Junior`, 'Father', getRandomAge(30, 40), getRandomJob()),\n createMember(`${firstName} ${familyName}`, 'Mother', getRandomAge(30, 40), getRandomJob()),\n createMember(`${familyName} Uncle`, 'Uncle', getRandomAge(30, 40), getRandomJob()),\n createMember(`${familyName} Aunt`, 'Aunt', getRandomAge(30, 40), getRandomJob())\n ];\n\n const children = [\n createMember(`${familyName} Jr.`, 'Brother', getRandomAge(10, 20), 'Student at the Academy'),\n createMember(`${familyName} Jr.`, 'Sister', getRandomAge(10, 20), 'Training as a Civilian'),\n createMember(`${familyName} Cousin`, 'Cousin', getRandomAge(10, 20), 'Student at the Academy')\n ];\n\n const treeContainer = document.getElementById('tree-container');\n const grandparentsDiv = document.getElementById('grandparents');\n const parentsDiv = document.getElementById('parents');\n const childrenDiv = document.getElementById('children');\n\n grandparentsDiv.innerHTML = '';\n parentsDiv.innerHTML = '';\n childrenDiv.innerHTML = '';\n\n grandparents.forEach(gp => grandparentsDiv.appendChild(gp));\n parents.forEach(p => parentsDiv.appendChild(p));\n children.forEach(c => childrenDiv.appendChild(c));\n\n treeContainer.classList.remove('hidden');\n}\n\ndocument.getElementById('family-form').addEventListener('submit', function(e) {\n e.preventDefault();\n const familyName = document.getElementById('family-name').value;\n const firstName = document.getElementById('first-name').value;\n generateFamilyTree(familyName, firstName);\n});\n---end---"${role}
Age: ${age}
${job}