Skip to content

Commit 199e1eb

Browse files
committed
v1.2.0 — focus mode, export as .txt, dark theme restyle
1 parent ffd516f commit 199e1eb

5 files changed

Lines changed: 171 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
All notable changes to Writelo will be documented in this file.
44

5+
## [1.2.0] - 2026-03-23
6+
7+
### New Features
8+
9+
- **Focus Mode** — A new toolbar button (⤢) hides the header, sidebar, and bottom links, leaving the editor as a full-viewport writing surface. Exit by pressing `Escape` or clicking the "Exit focus" button that appears in the top-right corner.
10+
- **Export as .txt** — Right-click any tab to download its content as a plain `.txt` file named after the tab. Works on background tabs too (no need to switch first). Available in the tab context menu alongside Duplicate and Close.
11+
12+
### Visual Improvements
13+
14+
- **Dark theme redesigned** — The default dark theme now uses charcoal gray tones (inspired by Notion's dark palette) instead of the previous blue-navy gradient. Backgrounds, surfaces, modals, and toasts all updated for a warmer, less blue-tinted feel.
15+
- **Default accent color changed to Blue** — The out-of-the-box accent is now Blue (`#3b82f6`) instead of Teal. Existing users with a saved preference are unaffected.
16+
- **Editor focus border removed** — The purple glow that appeared around the editor on focus has been removed for a cleaner look.
17+
18+
### Bug Fixes
19+
20+
- **Light theme toggle switches** — Toggle switch tracks in the Settings modal were nearly invisible on the light theme. They now have a visible inset border when off, which clears cleanly when toggled on.
21+
522
## [1.1.0] - 2026-03-21
623

724
### Improvements

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@ Download the files and open `index.html` in any modern browser. That's it.
3737
### Viewing & Copying
3838
- **Markdown Preview** — render your text as formatted Markdown in a modal overlay
3939
- **Copy All** — copy everything in the current tab to your clipboard in one click
40+
- **Focus Mode** — click the ⤢ icon in the toolbar to hide all chrome (header, sidebar, footer links) and write distraction-free. Press `Escape` or click "Exit focus" to return.
4041

4142
### Customization
4243
Open Settings (gear icon) to choose:
4344

4445
| Option | Choices |
4546
|--------|---------|
4647
| Theme | Dark, Light, Ultra Dark |
47-
| Accent color | Purple, Blue, Green, Rose, Amber, **Teal** (default) |
48+
| Accent color | Purple, **Blue** (default), Green, Rose, Amber, Teal |
4849

4950
The header logo, title gradient, and subtitle all update to match the chosen accent color.
5051

@@ -54,6 +55,7 @@ Back up and restore your notes from the **Settings → Data** section.
5455
- **Export** — downloads a `writelo-backup-YYYY-MM-DD.json` file containing all your tabs
5556
- **Import** — opens a file picker; after confirmation, replaces all current tabs with the backup's content
5657
- **Include app settings** toggle — when checked, the export file also contains your theme, accent color, and feature flags, and import will restore them too
58+
- **Export as .txt** — right-click any tab and choose **Export as .txt** to download that tab's content as a plain text file
5759

5860
Exported JSON format:
5961
```json
@@ -81,6 +83,7 @@ If you open Writelo in more than one browser tab, they stay in sync automaticall
8183
| Ctrl+F / Cmd+F | Open Find & Replace (when enabled) |
8284
| Enter | Next match (in find panel) |
8385
| Shift+Enter | Previous match (in find panel) |
86+
| Escape | Exit Focus Mode |
8487

8588
---
8689

@@ -92,7 +95,7 @@ If you open Writelo in more than one browser tab, they stay in sync automaticall
9295
| Switch tab | Click the tab |
9396
| Rename tab | Double-click the tab name |
9497
| Close tab | Click × on the tab (requires more than one tab) |
95-
| Duplicate / Close | Right-click the tab for a context menu |
98+
| Duplicate / Close / Export .txt | Right-click the tab for a context menu |
9699

97100
---
98101

app.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,4 +1021,58 @@ document.addEventListener('DOMContentLoaded', () => {
10211021
localStorage.setItem(WELCOME_KEY, '1');
10221022
setTimeout(() => welcomeModal.classList.add('show'), 400);
10231023
}
1024+
1025+
// Export as .txt (context menu)
1026+
const menuExportTxt = document.getElementById('menu-export-txt');
1027+
if (menuExportTxt) {
1028+
menuExportTxt.addEventListener('click', () => {
1029+
const targetTab = tabs.find(t => t.id === contextMenuTargetId);
1030+
tabContextMenu.style.display = 'none';
1031+
contextMenuTargetId = null;
1032+
if (!targetTab) return;
1033+
1034+
// Flush textarea content if this is the active tab
1035+
if (targetTab.id === activeTabId) targetTab.content = textarea.value;
1036+
1037+
if (!targetTab.content.trim()) {
1038+
showToast('Nothing to export — tab is empty', false);
1039+
return;
1040+
}
1041+
1042+
const safeName = targetTab.name.replace(/[/\\?%*:|"<>]/g, '-').trim() || 'note';
1043+
const blob = new Blob([targetTab.content], { type: 'text/plain' });
1044+
const url = URL.createObjectURL(blob);
1045+
const a = document.createElement('a');
1046+
a.href = url;
1047+
a.download = `${safeName}.txt`;
1048+
document.body.appendChild(a);
1049+
a.click();
1050+
document.body.removeChild(a);
1051+
URL.revokeObjectURL(url);
1052+
showToast(`Exported "${targetTab.name}" as .txt`, true);
1053+
});
1054+
}
1055+
1056+
// Focus Mode
1057+
const focusBtn = document.getElementById('focus-btn');
1058+
const focusExitBtn = document.getElementById('focus-exit-btn');
1059+
1060+
function enterFocusMode() {
1061+
document.body.classList.add('focus-mode');
1062+
textarea.focus();
1063+
}
1064+
1065+
function exitFocusMode() {
1066+
document.body.classList.remove('focus-mode');
1067+
textarea.focus();
1068+
}
1069+
1070+
if (focusBtn) focusBtn.addEventListener('click', enterFocusMode);
1071+
if (focusExitBtn) focusExitBtn.addEventListener('click', exitFocusMode);
1072+
1073+
document.addEventListener('keydown', (e) => {
1074+
if (e.key === 'Escape' && document.body.classList.contains('focus-mode')) {
1075+
exitFocusMode();
1076+
}
1077+
});
10241078
});

index.css

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,4 +1764,64 @@ kbd {
17641764

17651765
[data-accent="grey"] .tab-item.active .close-tab-btn {
17661766
color: #e2e8f0;
1767+
}
1768+
1769+
/* Focus Mode */
1770+
body.focus-mode {
1771+
padding: 0;
1772+
}
1773+
1774+
body.focus-mode .app-container {
1775+
height: 100dvh;
1776+
max-width: 100%;
1777+
gap: 0;
1778+
}
1779+
1780+
body.focus-mode header,
1781+
body.focus-mode .app-bottom-links {
1782+
display: none;
1783+
}
1784+
1785+
body.focus-mode .tabs-bar {
1786+
display: none;
1787+
}
1788+
1789+
body.focus-mode .editor-container {
1790+
border-radius: 0;
1791+
border-left: none;
1792+
border-right: none;
1793+
border-top: none;
1794+
box-shadow: none;
1795+
}
1796+
1797+
.focus-exit-btn {
1798+
position: fixed;
1799+
top: 1rem;
1800+
right: 1rem;
1801+
z-index: 200;
1802+
display: none;
1803+
align-items: center;
1804+
gap: 0.4rem;
1805+
padding: 0.35rem 0.75rem 0.35rem 0.6rem;
1806+
background: var(--glass-bg);
1807+
backdrop-filter: blur(12px);
1808+
-webkit-backdrop-filter: blur(12px);
1809+
border: 1px solid var(--glass-border);
1810+
border-radius: 8px;
1811+
color: var(--text-muted);
1812+
font-size: 0.75rem;
1813+
font-family: inherit;
1814+
cursor: pointer;
1815+
transition: color 0.2s;
1816+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1817+
}
1818+
1819+
body.focus-mode .focus-exit-btn {
1820+
display: flex;
1821+
}
1822+
1823+
.focus-exit-btn:hover {
1824+
color: var(--text-main);
1825+
transform: none;
1826+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
17671827
}

index.html

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ <h1>Writelo</h1>
8686
<line x1="14" y1="11" x2="14" y2="17"></line>
8787
</svg>
8888
</button>
89+
<button id="focus-btn" title="Focus Mode">
90+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
91+
stroke-linecap="round" stroke-linejoin="round">
92+
<path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path>
93+
</svg>
94+
</button>
8995
</div>
9096

9197
<!-- Always visible -->
@@ -202,6 +208,14 @@ <h1>Writelo</h1>
202208
<button id="about-btn" class="bottom-link">About</button>
203209
</div>
204210

211+
<button id="focus-exit-btn" class="focus-exit-btn" title="Exit Focus Mode">
212+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
213+
stroke-linecap="round" stroke-linejoin="round">
214+
<path d="M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"></path>
215+
</svg>
216+
Exit focus
217+
</button>
218+
205219
<div id="settings-modal" class="modal-overlay">
206220
<div class="modal">
207221
<div class="modal-header">
@@ -332,6 +346,16 @@ <h2>Preview</h2>
332346
</svg>
333347
Duplicate
334348
</div>
349+
<div class="menu-item" id="menu-export-txt">
350+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
351+
stroke-linecap="round" stroke-linejoin="round">
352+
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
353+
<polyline points="14 2 14 8 20 8"></polyline>
354+
<line x1="16" y1="13" x2="8" y2="13"></line>
355+
<line x1="16" y1="17" x2="8" y2="17"></line>
356+
</svg>
357+
Export as .txt
358+
</div>
335359
<div class="menu-item menu-item-danger" id="menu-close">
336360
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
337361
stroke-linecap="round" stroke-linejoin="round">
@@ -371,7 +395,7 @@ <h3>Tabs</h3>
371395
<li><strong>Switch</strong> — click any tab name.</li>
372396
<li><strong>Rename</strong> — double-click a tab name, type, then press Enter.</li>
373397
<li><strong>Close</strong> — click the × on a tab (requires confirmation). You need at least two tabs for × to appear.</li>
374-
<li><strong>Duplicate / Close</strong> — right-click a tab to open the context menu.</li>
398+
<li><strong>Duplicate / Export as .txt / Close</strong> — right-click a tab to open the context menu.</li>
375399
</ul>
376400
</div>
377401

@@ -401,6 +425,14 @@ <h3>Markdown Preview</h3>
401425
</ul>
402426
</div>
403427

428+
<div class="help-section">
429+
<h3>Focus Mode</h3>
430+
<ul>
431+
<li>Click the ⤢ icon in the toolbar to enter Focus Mode — hides the header, sidebar, and footer for distraction-free writing.</li>
432+
<li>Press <kbd>Escape</kbd> or click <strong>Exit focus</strong> (top-right corner) to return to normal view.</li>
433+
</ul>
434+
</div>
435+
404436
<div class="help-section">
405437
<h3>Copy &amp; Clear</h3>
406438
<ul>
@@ -435,6 +467,7 @@ <h3>Keyboard Shortcuts</h3>
435467
<div class="help-shortcut-row"><kbd>Ctrl+F</kbd><span>Open Find &amp; Replace (when enabled)</span></div>
436468
<div class="help-shortcut-row"><kbd>Enter</kbd><span>Next match (in Find input)</span></div>
437469
<div class="help-shortcut-row"><kbd>Shift+Enter</kbd><span>Previous match (in Find input)</span></div>
470+
<div class="help-shortcut-row"><kbd>Escape</kbd><span>Exit Focus Mode</span></div>
438471
</div>
439472
</div>
440473
</div>
@@ -549,7 +582,7 @@ <h2>About Writelo</h2>
549582
<div>
550583
<p class="about-name">Writelo</p>
551584
<p class="about-tagline">Simple Text Editor</p>
552-
<p class="about-version">v1.1.0</p>
585+
<p class="about-version">v1.2.0</p>
553586
</div>
554587
</div>
555588

0 commit comments

Comments
 (0)