ux: hide video ui + floor seekbar text

* hide lightbox buttons when a video is playing

* move audio seekbar text to the bottom, so it
   hides less of the waveform and minute-markers
This commit is contained in:
ed 2024-06-01 00:35:44 +00:00
parent 07b2bf1104
commit 60c96f990a
2 changed files with 13 additions and 7 deletions

View file

@ -743,6 +743,8 @@ window.baguetteBox = (function () {
image.volume = clamp(fcfg_get('vol', dvol / 100), 0, 1);
image.setAttribute('controls', 'controls');
image.onended = vidEnd;
image.onplay = function () { show_buttons(1); };
image.onpause = function () { show_buttons(); };
}
image.alt = thumbnailElement ? thumbnailElement.alt || '' : '';
if (options.titleTag && imageCaption)
@ -988,6 +990,12 @@ window.baguetteBox = (function () {
}
}
function show_buttons(v) {
clmod(ebi('bbox-btns'), 'off', v);
clmod(btnPrev, 'off', v);
clmod(btnNext, 'off', v);
}
function bounceAnimation(direction) {
slider.className = options.animation == 'slideIn' ? 'bounce-from-' + direction : 'eog';
setTimeout(function () {
@ -1051,10 +1059,8 @@ window.baguetteBox = (function () {
if (fx > 0.7)
return showNextImage();
clmod(ebi('bbox-btns'), 'off', 't');
clmod(btnPrev, 'off', 't');
clmod(btnNext, 'off', 't');
show_buttons('t');
if (Date.now() - ctime <= 500 && !IPHONE)
tglfull();

View file

@ -2047,8 +2047,8 @@ var pbar = (function () {
r.buf = canvas_cfg(ebi('barbuf'));
r.pos = canvas_cfg(ebi('barpos'));
r.buf.ctx.font = '.5em sans-serif';
r.pos.ctx.font = '1em sans-serif';
r.pos.ctx.strokeStyle = 'rgba(24,56,0,0.4)';
r.pos.ctx.font = '.9em sans-serif';
r.pos.ctx.strokeStyle = 'rgba(24,56,0,0.5)';
r.drawbuf();
r.drawpos();
if (!r.pos.can.onmouseleave)
@ -2214,7 +2214,7 @@ var pbar = (function () {
var m1 = pctx.measureText(t1),
m1b = pctx.measureText(t1 + ":88"),
m2 = pctx.measureText(t2),
yt = pc.h / 3 * 2.1,
yt = pc.h * 0.94,
xt1 = pc.w - (m1.width + 12),
xt2 = x < m1.width * 1.4 ? (x + 12) : (Math.min(pc.w - m1b.width, x - 12) - m2.width);