Ram Naam Likhit — Tap to Write
NotebookSaved locally on this device
Tip: long-press or repeatedly tap the big button. Use Print to format as pages for binding.
');
win.document.close();
setTimeout(()=> win.print(), 300);
});
function updateStreak(){
const raw = JSON.parse(localStorage.getItem(STORAGE_KEY) || '{}');
const lastUpdated = raw.updated || 0;
const lastDay = new Date(lastUpdated).toDateString();
const today = new Date().toDateString();
let streakVal = parseInt(localStorage.getItem(STREAK_KEY) || '0');
if(lastUpdated===0 && entries.length>0) streakVal = 1;
if(lastDay !== today && entries.length>0){
const yesterday = new Date(); yesterday.setDate(yesterday.getDate()-1);
const yesterdayStr = yesterday.toDateString();
if(lastDay === yesterdayStr) streakVal = streakVal + 1; else streakVal = 1;
}
localStorage.setItem(STREAK_KEY, streakVal);
STREAK.textContent = streakVal;
}
SCRIPT.addEventListener('change', ()=> render());
FONTSIZE.addEventListener('input', ()=> render());
PERLINE.addEventListener('input', ()=> render());
loadState();
updateStreak();
window.addEventListener('keydown', (e)=>{
if(e.code === 'Space') { e.preventDefault(); addTap(1); }
if(e.ctrlKey && e.key.toLowerCase() === 'z') { if(entries.length) entries.pop(); saveState(); render(); }
});