Sci-Fi Alien Species Name Generator
Generate unique names for alien species based on phonetic style.
Your alien species names will appear here.
Your alien species names will appear here.
'; document.getElementById('downloadPdfBtn').style.display = 'none'; // Hide PDF button }); // Download PDF Button document.getElementById('downloadPdfBtn').addEventListener('click', () => { const resultsDiv = document.getElementById('nameResults'); const names = []; resultsDiv.querySelectorAll('p').forEach(p => { // Collect names, excluding placeholder/error messages if (p.textContent && p.textContent.trim() !== 'Your alien species names will appear here.' && !p.textContent.trim().startsWith('Please enter a valid') && !p.textContent.trim().startsWith('Could not generate names') && p.textContent.trim() !== 'Generating names...') { names.push(p.textContent.trim()); } }); if (names.length === 0) { alert("No names to download."); return; } // --- PDF Generation --- const doc = new jsPDF(); const margin = 15; let y = margin; const lineHeight = 10; const pageHeight = doc.internal.pageSize.height; const pageWidth = doc.internal.pageSize.width; const maxLineWidth = pageWidth - 2 * margin; // Max width for text line doc.setFontSize(18); doc.setTextColor(52, 58, 64); // Match text-color variable #343a0 doc.text("Generated Alien Species Names", margin, y); y += 15; // Space after title doc.setFontSize(12); doc.setTextColor(52, 58, 64); // Match text-color variable #343a0 names.forEach((name, index) => { // Check if we need a new page const nameLines = doc.splitTextToSize(`${index + 1}. ${name}`, maxLineWidth); const estimatedHeight = nameLines.length * 7 + 3; // Estimate height if (y + estimatedHeight > pageHeight - margin && y > margin) { doc.addPage(); y = margin; // Reset y for the new page doc.setFontSize(18); doc.setTextColor(52, 58, 64); doc.text("Generated Alien Species Names (cont.)", margin, y); y += 15; doc.setFontSize(12); doc.setTextColor(52, 58, 64); } doc.text(`${index + 1}. ${name}`, margin, y); y += estimatedHeight; // Move down by estimated height }); doc.save('alien_species_names.pdf'); });Key Features:
Customizable Inputs: Users can input habitat, behavior, and appearance traits to generate unique alien species names.
AI-Generated Names: The tool creates creative and imaginative names based on user inputs.
Centered Design: The tool is perfectly centered on the page, ensuring a clean and professional look.
PDF Download: Users can download the generated name as a PDF, complete with the same color scheme for consistency.
Responsive Design: The tool is fully responsive and works seamlessly on all devices
Benefits for End Users:
Creative Fun: Users can generate unique and creative names for their sci-fi stories, games, or projects.
Customizable Outputs: The tool allows users to tailor the generated names based on specific traits.
Educational Tool: Great for students and educators to explore creativity and world-building concepts.
Portable Results: The PDF download feature allows users to save and share their generated names easily.
User-Friendly Interface: The simple and intuitive design ensures that users of all ages and technical skill levels can use the tool effortlessly.
