diff --git a/copyparty/web/baguettebox.js b/copyparty/web/baguettebox.js
index 8daf7516..212eaefc 100644
--- a/copyparty/web/baguettebox.js
+++ b/copyparty/web/baguettebox.js
@@ -28,7 +28,7 @@ window.baguetteBox = (function () {
onChange: null,
readDirRtl: false,
},
- overlay, slider, btnPrev, btnNext, btnHelp, btnAnim, btnRotL, btnRotR, btnSel, btnFull, btnZoom, btnVmode, btnReadDir, btnClose,
+ overlay, slider, btnPrev, btnNext, btnHelp, btnAnim, btnRotL, btnRotR, btnSel, btnFull, btnZoom, btnPixelated, btnVmode, btnReadDir, btnClose,
currentGallery = [],
currentIndex = 0,
isOverlayVisible = false,
@@ -310,8 +310,9 @@ window.baguetteBox = (function () {
'
' +
'
✕' +
'
' +
- '
↕' +
'
⛶' +
+ '
↕' +
+ '
👾' +
'
☑️sel' +
'
↷' +
'
↶' +
@@ -335,10 +336,12 @@ window.baguetteBox = (function () {
btnSel = ebi('bbox-tsel');
btnFull = ebi('bbox-full');
btnZoom = ebi('bbzoom');
+ btnPixelated = ebi('bbpixelated');
btnVmode = ebi('bbox-vmode');
btnClose = ebi('bbox-close');
bcfg_bind(options, 'bbzoom', 'bbzoom', false, setzoom);
+ bcfg_bind(options, 'bbpixelated', 'bbpixelated', false, setpixelated);
setzoom();
}
@@ -356,6 +359,7 @@ window.baguetteBox = (function () {
['R', 'rotate (shift=ccw)'],
['F', 'toggle fullscreen'],
['Z', 'toggle zoom/stretch'],
+ ['X', 'toggle pixelated rendering'],
['S', 'toggle file selection'],
['space, P, K', 'video: play / pause'],
['U', 'video: seek 10sec back'],
@@ -440,6 +444,8 @@ window.baguetteBox = (function () {
tglfull();
else if (kl == "z")
btnZoom.click();
+ else if (kl == "x")
+ btnPixelated.click();
else if (kl == "s")
tglsel();
else if (kl == "r")
@@ -553,6 +559,12 @@ window.baguetteBox = (function () {
btnState(btnZoom, sel);
}
+ function setpixelated() {
+ var sel = clgot(btnPixelated, 'on')
+ clmod(ebi('bbox-overlay'), 'pixelated', sel);
+ btnState(btnPixelated, sel);
+ }
+
function tglsel() {
var o = findfile()[3];
clmod(o.closest('tr'), 'sel', 't');
diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css
index d0f03b26..387f13df 100644
--- a/copyparty/web/browser.css
+++ b/copyparty/web/browser.css
@@ -2521,6 +2521,17 @@ html.noscroll .sbar::-webkit-scrollbar {
height: 100%;
object-fit: contain;
}
+#bbox-overlay:has(video) {
+ #bbox-next,
+ #bbox-prev {
+ height: 0;
+ }
+}
+#bbox-overlay.pixelated .full-image img,
+#bbox-overlay.pixelated .full-image video {
+ -ms-interpolation-mode: nearest-neighbor;
+ image-rendering: pixelated;
+}
html.bb_fsc .full-image img,
html.bb_fsc .full-image video {
max-height: 100%;
@@ -2539,6 +2550,12 @@ html.bb_fsc figcaption {
.full-image video {
background: #222;
}
+#bbox-overlay figcaption {
+ pointer-events: none;
+}
+#bbox-overlay figcaption * {
+ pointer-events: all;
+}
.full-image figcaption {
display: block;
position: fixed;