From 178842f26f9fce19e9148cbb9f0e9f1aed9131f7 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 22 Oct 2026 09:23:47 -0700 Subject: Videos on a desktop: moving the mouse over a playing clip brings the seek bar up, and it fades about 2 s after the mouse goes still (it stays while the pointer rests on the bar) Co-Authored-By: Claude Opus 5.5 --- src/features/messages.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/features') diff --git a/src/features/messages.js b/src/features/messages.js index d09ad83..7be3630 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -14538,10 +14538,12 @@ export function messagesFeature(ctx) { // bar's alone, never the pager's swipe or its tap. const clock = (t) => { t = Math.max(0, Math.floor(t || 0)); const m = Math.floor(t / 60), x = t % 60; return m + ':' + String(x).padStart(2, '0'); }; // up for a few seconds, and on while a finger is on it - function revealSeek(bar) { + // (a mouse brings it up by moving, so it goes sooner once the mouse is + // still, and stays while the pointer rests on the bar itself) + function revealSeek(bar, ms = 3500) { bar.classList.add('reveal'); clearTimeout(bar._hide); - bar._hide = setTimeout(() => { if (bar._drag) revealSeek(bar); else bar.classList.remove('reveal'); }, 3500); + bar._hide = setTimeout(() => { if (bar._drag || bar._hover) revealSeek(bar, ms); else bar.classList.remove('reveal'); }, ms); } // What was said, reacted or zapped at a moment of the clip sits over the // bar at that moment (a tap goes there and says who and what), and floats @@ -14551,6 +14553,8 @@ export function messagesFeature(ctx) { const time = h('span', { class: 'mp-seek-time' }); const marks = h('div', { class: 'mp-marks' }); const bar = h('div', { class: 'mp-seek' }, marks, h('div', { class: 'mp-seek-track' }, fill), time); + bar.addEventListener('pointerenter', (e) => { if (e.pointerType === 'mouse') bar._hover = true; }); + bar.addEventListener('pointerleave', () => { bar._hover = false; }); let items = [], sig = '', checked = 0, last = 0; const say = (x) => { time.textContent = clock(x.moment.seconds) + ' ' + x.text; @@ -15358,6 +15362,13 @@ export function messagesFeature(ctx) { else if (Date.now() - tapDoneAt < 700) { e.stopPropagation(); e.preventDefault(); } }, true); el.addEventListener('click', (e) => pagerTap(e.target, e.clientY)); + // On a desktop the bar comes up while the mouse moves over a playing + // clip and fades once it's been still a moment (Adam, 2026-10-22). + el.addEventListener('pointermove', (e) => { + if (e.pointerType !== 'mouse' || !pager || !video) return; + const bar = pager.cur && pager.cur.querySelector('.mp-seek.ready'); + if (bar) revealSeek(bar, 2000); + }); // a tap shows (or hides) who posted it and what they said function pagerTap(target, y) { if (target.closest('button, a, .mp-caption, .mp-seek')) return; -- cgit v1.2.3