Mood Tracking Dashboard
Log your feelings and visualize your emotional well-being.
Your Mood Overview
Monthly Mood Calendar
Mood Distribution
How are you feeling today?
Your Mood History
| Date | Mood | Notes | Action |
|---|
Calendar view coming soon. Check your history tab for entries.
'; // A full calendar implementation is complex; this focuses on core requirements. }; // --- IV. EVENT HANDLING & LOGIC --- const saveEntry = () => { const date = elements.logForm.date.value; const selectedMoodEl = document.querySelector('.mood-option.selected'); const notes = elements.logForm.notes.value.trim(); if (!date) { showMessage('Please select a date.', 'error'); return; } if (!selectedMoodEl) { showMessage('Please select a mood.', 'error'); return; } const mood = selectedMoodEl.dataset.mood; // Remove any existing entry for the same date before adding the new one moodEntries = moodEntries.filter(entry => entry.date !== date); moodEntries.push({ date, mood, notes }); saveToLocalStorage(); renderAll(); showMessage('Mood entry saved successfully!'); switchTab('dashboard'); // Switch to dashboard after saving }; window.deleteEntry = (date) => { moodEntries = moodEntries.filter(entry => entry.date !== date); saveToLocalStorage(); renderAll(); showMessage('Entry deleted.', 'success'); }; const downloadPdf = async () => { const { jsPDF } = window.jspdf; const title = "Mood History Report"; // Create a clean table for PDF export let tableHtml = `${title}
| Date | Mood | Notes |
|---|---|---|
| ${entry.date} | ${entry.mood} | ${notesText} |
