AI-Based Love Letter Generator
Enter your name and your loved one's name to generate a heartfelt love letter!
Forever yours,
${yourName}
`; resultsContainer.innerHTML = loveLetter; }); document.getElementById('downloadPdfBtn').addEventListener('click', function () { const { jsPDF } = window.jspdf; const doc = new jsPDF(); const yourName = document.getElementById('yourName').value.trim(); const lovedOneName = document.getElementById('lovedOneName').value.trim(); const letterContent = document.getElementById('letterResults').innerHTML; doc.setFillColor(255, 240, 246); doc.rect(0, 0, 210, 297, 'F'); doc.setTextColor(214, 51, 108); doc.setFontSize(18); doc.text(`Love Letter to ${lovedOneName}`, 10, 20); doc.setTextColor(51, 51, 51); doc.setFontSize(12); doc.fromHTML(letterContent, 10, 30, { width: 180 }); doc.save('love-letter.pdf'); });Key Features
Recipient Input: Users can enter the recipient’s name for a personalized love letter.
Relationship Type: Users can select the type of relationship (e.g., Romantic, Friendship, Family).
Tone Selection: Users can choose the tone of the letter (e.g., Funny, Poetic, Heartfelt).
Dynamic Letter Generation: The tool generates a love letter based on the selected relationship type and tone.
PDF Download: Users can download the generated love letter as a PDF file, which maintains the same color scheme as the tool.
Interactive Design: The tool features a sleek, modern design with a centered layout, making it visually engaging and easy to use.
Benefits for End Users
Personalization: Users can create unique and personalized love letters for their loved ones.
Creativity Boost: The tool provides inspiration for writing heartfelt or funny letters.
Portability: The PDF download feature allows users to save and share their letters offline.
Engagement: The interactive design keeps users engaged and encourages them to explore the tool repeatedly.
