1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-20 01:09:35 +05:30

(feat): added ALT + L keyboard shotcut for share window

This commit is contained in:
2023-11-28 22:02:09 +05:30
parent 1871e73532
commit 9f38c081d9

View File

@@ -90,6 +90,7 @@ closeBtn.addEventListener("click", function () {
document.addEventListener("keydown", function(event) { document.addEventListener("keydown", function(event) {
if (event.key === "Escape") { if (event.key === "Escape") {
close_search(); close_search();
close_share();
} }
}); });
@@ -342,6 +343,13 @@ shareCloseBtn.addEventListener("click", function () {
close_share(); close_share();
}); });
// when ALT + L shortcut key is pressed
document.addEventListener("keydown", function(event) {
if (event.altKey && event.key === "l") {
activate_share();
}
});
// function to share with webShareAPI (Native OS Share) // function to share with webShareAPI (Native OS Share)
function call_webshare_api() { function call_webshare_api() {
if(navigator.share) { if(navigator.share) {