AI Workspace - Notes

Workspace

Capture intelligence. Access anywhere.

Cmd + Enter to commit
`; dataUri = 'data:application/msword;charset=utf-8,' + encodeURIComponent(dataStr); filename = 'workspace_notes_' + timestamp + '.doc'; }const linkElement = document.createElement('a'); linkElement.setAttribute('href', dataUri); linkElement.setAttribute('download', filename); document.body.appendChild(linkElement); linkElement.click(); document.body.removeChild(linkElement); showToast(`${format.toUpperCase()} export downloaded.`); }let purgeTimeout; function confirmPurge() { if (notes.length === 0) { showToast('Archive is already empty.', true); return; }if (purgeBtn.dataset.confirm === 'true') { notes = []; saveNotes(); renderNotes(); closeSettings(); showToast('All records permanently purged.', true); purgeBtn.dataset.confirm = 'false'; purgeBtn.innerText = 'Purge'; } else { purgeBtn.dataset.confirm = 'true'; purgeBtn.innerText = 'Confirm Purge'; purgeBtn.classList.add('!bg-brand-primary', '!text-white'); clearTimeout(purgeTimeout); // Revert after 3 seconds if not clicked purgeTimeout = setTimeout(() => { purgeBtn.dataset.confirm = 'false'; purgeBtn.innerText = 'Purge'; purgeBtn.classList.remove('!bg-brand-primary', '!text-white'); }, 3000); } }// Main Render function renderNotes() { container.innerHTML = ''; let displayNotes = notes; if (currentFilter === 'archived') displayNotes = notes.filter(n => n.isArchived); else if (currentFilter === 'favorites') displayNotes = notes.filter(n => !n.isArchived && n.isFavorite); else displayNotes = notes.filter(n => !n.isArchived);if (currentFilter !== 'archived') { displayNotes.sort((a, b) => (a.isPinned === b.isPinned) ? 0 : a.isPinned ? -1 : 1); }if (displayNotes.length === 0) { const msgs = { 'all': 'System ready.
Awaiting initial input sequence.', 'favorites': 'No starred records.
Mark critical nodes to access them here.', 'archived': 'Archive empty.
Historical records will be stored in this sector.' }; container.innerHTML = `

${msgs[currentFilter]}

`; return; }const icons = { pinOut: ``, pinIn: ``, starOut: ``, starIn: ``, edit: ``, dup: ``, share: ``, archive: ``, restore: ``, del: `` };displayNotes.forEach((note, index) => { const div = document.createElement('div'); div.style.animationDelay = `${index * 0.05}s`; // GLASSMORPHISM & NEUMORPHISM Applied to Cards const bgClass = note.isPinned ? 'bg-brand-primary/5' : 'bg-brand-surface/20'; const borderClass = note.isPinned ? 'border-brand-primary/30' : 'border-brand-border'; div.className = `note-enter ${bgClass} backdrop-blur-[16px] rounded-[24px] border ${borderClass} p-6 sm:p-8 flex flex-col h-full group hover:-translate-y-1 hover:shadow-glow transition-all duration-300 relative shadow-neumorph`; div.innerHTML = `
${note.date}

${escapeHTML(note.text)}

`; container.appendChild(div); }); }addBtn.addEventListener('click', addNote);input.addEventListener('keydown', (e) => { if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') { e.preventDefault(); addNote(); } });// Init renderNotes();