Personal Goal Tracker

Personal Goal Tracker

Set, manage, and achieve your personal and professional goals.

No goals configured. Please go to the 'Goal Configuration' tab to add your goals.

Add & Edit Your Goals

${goal.title}

Category: ${goal.category} | Target: ${goal.targetDate}

${goal.status}
`; }); dashboardHTML += `
`; dashboardOutput.innerHTML = dashboardHTML; } /** * Handles the PDF download functionality. */ function downloadPDF() { const { jsPDF } = window.jspdf; const goalItems = document.querySelectorAll('.goal-item'); if (goalItems.length === 0) { console.warn("No data to export."); return; } const doc = new jsPDF(); const tableData = Array.from(goalItems).map(item => { const inputs = item.querySelectorAll('input, select'); return [ inputs[0].value || '', // Goal Title inputs[1].value || '', // Category inputs[2].value || '', // Target Date inputs[3].value || '' // Status ]; }); doc.setFontSize(18); doc.text('Personal Goal List', 14, 22); doc.setFontSize(11); doc.setTextColor(100); doc.text(`Report generated on: ${new Date().toLocaleDateString()}`, 14, 30); doc.autoTable({ head: [['Goal Title', 'Category', 'Target Date', 'Status']], body: tableData, startY: 35, theme: 'grid', headStyles: { fillColor: [124, 58, 237] }, // Violet-600 }); doc.save('Personal-Goal-List.pdf'); } // --- Event Listeners --- if (addGoalBtn) { addGoalBtn.addEventListener('click', addGoalForm); } if (downloadPdfBtn) { downloadPdfBtn.addEventListener('click', downloadPDF); } // --- Initial Setup --- updateNavButtons(); generateDashboard(); });
Scroll to Top