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

(feat): made the qrcode and pageinputlink dynamic

This commit is contained in:
2023-11-25 21:30:31 +05:30
parent 21ab49f970
commit 12b4c9b0a4
2 changed files with 11 additions and 2 deletions

View File

@@ -12,6 +12,8 @@ const searchWin = document.getElementById("searchwindow");
const shareWin = document.getElementById("sharewindow");
const searchDef = document.getElementById("defresults");
const searchRes = document.getElementById("searchresults");
const qrCode = document.getElementById("pageqrcode");
const linkInput = document.getElementById("pageurlinput");
const basePath = document.getElementById('phpHostBasePath').dataset.basePath;
let lastScrollTop = 0;
@@ -302,6 +304,10 @@ searchInput.addEventListener('input', function() {
//---share window config starts here
function activate_share() {
//create qrcode of the current page link
qrCode.src = "https://api.qrserver.com/v1/create-qr-code/?data=" + window.location.href + "&color=38BDF8&bgcolor=0F172A";
//change pageUrlInput value to current page
linkInput.value = window.location.href;
windowWrapper.classList.remove("hidden");
windowWrapper.classList.add("flotingbar-window-wrapper-show");
shareBtn.classList.add("hidden");
@@ -324,4 +330,4 @@ shareBtn.addEventListener("click", function () {
shareCloseBtn.addEventListener("click", function () {
close_share();
});
});