Skip to content

Video as code: canvas scenes rendered with WebCodecs in headless Chrome, a review viewer, and agent skills that build the video from your references.

Viewer: a phone layout and a tap for the full-screen bar; drop unused code (#6)

Stanyslaus Harya18660437a3c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d15dd10..07e9a37 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ Changes are listed by release, newest first. The sections dated before 0.1.0 rec
- Full screen in the viewer has a player bar. Before, it showed the preview alone. Now one white card runs along the bottom of the full-screen preview, as in the cinema viewer of DaVinci Resolve or Frame.io: a scrub bar split into the scenes, with the open notes' numbers above it and a range as a blue band, then the time and the scene on the left, previous, play and next in the middle of the screen, and a button on the right that leaves full screen. Click or drag the scrub bar to move in time, rest on it to see the time, click a note's number to open it; the arrows step a frame anywhere in full screen. The timeline and its range, zoom and timeline buttons stay out. So that it covers no part of the frame, the bar stays hidden, also while paused, and comes up while the pointer is in the bottom 120 px of the screen, like an auto-hidden taskbar; it also shows for 2.5 s on entering full screen and after Space, the arrows, Home or End, and never while a note is drawn or moved. While the video plays and the pointer rests, the cursor hides too. `F` opens and closes full screen, tooltips show there too, and the full-screen button no longer keeps the focus, so Space plays instead of leaving full screen. Checked in a windowed Chrome on the Windows laptop over the DevTools protocol, on a 1920x1080 screen: a click at the middle of the scrub bar went to 00:04.50 of 9 s, a drag to 80% to 00:07.20 and the scene name followed, the play button sat at the middle of the screen whatever the scene name, the arrows stepped one frame, a note's number opened that note, the bar hid 2.5 s after entering while paused, came up with the pointer near the bottom and stayed there, went when the pointer left, showed after an arrow key, stayed down while a box was drawn to 40 px above the bottom edge, and hid with the cursor while playing, a note could be drawn and moved, and the exit button brought the timeline back. Headless Chrome refuses full screen, so this has no automated test.
- An open note's box can be moved by dragging inside it and resized by dragging a corner or an edge, and an open point can be dragged. Before, a box in the wrong place had to be deleted and drawn again. The box stays inside the frame and keeps its number, text and frame, and its picture in `selection/` is drawn again.
- Delete all done notes, under the unfolded done notes, deletes the open version's done notes and their pictures in one go, after a second click within 4 s. Both note changes were checked in headless Chrome on the example project: moving, resizing from a corner, flipping a box by dragging a corner past the other one, dragging it off the frame, moving a point, the cursors over each part, a new box drawn over a closed one, and clearing two done notes while an open one stayed.
+- The viewer has a phone layout. Held upright, it is one column that scrolls: the preview across the top instead of a small preview in a large grey area, the play toolbar with the full-screen button, the timeline, then the notes, scenes and audio, notes first, instead of a side drawer. The header keeps the project and its version, and Export shows its icon. The menus open across the width under the header, and the open note's card sits across the bottom of the screen above the keyboard. Held sideways (below 500 px high), the side panel starts closed and floats, so the preview went from 135x76 to 286x161 px at 844x390. Menus fit the screen's height, and on a 360 px phone the toolbar's buttons shrink to 38 px so it fits. In full screen on a touch screen, a tap near the bottom brings the player bar up, and a drag from there still draws a box. Checked in headless Chrome with a phone emulated at 390x844, 360x740, 844x390 and 740x360 (no sideways scrolling, every menu inside the screen, a note drawn with touch events and saved), the tap in full screen in a windowed Chrome with touch emulated, and the desktop layout unchanged. A real phone has not been tried.
### Fixed
diff --git a/DESIGN.md b/DESIGN.md
index bef6e36..7eb3398 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -17,7 +17,8 @@ This covers `src/editor.html`. The viewer is only for looking at a project and p
- Full screen is for watching, laid out like the player bar of DaVinci Resolve's cinema viewer or Frame.io but in the viewer's own style: the preview fills the screen on `#111`, and one white card like the timeline's (12 px radius, the menu shadow, 12 px from the screen's edges) runs along the bottom. Its top is a scrub bar: a 4 px track per scene in `#dcdcda`, 2 px apart at each cut, dark `#1f1f1e` up to the playhead, with a 12 px dark knob, the open notes' numbers as the timeline's light blue tags above it, and a range as a 16% blue band. A hover shows the time in a small dark label like a tooltip. Under it the row has three columns like the header: the time and the scene's name in muted text on the left, previous, play and next in the middle of the screen, as under the preview in the window, and on the right the button that leaves full screen (its arrows pointing in). A long scene name ends in an ellipsis, so the middle never moves. The timeline, the range bar, the range, zoom and timeline buttons and the full-screen pill are left out. The card is hidden unless the pointer is in the bottom 120 px, like an auto-hidden taskbar, so the whole frame shows while it is looked at; it fades in and out over 0.26 s, shows for 2.5 s on entering full screen and after a transport key, and never comes up while a note is being drawn. The cursor hides while it plays and the pointer rests.
- The timeline is at most 35% of the window height and scrolls, so a project with many audio files does not push the preview out. The preview area is at least 150 px including padding.
- The timeline's final height is set as soon as `project.json` is read, so it does not jump when the scenes finish loading.
-- Below 720 px the sidebar floats over the canvas instead of squeezing it, and it closes when the window becomes that narrow. On touch screens buttons grow to 44 px.
+- On a phone held upright (below 720 px wide) the page is one column that scrolls, in the order a review on a phone needs, as in Frame.io's app: the preview at the top across the width (8 px from the edges, at most 62% of the screen high), the play toolbar with the full-screen button at its end instead of the pill, the timeline, then Notes, Scenes and Audio, notes first, as plain lists under a half-pixel line. The header keeps only the project and its version, and Export shows its icon. The menus open across the width under the header, and the open note's card sits across the bottom of what is visible, above the on-screen keyboard. Below 380 px the toolbar's buttons are 38 px wide so it fits a 360 px phone.
+- A short window (below 500 px high, as a phone held sideways) keeps the two panes, but the sidebar floats over the canvas and starts closed, and the timeline takes at most 28% of the height. A window that becomes narrow or short closes the sidebar too. On touch screens buttons grow to 44 px, and every menu fits the screen's height and scrolls when it would not.
- Spacing is in steps of roughly 2 px (6, 8, 10, 12). Radius follows element size, from 3 px on the preview to 12 px on the timeline card.
## Colour
diff --git a/ROADMAP.md b/ROADMAP.md
index c2a3cc3..b6ad6e8 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -10,7 +10,6 @@ What is not built, what has not been tested, and ideas that came up while using
- The viewer on a VPS with a domain. That needs security in front of it, or access only through Tailscale, which is also worth considering. From there, work could be run remotely on the personal laptop (when it is on) or on the VPS (when there is one).
- Custom GLSL transitions from a file in the project. A transition as a layer over the cut (a swish of shapes) already exists as the asset skill's `transition.js`, but each of the two scene pages has to draw its half by hand; `project.json` has no option for it.
- A cut list that splits one recording over several scenes by section, with captions placed from a transcript. `cuts.js` has the time map (`toOut`), but each section page still picks its part of the list by hand.
-- Bringing up the viewer's full-screen player bar on a touch screen. The bar comes up when the pointer is near the bottom edge, and a finger has no pointer to rest there, so on a touch screen only the keys (Space, the arrows, Home and End) show it. A tap in the bottom strip could, as long as it still leaves a note drawn there alone.
- A dark mode for the viewer. Its colours are written into the CSS and the timeline's canvas code, so they need to become tokens with dark values checked for contrast first.
## Not tested yet
@@ -30,6 +29,7 @@ What is not built, what has not been tested, and ideas that came up while using
- The asset skill's FBX and OBJ files in programs other than Blender (Unity, Unreal, Maya, Cinema 4D).
- `svgparts.js` and `transition.js` in the viewer. They were checked with stills and a video render.
- Notes on a real touch screen. Touch was emulated in Chrome over the DevTools protocol. Moving and resizing a box was tried with the mouse only.
+- The viewer on a real phone. The phone layout, its menus and notes drawn with touch were checked in Chrome with a phone emulated over the DevTools protocol, at 390 and 360 px upright and 844 and 740 px sideways. On an iPhone, Safari allows full screen for video elements only, so the viewer has no full screen there.
- The viewer's full screen outside Chrome on Windows.
- The skills in agents other than Claude Code. The installer was run with `--dry-run` for every target, and the folders come from each agent's docs, but no other agent has loaded the skills or made a video with them yet. That includes Muse Code and Hermes Agent, added from their docs in November 2026.
diff --git a/docs/viewer.md b/docs/viewer.md
index e09eaf1..16b1fcd 100644
--- a/docs/viewer.md
+++ b/docs/viewer.md
@@ -129,6 +129,8 @@ The done notes can be deleted in one go with Delete all done notes, the last row
Full screen shows the preview on the whole screen with a player bar along its bottom edge. The bar has a scrub bar across its width, split into the scenes and dark up to the playhead: click or drag it to move in time, and rest the pointer on it to see the time there. The open notes' numbers sit above it, and a click on one opens that note; a range shows as a light blue band. Under it, the time and the scene's name are on the left, previous, play and next in the middle of the screen, and a button on the right leaves full screen. The Left and Right arrows step one frame anywhere in full screen (one second with Shift), and Home and End jump to the start and the end. The timeline, the range bar and the range, zoom and timeline buttons stay out of full screen; `R` does nothing there, while `I`, `O` and `X` still mark a range at the playhead. The bar stays hidden so that it covers nothing, also while the video is paused, and comes up like an auto-hidden taskbar while the pointer is in the bottom 120 px of the screen. It also shows for 2.5 seconds on entering full screen and after Space, the arrows, Home or End. Drawing or moving a note never brings it up, so a box can be drawn down to the bottom of the frame. While the video plays and the pointer rests for 2.5 seconds with the bar hidden, the cursor hides too.
+On a touch screen, where no pointer rests near the bottom, a tap in the bottom 120 px of the screen brings the bar up for 2.5 seconds instead of marking a point there, and a drag from that strip still draws a box. On an iPhone, Safari only lets a video element go full screen, so the full-screen button says that full screen is not available there.
+
Notes work in full screen too: the card opens over the full-screen preview and takes typing, and Save writes the note. On a touch screen a finger drag draws a box like the mouse does, and a tap on Save saves it (tried in a windowed Chrome over the DevTools protocol, with touch emulated).
Two tabs on the same project can both take notes. A save names the notes the tab deleted instead of leaving them out, so notes made in the other tab are kept, and a new note whose number the other tab took first moves to the next free number, with its picture drawn again. After every save, and when a tab gets focus back, the page takes in the file's notes: the other tab's new ones, the ones it deleted, and done marks. Tried in a windowed Chrome over the DevTools protocol with two tabs: tab B's first note became 2 next to tab A's 1, each tab listed the other's notes after a focus change, a note deleted in B stayed deleted when A saved again, and every picture showed its own number. Two tabs editing the text of the same note still keep whichever saved last.
@@ -137,6 +139,12 @@ Each version has its own notes. The numbers run across all versions of the folde
`selection.json`, `selection.png` (from before notes) and `selection/` are in `.gitignore`.
+## On a phone
+
+Held upright, the viewer is one column that scrolls: the preview across the top, the play toolbar under it with the full-screen button at its end, the timeline, then the notes, the scenes and the audio, notes first. The side panel's toggle is not there, because the lists are on the page. The header shows the project and its version; the scene's name is on the timeline, and Export is its icon. The project, version and Export menus open across the width under the header. The open note's card sits across the bottom of the screen, above the keyboard while it types. Held sideways, the viewer keeps its two panes, with the side panel closed at first and floating over the preview when it opens.
+
+Checked in headless Chrome over the DevTools protocol with a phone emulated (touch, 2x pixels) at 390x844 and 360x740 upright and 844x390 and 740x360 sideways: no sideways scrolling, every menu inside the screen, and a box drawn with touch events opened its card inside the screen and saved the note. A real phone has not been tried.
+
## Export
The Export button in the top right renders the project. Pick 720p, 1080p, 1440p or 4K and press the button under the list, which names the size it will make. The viewer's server runs the same render as `motlab render` and streams the log back to the page; the log also appears in the terminal. The file is written to `out/<folder>-<resolution>.mp4` in the project folder, for example `example/out/example-1080p.mp4`, or `out/<folder>-<version>-<resolution>.mp4` for another version, and the Open link opens it. The resolution in the name is the short side of the frame: 4K is written as `-2160p`. Only one export runs at a time.
diff --git a/src/editor.html b/src/editor.html
index f3084a8..0fe400d 100644
--- a/src/editor.html
+++ b/src/editor.html
@@ -80,12 +80,12 @@
buttons, the range bar and the full-screen pill are left out. The bar is hidden ('bar-off') unless the pointer is near
the bottom edge, so it covers nothing while the frame is looked at */
#dock { display: contents; }
- #scrubWrap, #fsScene, #fullExit { display: none; }
+ #scrubWrap, #fsScene, #fullExit, #fullBar { display: none; }
#canvas:fullscreen { overflow: hidden; background: #111; }
#canvas:fullscreen #stage { position: absolute; inset: 0; padding: 0; }
- #canvas:fullscreen #dock { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; display: flex; flex-direction: column; padding: 6px 6px 4px;
+ #canvas:fullscreen #dock { position: absolute; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 3; display: flex; flex-direction: column; padding: 6px 6px 4px;
background: #fff; border: 1px solid var(--edge); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.12); transition: opacity var(--slide) var(--ease); }
- #canvas:fullscreen :is(#lane, #rangeBtn, #zout, #zin, #laneBtn, #rangeBar, #pillFull) { display: none; }
+ #canvas:fullscreen :is(#lane, #rangeBtn, #zout, #zin, #laneBtn, #rangeBar, #pillFull, #fullBar) { display: none; }
#canvas:fullscreen #scrubWrap { display: block; position: relative; }
#scrub { display: block; width: 100%; height: 34px; cursor: pointer; touch-action: none; }
#scrubTip { position: absolute; bottom: calc(100% + 2px); translate: -50% 0; padding: 4px 6px; border-radius: 6px; background: var(--text); color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none; }
@@ -182,7 +182,7 @@
.toast { position: absolute; top: 56px; left: 50%; transform: translate(-50%, 0); transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease), display var(--fast) allow-discrete; z-index: 5; max-width: calc(100% - 24px); padding: 8px 12px; border-radius: 8px; background: var(--text); color: #fff; font-size: 13px; }
/* menus */
- .menu { position: absolute; top: calc(100% + 6px); z-index: 10; min-width: 220px; padding: 6px; background: #fff; border: 1px solid var(--edge); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.12); font-weight: 400; }
+ .menu { position: absolute; top: calc(100% + 6px); z-index: 10; max-height: calc(100dvh - 56px); overflow-y: auto; min-width: 220px; padding: 6px; background: #fff; border: 1px solid var(--edge); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.12); font-weight: 400; }
.menu { transform-origin: top right; transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease), display var(--fast) allow-discrete; }
.menu[hidden], .toast[hidden] { display: none; opacity: 0; }
.menu[hidden] { transform: translateY(-4px) scale(.98); }
@@ -240,18 +240,48 @@
*, *::before { transition-duration: 0s !important; transition-delay: 0s !important; }
.spin { animation: none; border-color: var(--text); }
}
- /* narrow windows: the panel floats over the canvas instead of squeezing it */
- @media (max-width: 719px) {
+ /* short windows, as a phone held sideways: the panel floats over the canvas instead of squeezing it, and starts
+ closed; the preview takes the room the full-screen pill and the timeline leave */
+ @media (min-width: 720px) and (max-height: 499px) {
body, body.closed { grid-template-columns: 0 minmax(0, 1fr); }
aside { position: fixed; top: 44px; left: 0; bottom: 0; z-index: 30; width: min(320px, 85vw); box-shadow: 0 8px 28px rgba(0,0,0,.16); transition: visibility 0s, transform var(--slide) var(--ease); }
aside > * { width: auto; }
body.closed aside { opacity: 1; transform: translateX(-100%); transition: visibility 0s var(--slide), transform var(--slide) var(--ease); }
+ #stage { min-height: 0; padding: 8px 64px 6px; }
+ #lane { max-height: 28vh; }
+ }
+ /* phones held upright: one column that scrolls, in the order a review on a phone needs, as in Frame.io's app: the
+ preview at the top across the width, the play toolbar with full screen in it, the timeline, then the notes, the
+ scenes and the audio. The header keeps the project and its version, and Export shows its icon only. Menus open
+ across the width under the header, and the open note's card sits at the bottom of what is visible, above the
+ on-screen keyboard */
+ @media (max-width: 719px) {
+ html, body { height: auto; }
+ body { display: flex; flex-direction: column; min-height: 100%; }
+ header { position: sticky; top: 0; z-index: 25; min-height: 44px; background: #fff; }
+ main { order: 1; }
+ aside, body.closed aside { order: 2; visibility: visible; opacity: 1; overflow: visible; box-shadow: none; border-top: .5px solid #ececeb; }
+ aside > * { width: auto; }
+ #lists { display: flex; flex-direction: column; overflow: visible; }
+ #lists > h2:nth-of-type(3), #notes { order: -1; } /* the notes first */
+ #panel, #pillFull, #crumb, .sep:has(+ #crumb) { display: none; }
+ #canvas { overflow: visible; }
+ #stage { min-height: 0; padding: 8px 8px 0; }
+ #view { max-height: 62vh; }
+ #bar { margin: 10px 0; }
+ #fullBar { display: flex; }
+ #exportLabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
+ #export { padding: 0 8px; }
+ .menu, #projMenu, #verMenu, #exportMenu { position: fixed; top: 50px; left: 8px; right: 8px; width: auto; min-width: 0; max-width: none; translate: none; transform-origin: top center; }
+ .pop { width: auto; max-width: none; }
}
@media (pointer: coarse) {
.icon, .btn, .pick, .pill button, .row, .menu .opt, #go, #stop, #verGo, #verName, #popDel, #popDone, #popOk { min-height: 44px; }
.icon, .pill .sq { min-width: 44px; }
.pill { height: auto; }
}
+ /* the smallest phones (360 px): the toolbar's buttons give up 6 px each so it fits, still 38 by 44 px */
+ @media (max-width: 379px) { #tools .sq { min-width: 38px; } #tools { gap: 0; } #time { padding: 0 6px; } }
</style></head>
<body class="still">
<header>
@@ -311,6 +341,7 @@
<button class="sq" id="zout" data-i="zout" data-label="zoomOut" data-key="−"></button>
<button class="sq" id="zin" data-i="zin" data-label="zoomIn" data-key="+"></button>
<button class="sq" id="laneBtn" data-i="lane" data-label="hideTimeline" aria-expanded="true" aria-controls="lane"></button>
+ <button class="sq" id="fullBar" data-i="full" data-label="full" data-key="F"></button>
<button class="sq" id="fullExit" data-i="unfull" data-label="fullExit" data-key="F"></button>
</div>
<div class="pill" id="rangeBar" role="group" data-t="aria-label=range" hidden>
@@ -575,11 +606,12 @@ const setPanel = open => {
label($('panel'), L(open ? 'hidePanel' : 'showPanel'));
};
$('panel').onclick = () => setPanel(document.body.classList.contains('closed'));
-const narrow = matchMedia('(max-width: 719px)'); // a narrow window hides the panel, also when the window is made narrow later
+const narrow = matchMedia('(max-width: 719px), (max-height: 499px)'); // a narrow or short window hides the panel, also when it becomes one later
if (narrow.matches) setPanel(false);
narrow.addEventListener('change', e => { if (e.matches) setPanel(false); });
requestAnimationFrame(() => requestAnimationFrame(() => document.body.classList.remove('still'))); // animate from here on
-if (!document.fullscreenEnabled) { $('full').disabled = true; label($('full'), L('fullNone')); }
+if (!document.fullscreenEnabled) { $('full').disabled = true; label($('full'), L('fullNone')); $('fullBar').hidden = true; } // an iPhone has full screen for <video> only
+$('fullBar').onclick = () => $('full').click(); // the toolbar's full-screen button on a phone
$('full').onclick = () => { // some embedded browsers neither open full screen nor reject, so a silent wait also gets a message
if (document.fullscreenElement) return document.exitFullscreen();
let settled = false;
@@ -964,7 +996,8 @@ try {
$('scrub').setPointerCapture(e.pointerId); scrubbing = true; seek(scrubTime(e.offsetX));
};
$('scrub').onpointermove = e => { if (scrubbing) seek(scrubTime(e.offsetX)); scrubTip(e.offsetX); };
- $('scrub').onpointerup = $('scrub').onpointercancel = () => { scrubbing = false; };
+ $('scrub').onpointerup = $('scrub').onpointercancel = e => { scrubbing = false; if (e.pointerType === 'touch') flashBar(); };
+ $('dock').addEventListener('pointerdown', e => { if (e.pointerType === 'touch' && document.fullscreenElement) flashBar(); }); // a tap on the bar keeps it up
$('scrub').onpointerleave = () => { if (!scrubbing) $('scrubTip').hidden = true; };
new ResizeObserver(() => drawScrub()).observe($('scrub'));
addEventListener('keydown', e => {
@@ -1083,8 +1116,16 @@ try {
const pop = $('pop'), popText = $('popText');
const where = m => m.range ? `${L('range')} ${fmt(m.range.start)} ${L('to')} ${fmt(m.range.end)}` : L('sceneSecond', m.sceneIndex, m.sceneTime.toFixed(2)); // read out
const whereHTML = m => m.range ? `${L('range')} ${spanOf(m.range)}` : where(m); // shown
+ const phone = matchMedia('(max-width: 719px)');
function place() { // under the box or point, or above the range's tag on the timeline; kept inside the window
const el = $('marks').querySelector('.mk.on'), M = 12;
+ if (phone.matches && !document.fullscreenElement) { // a phone: across the bottom of what is visible, above the keyboard
+ const vv = visualViewport || { offsetLeft: 0, offsetTop: 0, width: innerWidth, height: innerHeight };
+ pop.style.left = vv.offsetLeft + 8 + 'px'; pop.style.width = vv.width - 16 + 'px';
+ pop.style.top = vv.offsetTop + vv.height - pop.offsetHeight - 8 + 'px';
+ return;
+ }
+ pop.style.width = '';
let r;
if (el) r = el.getBoundingClientRect();
else if (active?.range && !lane.hidden && lane.clientWidth) {
@@ -1097,6 +1138,7 @@ try {
// a range note sits above the timeline, so the range stays in view
pop.style.top = (el ? (below + h <= innerHeight - M ? below : Math.max(M, above)) : (above >= M ? above : below)) + 'px';
}
+ for (const ev of ['resize', 'scroll']) visualViewport?.addEventListener(ev, () => { if (!pop.hidden) place(); }); // the keyboard opening or closing
const grow = () => { popText.style.height = 'auto'; popText.style.height = Math.min(160, popText.scrollHeight + 2) + 'px'; };
function openNote(m) {
active = m; opening = null;
@@ -1310,15 +1352,19 @@ try {
// on a note opens it, and a click while a note is open only closes it.
view.onpointerdown = e => {
if (e.button !== 0 || !cur) return;
- if (playing) pause();
- if (document.fullscreenElement) { clearTimeout(barTimer); setBar(false); inZone = false; } // out of the way of a note near the bottom
+ // A finger has no pointer to rest near the bottom, so in full screen a tap there brings the player bar up instead of
+ // marking a point; a drag from there still draws a box.
+ const tapBar = !!document.fullscreenElement && e.pointerType === 'touch' && e.clientY >= innerHeight - ZONE;
+ if (playing && !tapBar) pause();
+ if (document.fullscreenElement && !tapBar) { clearTimeout(barTimer); setBar(false); inZone = false; } // out of the way of a note near the bottom
view.setPointerCapture(e.pointerId);
const edit = grab(e);
- drag = { a: onView(e), x: e.clientX, y: e.clientY, moved: false, open: !!active, ...(edit && { edit, m: active, from: { ...(active.box || active.point) } }) };
+ drag = { a: onView(e), x: e.clientX, y: e.clientY, moved: false, open: !!active, tapBar, ...(edit && { edit, m: active, from: { ...(active.box || active.point) } }) };
};
view.onpointermove = e => {
if (!drag) { view.style.cursor = CURSOR[grab(e)] || ''; return; } // over the open note: a move or resize cursor
if (!drag.moved && Math.hypot(e.clientX - drag.x, e.clientY - drag.y) < 4) return;
+ if (drag.tapBar && !drag.moved) { if (playing) pause(); clearTimeout(barTimer); setBar(false); } // a drag after all: a note
if (drag.edit) { drag.moved = true; reshape(drag, onView(e)); return paint(); }
if (!drag.moved) closeNote();
const a = drag.a, b = onView(e); drag.moved = true;
@@ -1328,6 +1374,7 @@ try {
view.onpointerup = () => {
if (!drag) return;
const d = drag; drag = null;
+ if (d.tapBar && !d.moved) return flashBar();
if (d.edit && d.moved) { // the note keeps its number and frame; its picture is drawn again
images.set(d.m.n, snapshot(d.m)); save(); place();
return popText.focus({ preventScroll: true });
diff --git a/src/editor.js b/src/editor.js
index 6486692..21ff50e 100644
--- a/src/editor.js
+++ b/src/editor.js
@@ -8,7 +8,7 @@
import { createServer } from 'node:http';
import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
import { homedir } from 'node:os';
-import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
+import { basename, dirname, isAbsolute, join, relative, sep } from 'node:path';
import { projectPaths, renderProject } from './project.js';
import { pageLib, sendFile } from './server.js';
diff --git a/src/probe.js b/src/probe.js
index 8069583..cb979f8 100644
--- a/src/probe.js
+++ b/src/probe.js
@@ -8,7 +8,7 @@ import { codecString, defaultBitrate } from './codecs.js';
const CANDIDATES = [{ codec: 'h264', hw: true }, { codec: 'h264', hw: false }, { codec: 'hevc', hw: true }, { codec: 'hevc', hw: false }];
// Constant QP values that keep SSIM against a lossless reference near 0.999 on the skill's 2D and 3D templates.
-export const DEFAULT_QP = { h264: 18, hevc: 20 };
+const DEFAULT_QP = { h264: 18, hevc: 20 };
export const label = c => `${c.codec === 'hevc' ? 'HEVC' : 'H.264'} ${c.hw ? 'hardware' : 'software'}`;
export const rate = c => c.rc === 'quantizer' ? `constant QP ${c.qp}` : `${(c.bitrate / 1e6).toFixed(1)} Mbit/s VBR`;
diff --git a/src/server.js b/src/server.js
index fd2b4de..43f3284 100644
--- a/src/server.js
+++ b/src/server.js
@@ -7,7 +7,7 @@ import { pipeline } from 'node:stream';
import { createRequire } from 'node:module';
import { dirname, extname, join, resolve, sep } from 'node:path';
-export const TYPES = {
+const TYPES = {
'.html': 'text/html', '.js': 'text/javascript', '.mjs': 'text/javascript', '.css': 'text/css', '.json': 'application/json',
'.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.webp': 'image/webp', '.avif': 'image/avif', '.gif': 'image/gif', '.svg': 'image/svg+xml',
'.ttf': 'font/ttf', '.otf': 'font/otf', '.woff': 'font/woff', '.woff2': 'font/woff2',
diff --git a/src/viewer.js b/src/viewer.js
index 1b35918..2267700 100644
--- a/src/viewer.js
+++ b/src/viewer.js
@@ -11,13 +11,13 @@ import { fileURLToPath } from 'node:url';
import { setTimeout as sleep } from 'node:timers/promises';
import { projectPaths } from './project.js';
-export const FIRST_PORT = 4173, LAST_PORT = 4190;
+const FIRST_PORT = 4173, LAST_PORT = 4190;
const BIN = fileURLToPath(new URL('../bin/motlab.js', import.meta.url));
-export const LOG = join(homedir(), '.motlab', 'viewer.log');
+const LOG = join(homedir(), '.motlab', 'viewer.log');
// The motlab viewer on this machine: { port, url, pid, workspace }, or null. pid and workspace are missing for a
// viewer from before motlab start existed.
-export async function findViewer() {
+async function findViewer() {
for (let port = FIRST_PORT; port <= LAST_PORT; port++) {
const r = await fetch(`http://127.0.0.1:${port}/__motlab/editor`, { signal: AbortSignal.timeout(800) }).then(r => r.json()).catch(() => null);
if (r?.motlab === 'editor') return { port, url: `http://127.0.0.1:${port}`, pid: r.pid, workspace: r.workspace };