Podcast Episode Title Generator

Podcast Episode Title Generator

Generate catchy and relevant titles for your next podcast episode.

No titles were generated. Please try refining your topic.

'; resultContainer.classList.remove('hidden'); return; } titles.forEach(title => { const titleCard = document.createElement('div'); titleCard.className = 'bg-gray-100 p-3 rounded-lg flex justify-between items-center transition duration-200 hover:bg-gray-200'; const titleText = document.createElement('span'); titleText.textContent = title; titleText.className = 'text-gray-800 flex-grow'; const copyButton = document.createElement('button'); copyButton.type = 'button'; copyButton.textContent = 'Copy'; copyButton.className = 'ml-4 bg-indigo-100 text-indigo-700 text-xs font-semibold py-1 px-3 rounded-full hover:bg-indigo-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500'; copyButton.onclick = () => { // Use a temporary textarea to copy text const tempTextArea = document.createElement('textarea'); tempTextArea.value = title; document.body.appendChild(tempTextArea); tempTextArea.select(); try { document.execCommand('copy'); copyButton.textContent = 'Copied!'; setTimeout(() => { copyButton.textContent = 'Copy'; }, 2000); } catch (err) { console.error('Failed to copy text: ', err); copyButton.textContent = 'Error'; } document.body.removeChild(tempTextArea); }; titleCard.appendChild(titleText); titleCard.appendChild(copyButton); resultArea.appendChild(titleCard); }); resultContainer.classList.remove('hidden'); resultContainer.classList.add('fade-in'); } // --- PDF Generation --- function downloadPdf() { if (generatedTitles.length === 0) { showError("No titles to download. Please generate titles first."); return; } const { jsPDF } = window.jspdf; if (!jsPDF) { showError("PDF library is not available."); return; } const doc = new jsPDF(); doc.setFontSize(20); doc.text("Podcast Episode Titles", 105, 20, { align: 'center' }); doc.setFontSize(14); doc.text("Generation Parameters", 14, 40); const topicText = `Topic: ${topicInput.value.trim()}`; const topicLines = doc.splitTextToSize(topicText, 180); let currentY = 48; doc.setFontSize(10); doc.setTextColor(100); doc.text(topicLines, 14, currentY); currentY += (topicLines.length * 5) + 5; doc.text(`Tone: ${toneSelect.value}`, 14, currentY); const tableData = generatedTitles.map((title, index) => [index + 1, title]); doc.autoTable({ head: [['#', 'Generated Title']], body: tableData, startY: currentY + 10, theme: 'grid', headStyles: { fillColor: [74, 85, 104] }, // slate-600 styles: { cellPadding: 2.5, fontSize: 10 }, columnStyles: { 0: { cellWidth: 15 }, } }); doc.save('Podcast_Episode_Titles.pdf'); } });
Scroll to Top