diff --git a/README.md b/README.md index f5a04a6..55ea602 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ On first start, create a project folder (*New project…*), drop a screen record , . nudge the selection a frame · Alt while dragging: no snapping · Shift+Del ripple delete a clip · \ fit the timeline · Ctrl+R render · Alt menu bar. The full list is under *Help → Keyboard shortcuts*. +Drag the edges between the panels to resize them (double-click an edge for its default size). ## 🤝 Where you can help diff --git a/ui/editor.css b/ui/editor.css index 749d778..6c1a381 100644 --- a/ui/editor.css +++ b/ui/editor.css @@ -10,7 +10,7 @@ html, body { height: 100%; margin: 0; } body { background: var(--bg); color: var(--text); font: 14px/1.35 'Google Sans Flex', system-ui, sans-serif; - display: grid; grid-template-columns: 250px minmax(0, 1fr) 330px; grid-template-rows: 54px minmax(0, 1fr) 290px; + display: grid; grid-template-columns: var(--lib-w, 250px) minmax(0, 1fr) var(--insp-w, 330px); grid-template-rows: 54px minmax(0, 1fr) var(--tl-h, 290px); overflow: hidden; } .ms { font-family: 'Material Symbols Rounded'; font-weight: 500; font-size: 20px; line-height: 1; display: inline-block; font-variation-settings: 'FILL' 0; user-select: none; } @@ -456,7 +456,7 @@ button.tapmode.on { background: var(--orange); color: #3a2108; border-color: var .media-empty .ms { font-size: 28px; color: var(--accent); opacity: .8; } .media-empty:hover { border-color: var(--accent); color: var(--text); background: #b8c7ff0a; } -#clip-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; } +#clip-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px 8px; } .clip-wrap { position: relative; min-width: 0; } .clip-wrap[draggable="true"] { cursor: grab; } .clip-card { position: relative; width: 100%; padding: 0; display: block; overflow: hidden; border-radius: 10px; border: 1px solid var(--line2); background: #000; cursor: pointer; transition: border-color .12s, box-shadow .12s; } @@ -508,3 +508,17 @@ button.tapmode.on { background: var(--orange); color: #3a2108; border-color: var body.tl-scrubbing, body.tl-scrubbing * { cursor: ew-resize !important; user-select: none; } #tl-playhead span { pointer-events: auto; cursor: ew-resize; } #tl-playhead span::after { content: ""; position: absolute; inset: -6px -6px -4px; } + +/* resizable panels: thin grab strips on the edges between the panels */ +.gutter { position: fixed; z-index: 20; touch-action: none; outline: none; } +.gutter::after { content: ""; position: absolute; background: var(--accent); opacity: 0; transition: opacity .12s; } +.gutter:hover::after, .gutter.on::after, .gutter:focus-visible::after { opacity: .7; transition-delay: .08s; } +.gutter.col { top: 54px; bottom: var(--tl-h, 290px); width: 9px; cursor: col-resize; } +.gutter.col::after { top: 0; bottom: 0; left: 3px; width: 3px; } +.gutter.lib { left: calc(var(--lib-w, 250px) - 5px); } +.gutter.insp { right: calc(var(--insp-w, 330px) - 4px); } +.gutter.row { left: 0; right: 0; bottom: calc(var(--tl-h, 290px) - 5px); height: 9px; cursor: row-resize; } +.gutter.row::after { left: 0; right: 0; top: 3px; height: 3px; } +body.resizing-col, body.resizing-col * { cursor: col-resize !important; user-select: none; } +body.resizing-row, body.resizing-row * { cursor: row-resize !important; user-select: none; } +body.resizing-col iframe, body.resizing-row iframe { pointer-events: none; } diff --git a/ui/editor.js b/ui/editor.js index 05c19d4..53d59af 100644 --- a/ui/editor.js +++ b/ui/editor.js @@ -2062,6 +2062,7 @@ function buildMenus() { { label: 'Beats van de muziek (tonen + snappen)', checked: !!S.snapBeats, run: () => $('#beats-toggle').click(), disabled: !hasV() }, { label: 'Tijdlijn inzoomen', icon: 'zoom_in', key: 'Ctrl+scroll', run: () => zoomTimeline(1.25) }, { label: 'Tijdlijn uitzoomen', icon: 'zoom_out', run: () => zoomTimeline(0.8) }, + { label: 'Paneelgroottes herstellen', icon: 'reset_wrench', run: resetPanels, disabled: !Object.keys(panelSizes).length }, bridge && { sep: true }, bridge && { label: 'Volledig scherm', key: 'F11', icon: 'fullscreen', run: () => bridge.window?.('fullscreen') }, bridge && { label: 'Herladen', key: 'F5', run: () => location.reload() }, @@ -2304,6 +2305,62 @@ function wireDialogs() { } } +// ---------- resizable panels ---------- +// Drag the edge between two panels to resize them; double-click an edge for its default size. The sizes are CSS +// variables on , remembered per install (localStorage), and kept within limits when the window shrinks. +const PANELS = { + lib: { v: '--lib-w', def: 250, min: 190, max: () => innerWidth * 0.4 }, + insp: { v: '--insp-w', def: 330, min: 270, max: () => innerWidth * 0.4 }, + tl: { v: '--tl-h', def: 290, min: 150, max: () => innerHeight - 54 - 260 } +}; +const panelSizes = (() => { try { return JSON.parse(localStorage.getItem('ms-panels') || '{}'); } catch { return {}; } })(); +function applyPanels() { + for (const [k, p] of Object.entries(PANELS)) { + const size = Math.round(Math.max(p.min, Math.min(p.max(), panelSizes[k] ?? p.def))); + document.body.style.setProperty(p.v, `${size}px`); + } +} +function setPanel(k, size) { + const p = PANELS[k]; + if (size == null) delete panelSizes[k]; else panelSizes[k] = Math.round(Math.max(p.min, Math.min(p.max(), size))); + try { localStorage.setItem('ms-panels', JSON.stringify(panelSizes)); } catch {} + applyPanels(); +} +function resetPanels() { for (const k of Object.keys(PANELS)) delete panelSizes[k]; setPanel('lib', null); } // setPanel saves and applies +function wirePanels() { + applyPanels(); + addEventListener('resize', applyPanels); + for (const g of document.querySelectorAll('.gutter')) { + const k = g.dataset.panel, p = PANELS[k]; + g.addEventListener('dblclick', () => setPanel(k, null)); + // Keyboard: the arrows move the edge (Shift: in bigger steps). + g.addEventListener('keydown', e => { + const d = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -1, ArrowDown: 1 }[e.key]; + if (!d) return; + e.preventDefault(); e.stopPropagation(); + const cur = parseFloat(getComputedStyle(document.body).getPropertyValue(p.v)) || p.def; + setPanel(k, cur + d * (k === 'lib' ? 1 : -1) * (e.shiftKey ? 48 : 12)); + }); + g.addEventListener('pointerdown', e => { + e.preventDefault(); + g.setPointerCapture(e.pointerId); + const start = k === 'tl' ? e.clientY : e.clientX; + const from = parseFloat(getComputedStyle(document.body).getPropertyValue(p.v)) || p.def; + // Library grows to the right, the inspector to the left, the timeline upwards. + const dir = k === 'lib' ? 1 : -1; + document.body.classList.add(k === 'tl' ? 'resizing-row' : 'resizing-col'); + g.classList.add('on'); + const move = ev => setPanel(k, from + dir * ((k === 'tl' ? ev.clientY : ev.clientX) - start)); + const up = () => { + g.removeEventListener('pointermove', move); g.removeEventListener('pointerup', up); g.removeEventListener('pointercancel', up); + document.body.classList.remove('resizing-row', 'resizing-col'); + g.classList.remove('on'); + }; + g.addEventListener('pointermove', move); g.addEventListener('pointerup', up); g.addEventListener('pointercancel', up); + }); + } +} + // ---------- uploads ---------- async function upload(files) { let kind = null; @@ -2365,6 +2422,7 @@ function wireClipboard() { function init() { addEventListener('keydown', onKey); addEventListener('resize', fitStage); + wirePanels(); new ResizeObserver(fitStage).observe($('#stage-fit')); $('#video-select').addEventListener('change', e => openVideo(e.target.value)); $('#btn-undo').onclick = undo; diff --git a/ui/i18n.js b/ui/i18n.js index e623beb..2ff6115 100644 --- a/ui/i18n.js +++ b/ui/i18n.js @@ -50,7 +50,8 @@ const en = { 'Schermopnames (mp4, mov, webm), screenshots (png, jpg) of audio (wav, mp3)': 'Screen recordings (mp4, mov, webm), screenshots (png, jpg) or audio (wav, mp3)', 'Nog geen audio. Upload muziek of een opname (wav, mp3, m4a).': 'No audio yet. Upload music or a recording (wav, mp3, m4a).', 'Beluisteren': 'Listen', 'Als muziek onder de video': 'As music under the video', 'Als stem / audiospoor': 'As voice / audio track', 'Bestand verwijderen': 'Delete file', - 'stem': 'voice', 'muziek': 'music', 'foto': 'photo', 'Media': 'Media', 'Selectie opheffen (Esc)': 'Deselect (Esc)', 'Zoeken': 'Search', 'Gebruikt in deze video': 'Used in this video', 'Of sleep naar de tijdlijn': 'Or drag it onto the timeline', + 'stem': 'voice', 'muziek': 'music', 'foto': 'photo', 'Media': 'Media', 'Paneelgroottes herstellen': 'Reset panel sizes', 'Sleep om de breedte te wijzigen': 'Drag to change the width', + 'Sleep om de hoogte te wijzigen': 'Drag to change the height', 'dubbelklik: standaard': 'double-click: default', 'Selectie opheffen (Esc)': 'Deselect (Esc)', 'Zoeken': 'Search', 'Gebruikt in deze video': 'Used in this video', 'Of sleep naar de tijdlijn': 'Or drag it onto the timeline', 'Klik om op de playhead te zetten, of sleep naar de tijdlijn. Nieuwe bestanden kun je overal in het venster neerzetten.': 'Click to put it at the playhead, or drag it onto the timeline. Drop new files anywhere in the window.', 'Sleep schermopnames of screenshots hierheen, of klik om te uploaden': 'Drop screen recordings or screenshots here, or click to upload', 'Sleep muziek of een opname hierheen (wav, mp3, m4a), of klik om te uploaden': 'Drop music or a recording here (wav, mp3, m4a), or click to upload', diff --git a/ui/index.html b/ui/index.html index ad9db6f..f50021a 100644 --- a/ui/index.html +++ b/ui/index.html @@ -215,6 +215,9 @@

Bijsnijden

+ + +