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:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user