Changeset d2078f4 in Klonkt


Ignore:
Timestamp:
06/19/2026 11:38:22 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
06f3791
Parents:
16ce669
Message:

feat(editor): full-screen writing mode

Button in the editor toolbar sets the writing field to fixed/100dvh
(fills the entire page); editor flex:1 scrolls itself, body scroll
locked. Press again or Escape to exit. Great for distraction-free writing
on mobile.

Co-Authored-By: Claude <noreply@…>

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG.md

    r16ce669 rd2078f4  
    2424
    2525### Toegevoegd
     26- Schrijfvenster kan op **volledig scherm** (knop in de editor-toolbar, of Escape om
     27  terug te gaan) — fijn voor afleidingsvrij schrijven op mobiel.
    2628- Beheerder kan z'n **Google-account koppelen** (Account → Inloggen met Google) en
    2729  daarna óók met Google inloggen. Veilig: koppelen kan alleen terwijl je met
  • src/views/pages/post-edit.ejs

    r16ce669 rd2078f4  
    122122          <button type="button" data-cmd="removeFormat" title="Wis opmaak" aria-label="Wis opmaak">
    123123            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 7V4h16v3"/><path d="M9 20h6"/><path d="M5 5l14 14" stroke-linecap="round"/></svg>
     124          </button>
     125          <button type="button" id="pe-fullscreen-btn" title="Volledig scherm" aria-label="Volledig scherm" aria-pressed="false">
     126            <svg class="fs-icon-expand" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>
     127            <svg class="fs-icon-compress" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/><line x1="14" y1="10" x2="21" y2="3"/><line x1="3" y1="21" x2="10" y2="14"/></svg>
    124128          </button>
    125129        </div>
     
    432436.pe-toolbar-spacer { flex: 1; }
    433437
     438/* ─── Volledig-scherm schrijfmodus ─── */
     439.fs-icon-compress { display: none; }
     440.pe-editor-frame.pe-fs .fs-icon-expand { display: none; }
     441.pe-editor-frame.pe-fs .fs-icon-compress { display: inline; }
     442.pe-editor-frame.pe-fs {
     443  position: fixed; inset: 0; z-index: 1000;
     444  margin: 0; border-top: 0;
     445  height: 100dvh;
     446  background: var(--paper);
     447}
     448/* In fullscreen vult het schrijfveld de resterende ruimte en scrollt het zelf. */
     449.pe-editor-frame.pe-fs .pe-editor {
     450  flex: 1 1 auto; min-height: 0; height: auto;
     451}
     452body.pe-fs-open { overflow: hidden; }
     453
    434454/* Editor body — looks like prose, behaves like a textarea */
    435455.pe-editor {
     
    11371157  }
    11381158
     1159  // ── Volledig-scherm schrijfmodus: het schrijfveld vult de hele pagina.
     1160  const fsBtn = document.getElementById('pe-fullscreen-btn');
     1161  const editorFrame = document.querySelector('.pe-editor-frame');
     1162  function toggleFullscreen() {
     1163    if (!editorFrame) return;
     1164    const on = editorFrame.classList.toggle('pe-fs');
     1165    document.body.classList.toggle('pe-fs-open', on);
     1166    if (fsBtn) {
     1167      fsBtn.setAttribute('aria-pressed', on ? 'true' : 'false');
     1168      fsBtn.title = on ? 'Verklein' : 'Volledig scherm';
     1169    }
     1170    if (on) editor.focus({ preventScroll: true });
     1171  }
     1172  if (fsBtn) fsBtn.addEventListener('click', toggleFullscreen);
     1173  document.addEventListener('keydown', (e) => {
     1174    if (e.key === 'Escape' && editorFrame && editorFrame.classList.contains('pe-fs')) {
     1175      e.preventDefault();
     1176      toggleFullscreen();
     1177    }
     1178  });
     1179
    11391180  // Reflect bold/italic/list state on the toolbar buttons
    11401181  function updateToolbarState() {
Note: See TracChangeset for help on using the changeset viewer.