π¨ My Colorful Notepad Pro π¨
β New Note
πΎ Save to Browser
π Download as .txt
π Download as .html
π Download as PDF
π¨οΈ Print
β©οΈ Undo (Ctrl+Z)
βͺοΈ Redo (Ctrl+Y)
βοΈ Cut
π Copy
π Paste
π² Select All
π Current Date & Time
β Divider Line
π Zoom In
π Zoom Out
π₯οΈ Toggle Full Screen
π¨ Text Color:
β³ Reset Formatting
π About App
β¨ Colorful Notepad Pro
Created by Gurinder Tamna
β Select text β choose color β Apply
β Export as TXT / HTML / PDF
β Auto-save to browser storage
β All menu options working!
My Colorful Note
' + editor.innerHTML; document.body.appendChild(temp); temp.style.position = 'absolute'; temp.style.left = '-9999px'; temp.style.top = '0'; try { const opt = { margin: [0.5, 0.5, 0.5, 0.5], filename: 'notepad_' + Date.now() + '.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2 }, jsPDF: { unit: 'in', format: 'a4', orientation: 'portrait' } }; await html2pdf().set(opt).from(temp).save(); alert('PDF download started!'); } catch(err) { alert('PDF error: ' + err.message); } document.body.removeChild(temp); btn.innerText = originalText; });document.getElementById('printBtn').addEventListener('click', function() { const win = window.open('', '_blank'); win.document.write(''); pushUndo(); saveToLocal(); });// ========== VIEW MENU FUNCTIONS ========== document.getElementById('zoomInBtn').addEventListener('click', function() { zoomLevel = Math.min(zoomLevel + 0.1, 2); editor.style.transform = `scale(${zoomLevel})`; editor.style.transformOrigin = 'top left'; });document.getElementById('zoomOutBtn').addEventListener('click', function() { zoomLevel = Math.max(zoomLevel - 0.1, 0.6); editor.style.transform = `scale(${zoomLevel})`; editor.style.transformOrigin = 'top left'; });document.getElementById('fullscreenBtn').addEventListener('click', function() { if (!document.fullscreenElement) { document.documentElement.requestFullscreen(); } else { document.exitFullscreen(); } });// ========== FORMAT MENU FUNCTIONS ========== document.getElementById('fontFamilySelect').addEventListener('change', function() { editor.style.fontFamily = this.value; saveToLocal(); });document.getElementById('fontSizeInput').addEventListener('change', function() { const size = this.value; editor.style.fontSize = size + 'px'; saveToLocal(); });document.getElementById('applyColorBtn').addEventListener('click', function() { const selection = window.getSelection(); if (!selection.rangeCount || selection.isCollapsed) { alert('Please select text first, then choose a color and click Apply.'); return; } const color = document.getElementById('textColorPicker').value; document.execCommand('foreColor', false, color); pushUndo(); saveToLocal(); });document.getElementById('resetFormatBtn').addEventListener('click', function() { if (confirm('Reset all formatting? Text color will be cleared.')) { const allElements = editor.querySelectorAll('*'); allElements.forEach(el => { el.style.color = ''; el.style.backgroundColor = ''; }); editor.style.fontFamily = "'Inter', sans-serif"; editor.style.fontSize = '18px'; document.getElementById('fontFamilySelect').value = "'Inter', sans-serif"; document.getElementById('fontSizeInput').value = 18; pushUndo(); saveToLocal(); alert('Formatting reset!'); } });// ========== HELP MENU ========== document.getElementById('aboutBtn').addEventListener('click', function() { document.getElementById('about-modal').style.display = 'flex'; });// FAB Button document.getElementById('new-note-fab').addEventListener('click', function() { if (confirm('Create new note?')) { editor.innerHTML = ''; pushUndo(); saveToLocal(); } });// Keyboard shortcuts editor.addEventListener('keydown', function(e) { if ((e.ctrlKey || e.metaKey) && e.key === 'z') { e.preventDefault(); document.getElementById('undoBtn').click(); } else if ((e.ctrlKey || e.metaKey) && e.key === 'y') { e.preventDefault(); document.getElementById('redoBtn').click(); } });// Initialize loadFromLocal(); pushUndo(); editor.focus(); console.log('App loaded successfully! All menus should work.');