Productivity-Oriented Notes App
Organize your tasks, notes, and ideas efficiently.
No notes found.
Click "Create New Note" to get started!
Create a New Note
${line}
`; }).join(''); }; const renderNotes = () => { notesGrid.innerHTML = ''; const searchTerm = searchInput.value.toLowerCase(); const statusFilter = filterStatus.value; const priorityFilter = filterPriority.value; const filteredNotes = notes.filter(note => { const titleMatch = note.title.toLowerCase().includes(searchTerm); const contentMatch = note.content.toLowerCase().includes(searchTerm); const statusMatch = statusFilter === 'all' || note.status === statusFilter; const priorityMatch = priorityFilter === 'all' || note.priority === priorityFilter; return (titleMatch || contentMatch) && statusMatch && priorityMatch; }); // Sort by due date, earlier first filteredNotes.sort((a, b) => (a.dueDate || '9999-12-31') > (b.dueDate || '9999-12-31') ? 1 : -1); if (filteredNotes.length === 0) { noNotesMessage.classList.remove('hidden'); } else { noNotesMessage.classList.add('hidden'); } filteredNotes.forEach(note => { const noteCard = document.createElement('div'); const priorityClass = getPriorityClass(note.priority); const dueDate = note.dueDate ? new Date(note.dueDate + 'T00:00:00').toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' }) : 'No due date'; noteCard.className = `bg-white rounded-lg shadow-md p-5 flex flex-col border-l-4 ${priorityClass}`; noteCard.innerHTML = `${note.title}
${parseContentToHTML(note.content)}
Status: ${note.status}
Priority: ${note.priority}
Due: ${dueDate}
