A minimalist, distraction-free writing web app built with vanilla HTML, CSS & JavaScript (no frameworks, no UI libraries). Your work is saved instantly to your browser's LocalStorage and works fully offline.
Inspired by the simplicity of
write-box.appspot.com, but written from scratch.
writebox/
├── index.html # Markup
├── css/
│ └── style.css # All styles (light + dark themes)
├── js/
│ └── script.js # All app logic (vanilla JS)
├── server.js # OPTIONAL Express static server
├── package.json # OPTIONAL Node dependencies
└── README.md # This file
- 🖋 Distraction-free writing area — full-screen, centered like a notepad
- 💾 Real-time auto-save to LocalStorage (debounced, ~400 ms)
- 📚 Multiple documents — create, switch, rename, and delete
- 🌗 Light & Dark mode with persistent preference (and OS-preference fallback)
- 🔢 Live word count, character count & reading-time in the status bar
- ⌨ Keyboard shortcuts (full list below)
- 📡 Offline-first — entire app runs without an internet connection
- 🎯 Centered editor with a comfortable max-width (~720 px)
- 🔠 Beautiful serif typography for body text, sans-serif for chrome
- 📱 Responsive design — works on mobile, tablet, and desktop
- ✨ Subtle fade-in / transition animations
- 🪶 Toolbar fades while you type (idle-aware), reappears on hover/movement
- 🍞 Toast notifications for actions (save, delete, import, export)
- 📥 Import
.txt/.mdfiles as new documents - 📤 Export the current document as a
.txtfile - 🪄 Editor auto-focuses on load
- 🧠 Theme preference persists across sessions
- ♿ ARIA labels & keyboard-accessible controls
| Shortcut | Action |
|---|---|
Ctrl/Cmd + N |
Create new document |
Ctrl/Cmd + S |
Force save (auto-saves anyway) |
Ctrl/Cmd + E |
Export current doc as .txt |
Ctrl/Cmd + D |
Toggle dark / light theme |
Ctrl/Cmd + M |
Toggle documents sidebar |
Esc |
Close sidebar |
The app is 100 % static. Just open index.html in any modern browser:
# from the project folder
open index.html # macOS
xdg-open index.html # Linux
start index.html # WindowsOr drag-and-drop index.html into your browser.
# 1. Install dependencies
npm install
# 2. Start the server
npm start
# 3. Visit
# http://localhost:3000# Python 3
python -m http.server 8000
# Then visit http://localhost:8000When served by server.js:
| Path | Method | Description |
|---|---|---|
/ |
GET |
Loads the WriteBox app (index.html) |
/api/documents |
GET |
(optional) List all documents |
/api/documents |
POST |
(optional) Create a document |
/api/documents/:id |
GET |
(optional) Get a single document |
/api/documents/:id |
PUT |
(optional) Update title / content |
/api/documents/:id |
DELETE |
(optional) Delete a document |
Note: the optional API uses an in-memory store and is for demonstration only. The frontend itself uses LocalStorage as its source of truth.
All data is stored in the browser's localStorage:
| Key | Value |
|---|---|
writebox.documents |
Array<Document> (JSON) |
writebox.activeDocId |
string — id of the currently open document |
writebox.theme |
"light" | "dark" |
{
id: "doc_lwa3kzs9_a8b3xy", // unique id
title: "My essay",
content: "Once upon a time...",
createdAt: 1714670400000, // ms timestamp
updatedAt: 1714670450000
}- ☁ Cloud / cross-device sync (the optional Express API is in-memory only)
- 👥 Multi-user accounts & authentication
- 📝 Markdown live-preview rendering
- 🔍 Full-text search across documents
- 🏷 Tags / folders for organising documents
- ⏪ Version history / undo beyond browser native
- 📦 Export to PDF / Markdown / DOCX
- 🌍 i18n / multilingual UI
- Persist the optional Express API — replace the in-memory
Mapwith SQLite or a JSON file so documents survive restarts. - Add markdown preview — toggle a side-by-side rendered view using a tiny markdown parser.
- Build full-text search — add a search field above the document list.
- Add PWA support — register a service worker + manifest so users can "install" the app and use it 100 % offline by default.
- Cloud sync — add user accounts and sync LocalStorage with the backend on conflict-resolution rules (last-write-wins or CRDTs).
- Export formats — PDF (via
window.print()styling) and Markdown.
- Offer a calm, beautiful place to write — no menus to fight, no accounts required.
- Demonstrate that a polished, multi-document editor can be built without any framework.
- Stay fully functional offline by treating LocalStorage as the source of truth.
MIT — do whatever you like, just don't sue.