Online Speech Writing Assistant

Online Speech Writing Assistant

Structure your ideas and craft a compelling speech from start to finish.

Define Your Foundation

Build Your Speech Outline

How will you grab the audience's attention and state your purpose? (e.g., a surprising statistic, a personal story, a powerful question)

What is the first key idea you want to convey?

What is the second key idea?

What is the third key idea?

How will you summarize your points and leave a lasting impression? (e.g., a call to action, a memorable quote, a look to the future)

Final Review & Download

Review your generated speech outline below. When you are ready, you can download it as a PDF.

Goal: ${data.goalText || 'Not specified'}

Introduction

${data.intro || 'No content entered.'}

Main Point 1

${data.point1 || 'No content entered.'}

Main Point 2

${data.point2 || 'No content entered.'}

`; if (data.point3) { html += `

Main Point 3

${data.point3}

`; } html += `

Conclusion

${data.conclusion || 'No content entered.'}

`; reviewOutputDiv.innerHTML = html; }; /** * Retrieves all data from input fields. * @returns {object} An object containing all speech data. */ const getSpeechData = () => { return { occasion: inputs.occasion.value.trim(), audience: inputs.audience.value.trim(), goal: inputs.goal.value, goalText: inputs.goal.options[inputs.goal.selectedIndex].text, intro: inputs.intro.value.trim(), point1: inputs.point1.value.trim(), point2: inputs.point2.value.trim(), point3: inputs.point3.value.trim(), conclusion: inputs.conclusion.value.trim(), }; }; /** * Generates and triggers the download of a PDF report. */ const generatePdf = () => { const data = getSpeechData(); const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFontSize(20); doc.text("Speech Outline & Plan", 105, 20, { align: 'center' }); doc.autoTable({ startY: 30, head: [['Parameter', 'Your Input']], body: [ ['Occasion', data.occasion], ['Audience', data.audience], ['Primary Goal', data.goalText], ], theme: 'grid', headStyles: { fillColor: [4, 120, 87] }, // emerald-700 }); const addSection = (title, content, startY) => { doc.setFontSize(14); doc.text(title, 14, startY); doc.setFontSize(11); const lines = doc.splitTextToSize(content || "No content entered.", 180); doc.text(lines, 14, startY + 10); return doc.lastAutoTable.finalY + 15 + lines.length * 5; }; let currentY = doc.lastAutoTable.finalY + 20; const sections = [ { title: "Introduction", content: data.intro }, { title: "Main Point 1", content: data.point1 }, { title: "Main Point 2", content: data.point2 }, { title: "Main Point 3", content: data.point3 }, { title: "Conclusion", content: data.conclusion }, ]; sections.forEach(section => { if (section.title === "Main Point 3" && !section.content) return; // Skip optional empty point doc.setFontSize(14); doc.text(section.title, 14, currentY); doc.setFontSize(11); const lines = doc.splitTextToSize(section.content || "No content entered.", 180); doc.text(lines, 14, currentY + 8); currentY += 15 + lines.length * 5; // Adjust Y position for next section }); doc.save('Speech_Outline.pdf'); }; // --- EVENT LISTENERS --- downloadPdfBtn.addEventListener('click', generatePdf); // --- INITIALIZATION --- updateNavButtons(); });
Scroll to Top