\n \n \n \n
\n Sorted Stars
\n\n
\n Your sorted star names will appear here
\nOrganize the cosmos, one name at a time
Your sorted star names will appear here
Made with 💫 for astronomers and star enthusiasts
Organize the cosmos, one name at a time
\nYour sorted star names will appear here
\nPlease enter some star names first
';\n return;\n }\n\n const sortedStars = stars.sort((a, b) => {\n return direction === 'asc' \n ? a.localeCompare(b)\n : b.localeCompare(a);\n });\n\n result.innerHTML = sortedStars\n .map(star => `${star}
`)\n .join('');\n }\n\n function clearAll() {\n starInput.value = '';\n result.innerHTML = 'Your sorted star names will appear here
';\n }\n\n sortAZBtn.addEventListener('click', () => sortStars('asc'));\n sortZABtn.addEventListener('click', () => sortStars('desc'));\n clearBtn.addEventListener('click', clearAll);\n\n // Add animation when new results are displayed\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'childList') {\n const newNodes = Array.from(mutation.addedNodes);\n newNodes.forEach((node, index) => {\n if (node.nodeType === 1) {\n node.style.animation = `fadeIn 0.3s ease-out ${index * 0.1}s forwards`;\n }\n });\n }\n });\n });\n\n observer.observe(result, { childList: true });\n});\n\n---end---\n\nThis implementation creates a beautiful, responsive star name sorting application with the following features:\n\n1. Clean, modern design with smooth animations\n2. Responsive layout that works on all devices\n3. Elegant gradient header\n4. Smooth transitions and hover effects\n5. Animated results when sorting\n6. Error handling for empty input\n7. Accessible form controls with proper labeling\n8. Clear visual hierarchy\n9. Subtle shadows and depth\n10. Consistent color scheme and spacing\n\nThe site allows users to:\n- Input multiple star names (one per line)\n- Sort names alphabetically (A-Z or Z-A)\n- Clear all input and results\n- See results with a fade-in animation\n\nThe design is professional yet engaging, with careful attention to detail in the styling and interactions. It's built with vanilla JavaScript and CSS, requiring no external dependencies while maintaining modern best practices and accessibility standards."Please enter some star names first
';${star}
`)Your sorted star names will appear here
';