Created
August 17, 2024 02:19
-
-
Save SamSamskies/f0c8c9ac58db3c52d2fbc8f1a9d06b2e to your computer and use it in GitHub Desktop.
Revisions
-
SamSamskies created this gist
Aug 17, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ javascript:(function(){window.webln.sendPayment=(invoice)=>fetch(`https://api.qrserver.com/v1/create-qr-code/?data=${invoice}&size=400x400&margin=15`).then(response=>response.blob()).then(blob=>{const qrCodeUrl=URL.createObjectURL(blob);const modal=document.createElement('div');modal.style.position='fixed';modal.style.top='0';modal.style.left='0';modal.style.width='100%';modal.style.height='100%';modal.style.background='rgba(0, 0, 0, 0.5)';modal.style.display='flex';modal.style.justifyContent='center';modal.style.alignItems='center';const img=document.createElement('img');img.src=qrCodeUrl;img.style.width='400px';img.style.height='400px';modal.appendChild(img);document.body.appendChild(modal);modal.onclick=()=>{modal.remove();};});})();