AI-Powered Proofreading Assistant
Paste your text below to get instant grammar, spelling, and style suggestions.
Suggestions
No suggestions found. Looks good!
Corrected Text
Change ${corr.original_text} to ${corr.suggested_text}
${corr.explanation}
`); suggestionsList.appendChild(card); }); } suggestionsPanel.classList.remove('hidden'); } function downloadPdf() { if (!originalText) { showError("Please proofread some text before downloading a report."); return; } const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFontSize(20); doc.text("Proofreading Report", 105, 20, { align: 'center' }); doc.setFontSize(12); doc.text("Original Text:", 14, 35); const originalLines = doc.splitTextToSize(originalText, 180); doc.setFontSize(10); doc.setTextColor(100); doc.text(originalLines, 14, 42); let startY = 42 + (originalLines.length * 5) + 10; if (currentCorrections.length > 0) { doc.autoTable({ startY: startY, head: [['Type', 'Original', 'Suggestion', 'Reason']], body: currentCorrections.map(c => [c.type, c.original_text, c.suggested_text, c.explanation]), theme: 'grid' }); } else { doc.setFontSize(12); doc.text("No corrections were suggested.", 14, startY); } doc.save('Proofreading_Report.pdf'); } function resetUI() { suggestionsPanel.classList.add('hidden'); resultsContainer.classList.add('hidden'); } // --- UI Helper Functions --- function toggleLoading(isLoading) { proofreadBtn.disabled = isLoading; loader.classList.toggle('hidden', !isLoading); btnText.classList.toggle('hidden', isLoading); } function showError(message) { errorMessage.textContent = message; errorMessage.classList.remove('hidden'); } function hideError() { errorMessage.classList.add('hidden'); } });