diff --git a/htdocs/assets/js/keybinding-config.js b/htdocs/assets/js/keybinding-config.js new file mode 100644 index 0000000..9196893 --- /dev/null +++ b/htdocs/assets/js/keybinding-config.js @@ -0,0 +1,31 @@ +let pressedKeys = {}; + +document.addEventListener('keydown', function(event) { + pressedKeys[event.key] = true; + + if (pressedKeys['n'] && pressedKeys['h']) { + window.location.href = basePath; + } + else if (pressedKeys['n'] && pressedKeys['p']) { + window.location.href = basePath + "/projects"; + } + else if (pressedKeys['n'] && pressedKeys['b']) { + window.location.href = basePath + "/blog"; + } + else if (pressedKeys['n'] && pressedKeys['c']) { + window.location.href = basePath + "/contact"; + } + else if (pressedKeys['q'] && pressedKeys['e']) { + window.location.href = "mailto:hey@neosubhamoy.dev"; + } + else if (pressedKeys['q'] && pressedKeys['m']) { + window.location.href = "#"; + } + else if (pressedKeys['q'] && pressedKeys['s']) { + window.location.href = "#"; + } +}); + +document.addEventListener('keyup', function(event) { + pressedKeys[event.key] = false; +}); \ No newline at end of file diff --git a/htdocs/blog.php b/htdocs/blog.php index 2f033dd..eff4bf6 100644 --- a/htdocs/blog.php +++ b/htdocs/blog.php @@ -26,5 +26,6 @@ require 'core/query_functions.php'; + \ No newline at end of file diff --git a/htdocs/contact.php b/htdocs/contact.php index a67b0dc..9c1cc04 100644 --- a/htdocs/contact.php +++ b/htdocs/contact.php @@ -23,5 +23,6 @@ require 'core/query_functions.php'; + \ No newline at end of file diff --git a/htdocs/home.php b/htdocs/home.php index 63b9c96..03a02d3 100644 --- a/htdocs/home.php +++ b/htdocs/home.php @@ -216,6 +216,7 @@ require 'core/query_functions.php'; + + \ No newline at end of file