Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ On first start, create a project folder (*New project…*), drop a screen record
<kbd>,</kbd> <kbd>.</kbd> nudge the selection a frame · <kbd>Alt</kbd> while dragging: no snapping ·
<kbd>Shift</kbd>+<kbd>Del</kbd> ripple delete a clip · <kbd>\</kbd> fit the timeline ·
<kbd>Ctrl</kbd>+<kbd>R</kbd> render · <kbd>Alt</kbd> 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

Expand Down
18 changes: 16 additions & 2 deletions ui/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -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; }
58 changes: 58 additions & 0 deletions ui/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() },
Expand Down Expand Up @@ -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 <body>, 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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion ui/i18n.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ <h2>Bijsnijden</h2>
</div>
</dialog>

<div class="gutter col lib" data-panel="lib" role="separator" aria-orientation="vertical" tabindex="0" title="Sleep om de breedte te wijzigen · dubbelklik: standaard"></div>
<div class="gutter col insp" data-panel="insp" role="separator" aria-orientation="vertical" tabindex="0" title="Sleep om de breedte te wijzigen · dubbelklik: standaard"></div>
<div class="gutter row" data-panel="tl" role="separator" aria-orientation="horizontal" tabindex="0" title="Sleep om de hoogte te wijzigen · dubbelklik: standaard"></div>
<div id="drop-overlay" hidden><span class="ms">upload</span>Laat los om te uploaden</div>
<div id="toast" hidden></div>

Expand Down
Loading