summaryrefslogtreecommitdiff
path: root/web/js/keyboard.js
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-05 23:07:35 +0300
committerPaul Buetow <paul@buetow.org>2026-05-05 23:07:35 +0300
commit69a3a88b85ed0a56bf442af4fec420c871d337fa (patch)
treeb1c01a820454cb43fe5f9ecf8c3af1f250a1b534 /web/js/keyboard.js
parentf96c13de4828a3d531f4dc62f63ba571542c3ece (diff)
Add fullscreen crop mode toggle (hotkey c)
- In fullscreen, press 'c' to toggle object-fit between contain (default) and fill (stretches to fill, no aspect ratio preservation). - Adds .player.crop-mode video { object-fit: fill; } in player.css. - Adds toggleCrop() in player.js that toggles a crop-mode class and a small UI indicator (✂️) in the controls, visible only in fullscreen. - Resets crop mode back to contain when exiting fullscreen (via Escape, minimize, or fullscreenchange event). - Wires the 'c' hotkey in keyboard.js and registers toggleCrop in app.js. - Adds crop-indicator to index.html and detach.html controls, and documents the shortcut in the help modal.
Diffstat (limited to 'web/js/keyboard.js')
-rw-r--r--web/js/keyboard.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/web/js/keyboard.js b/web/js/keyboard.js
index 951e573..dc3eb4e 100644
--- a/web/js/keyboard.js
+++ b/web/js/keyboard.js
@@ -214,6 +214,7 @@ export function initKeyboard(handlers) {
break;
case 'C': handlers.toggleMinimize?.(e); break;
case 'f': handlers.fullscreen?.(e); break;
+ case 'c': handlers.toggleCrop?.(e); break;
case 'Escape': handlers.escape?.(e); break;
case 'Backspace': handlers.backspace?.(e); break;
case 'r': handlers.shuffle?.(e); break;