diff options
| author | kj-sh604 | 2025-01-14 18:26:30 -0500 |
|---|---|---|
| committer | kj-sh604 | 2025-01-14 18:26:30 -0500 |
| commit | b8340e5bc343cdfcb6e79566701de7e1086cb0d7 (patch) | |
| tree | 6356a3b0c8ff8431828c31fefade6fbab1ed1a81 | |
| parent | d51c7208693b7450428b6b0a6751b93b1baaeaf2 (diff) | |
refactor: add shiftKey event
| -rw-r--r-- | js/blur-navigation.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/js/blur-navigation.js b/js/blur-navigation.js index 6c3a2a9..75ee4ee 100644 --- a/js/blur-navigation.js +++ b/js/blur-navigation.js @@ -21,4 +21,4 @@ through which recipients can access the Corresponding Source. for the JavaScript code in this page. */ -let e,t;function o(){document.body.style.filter="",document.removeEventListener("keydown",o),document.removeEventListener("mousedown",o),t&&(t.removeEventListener("mousedown",o),t.remove())}document.querySelectorAll("a").forEach((n=>{n.addEventListener("click",(d=>{d.ctrlKey||d.metaKey||"_blank"===n.target||(document.body.style.filter="blur(5px)",document.addEventListener("keydown",o),document.addEventListener("mousedown",o),e=setTimeout((()=>{if("blur(5px)"===document.body.style.filter){t=document.createElement("div.prompt"),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.zIndex="1001",document.documentElement.appendChild(t);const e=document.createElement("div.prompt");e.textContent="Tap or click anywhere to disable blur",e.style.position="absolute",e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)",e.style.fontSize="24px",e.style.fontWeight="bold",e.style.color="white",e.style.backgroundColor="rgba(0, 0, 0, 0.5)",e.style.padding="20px",e.style.borderRadius="10px",e.style.zIndex="1002",t.appendChild(e),t.addEventListener("mousedown",o)}else clearTimeout(e)}),1024))}))})),window.addEventListener("beforeunload",(()=>{clearTimeout(e)})),window.addEventListener("pageshow",(e=>{if(e.persisted){document.body.style.filter="";const e=document.querySelector("div.prompt");e&&e.remove()}})); +let e,t;function o(){document.body.style.filter="",document.removeEventListener("keydown",o),document.removeEventListener("mousedown",o),t&&(t.removeEventListener("mousedown",o),t.remove())}document.querySelectorAll("a").forEach((n=>{n.addEventListener("click",(d=>{d.ctrlKey||d.metaKey||d.shiftKey||"_blank"===n.target||(document.body.style.filter="blur(5px)",document.addEventListener("keydown",o),document.addEventListener("mousedown",o),e=setTimeout((()=>{if("blur(5px)"===document.body.style.filter){t=document.createElement("div.prompt"),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.zIndex="1001",document.documentElement.appendChild(t);const e=document.createElement("div.prompt");e.textContent="Tap or click anywhere to disable blur",e.style.position="absolute",e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)",e.style.fontSize="24px",e.style.fontWeight="bold",e.style.color="white",e.style.backgroundColor="rgba(0, 0, 0, 0.5)",e.style.padding="20px",e.style.borderRadius="10px",e.style.zIndex="1002",t.appendChild(e),t.addEventListener("mousedown",o)}else clearTimeout(e)}),1024))}))})),window.addEventListener("beforeunload",(()=>{clearTimeout(e)})),window.addEventListener("pageshow",(e=>{if(e.persisted){document.body.style.filter="";const e=document.querySelector("div.prompt");e&&e.remove()}})); |
