mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-19 18:13:01 +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) {
|
||||
if (event.key === "Escape") {
|
||||
close_search();
|
||||
close_share();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -342,6 +343,13 @@ shareCloseBtn.addEventListener("click", function () {
|
||||
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 call_webshare_api() {
|
||||
if(navigator.share) {
|
||||
|
||||
Reference in New Issue
Block a user