feat: capture ctrl+u for git repo redirect

This commit is contained in:
Oliver Booth 2023-08-10 22:48:08 +01:00
parent cf2a5c2ffb
commit 086a8a665c
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61
2 changed files with 17 additions and 1 deletions

View File

@ -2,9 +2,24 @@ import API from "./API";
import UI from "./UI";
import Input from "./Input";
const pkg = require("../../package.json");
declare const Handlebars: any;
(() => {
let isCtrl = false;
document.addEventListener('keyup', (e) => {
if (e.ctrlKey) isCtrl = false;
});
document.addEventListener('keydown', (e) => {
if (e.ctrlKey) isCtrl = true;
if (isCtrl && e.key === "u") {
window.open(pkg.repository.url, "_blank");
return false;
}
});
Input.registerShortcut(Input.KONAMI_CODE, () => {
window.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ", "_blank");
});

View File

@ -1,6 +1,7 @@
{
"compilerOptions": {
"lib": ["ES2022", "DOM"],
"target": "ES2022"
"target": "ES2022",
"moduleResolution": "nodenext"
}
}