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

(feat): added custom qr code loading delay spinner

This commit is contained in:
2023-12-04 22:28:39 +05:30
parent 6ab0cecc3e
commit 1d600c7fd7
2 changed files with 13 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ const shareWin = document.getElementById("sharewindow");
const searchDef = document.getElementById("defresults");
const searchRes = document.getElementById("searchresults");
const spinner = document.getElementById("spinnercont");
const spinnerQr = document.getElementById("qrspinnercont");
const qrCode = document.getElementById("pageqrcode");
const linkInput = document.getElementById("pageurlinput");
const embedCode = document.getElementById("embedcodetag");
@@ -352,6 +353,7 @@ function activate_share() {
shareCloseBtn.classList.remove("hidden");
shareWin.classList.add("floatingshare-window-show");
document.body.classList.add("overflow-hidden");
show_qr_loading_delay(); //show qrcode loading delay spinner
}
// function to close the share window
@@ -394,6 +396,15 @@ document.addEventListener("keydown", function(event) {
}
});
// custom qr loading delay spinner
function show_qr_loading_delay() {
setTimeout(() => {
spinnerQr.classList.remove("flex");
spinnerQr.classList.add("hidden");
qrCode.classList.remove("hidden");
}, 2000);
}
// function to share with webShareAPI (Native OS Share)
function call_webshare_api() {
if(navigator.share) {