A fast, distraction-free notepad for students. Type your notes, save them to your browser and pick up exactly where you left off. Nothing is ever uploaded.
Clean writing space — auto-saves every 5 seconds
Privacy Guaranteed — Your notes are saved only to your browser. Nothing is sent to any server.
Saved
0 words · 0 chars
Auto-saving to browser0 words0 characters1 line0 min readNote 1 of 1
0
Words
0
Characters
0
Sentences
0
Paragraphs
Find & Replace
0 matches
`);
w.document.close();
w.focus();
setTimeout(() => w.print(), 300);
}function clearNote() {
const text = document.getElementById('notepad').value;
const title = document.getElementById('noteTitle').value;
if (!text && !title) return;
if (confirm('Clear this note? This cannot be undone.')) {
document.getElementById('notepad').value = '';
document.getElementById('noteTitle').value = '';
saveCurrentNote();
toast('Note cleared');
}
}function toggleFocus() {
document.body.classList.toggle('focus-mode');
}// ─── MODE TOGGLE ──────────────────────────────────────────────
function setMode(mode) {
if (mode === 'advanced') {
document.body.classList.add('advanced-mode');
document.getElementById('btnSimple').classList.remove('active');
document.getElementById('btnAdvanced').classList.add('active');
document.getElementById('modeHint').textContent = 'Multiple notes, themes, find & replace and writing stats';
renderTabs();
} else {
document.body.classList.remove('advanced-mode');
document.getElementById('btnSimple').classList.add('active');
document.getElementById('btnAdvanced').classList.remove('active');
document.getElementById('modeHint').textContent = 'Clean writing space — auto-saves every 5 seconds';
}
try { localStorage.setItem('sst_notepad_mode', mode); } catch(e) {}
}// ─── TOAST ────────────────────────────────────────────────────
function toast(msg) {
const t = document.getElementById('toast');
t.textContent = msg;
t.classList.add('show');
setTimeout(() => t.classList.remove('show'), 2200);
}// ─── EVENT LISTENERS ──────────────────────────────────────────
document.getElementById('notepad').addEventListener('input', saveCurrentNote);
document.getElementById('noteTitle').addEventListener('input', saveCurrentNote);// Auto-save every 5 seconds regardless
setInterval(() => {
saveCurrentNote();
persistAll();
}, 5000);// Keyboard shortcuts
document.addEventListener('keydown', e => {
if ((e.ctrlKey || e.metaKey) && e.key === 's') {
e.preventDefault();
persistAll();
toast('Saved!');
}
if ((e.ctrlKey || e.metaKey) && e.key === 'f' && document.body.classList.contains('advanced-mode')) {
e.preventDefault();
document.getElementById('findInput')?.focus();
}
});init();