aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-22 09:23:47 -0700
committerAdam Soltys <[email protected]>2026-10-22 09:23:47 -0700
commit178842f26f9fce19e9148cbb9f0e9f1aed9131f7 (patch)
tree60fc5a576345b5b1c31de8fff4d64a4f71a14863 /src/features
parentf3a3d88c7d5a86ae1fa06cf23932631eaa050151 (diff)
downloadcoinosv3-178842f26f9fce19e9148cbb9f0e9f1aed9131f7.tar.gz
coinosv3-178842f26f9fce19e9148cbb9f0e9f1aed9131f7.zip
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 <[email protected]>
Diffstat (limited to 'src/features')
-rw-r--r--src/features/messages.js15
1 files changed, 13 insertions, 2 deletions
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;