From f2b14739e3da93250167dc746e28700ac8b9b39f Mon Sep 17 00:00:00 2001 From: x Date: Sat, 24 Jan 2026 11:24:00 +0100 Subject: [PATCH] lights on/off play/pause hotkeys (re)added --- public/s/js/f0ck.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/public/s/js/f0ck.js b/public/s/js/f0ck.js index 493adb8..75c7b05 100644 --- a/public/s/js/f0ck.js +++ b/public/s/js/f0ck.js @@ -44,12 +44,14 @@ window.requestAnimFrame = (function () { if (elem = document.querySelector("#my-video")) { video = new v0ck(elem); + /* Listener moved to global keybindings document.addEventListener("keydown", e => { if (e.key === " " && e.target.tagName !== "INPUT" && e.target.tagName !== "TEXTAREA") { video[video.paused ? 'play' : 'pause'](); document.querySelector('.v0ck_overlay').classList[video.paused ? 'remove' : 'add']('v0ck_hidden'); } }); + */ @@ -515,7 +517,20 @@ window.requestAnimFrame = (function () { "ArrowRight": clickOnElementBinding("#prev"), "d": clickOnElementBinding("#prev"), "r": clickOnElementBinding("#random, #nav-random"), - " ": clickOnElementBinding("#f0ck-image") + "l": () => { + const toggle = document.querySelector("#togglebg"); + if (toggle) toggle.click(); + }, + " ": () => { + if (video && typeof video.play === 'function') { // Check if video wrapper exists/is valid + video[video.paused ? 'play' : 'pause'](); + const overlay = document.querySelector('.v0ck_overlay'); + if (overlay) overlay.classList[video.paused ? 'remove' : 'add']('v0ck_hidden'); + } else { + const img = document.querySelector("#f0ck-image"); + if (img) img.click(); + } + } }; document.addEventListener("keydown", e => { if (e.key in keybindings && e.target.tagName !== "INPUT" && e.target.tagName !== "TEXTAREA") {