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:
@@ -112,7 +112,10 @@
|
||||
</div>
|
||||
<div class="extrashareopt w-full h-full flex flex-col items-center py-3 px-7 border-l-[1px] border-[rgba(255,_255,_255,_0.15)]">
|
||||
<p class="self-start text-lg"><i class="fa-solid fa-user-group text-accent_primary"></i> Sharing Options</p>
|
||||
<div class="urlinputbar w-full flex justify-between items-center py-2 px-3 my-3 bg-bg_primary rounded-full overflow-hidden"><input id="urlinput" class="w-[85%] bg-bg_primary caret-accent_primary text-accent_four font-[300] outline-none" type="text" value="https://localhost/neosubhamoy/htdocs/" readonly><button class="urlcopybtn px-3 border-l-[1px] border-accent_secondary_transparent" title="Copy link"><i class="fa-regular fa-copy"></i></button></div>
|
||||
<div class="urlinputbar w-full flex justify-between items-center py-2 px-3 my-3 bg-bg_primary rounded-full overflow-hidden">
|
||||
<input id="pageurlinput" class="w-[85%] bg-bg_primary caret-accent_primary text-accent_four font-[300] outline-none" type="text" value="https://neosubhamoy.dev" readonly>
|
||||
<button class="urlcopybtn px-3 border-l-[1px] border-accent_secondary_transparent" title="Copy link"><i class="fa-regular fa-copy"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="floating-bar" class="fixed inset-x-0 bottom-[7vh] z-[50] flex justify-center items-center">
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user