-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d5f6e5
commit 602d6e2
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="viewport" content="initial-scale=1, maximum-scale=1"> | ||
<title>Convert you crypto addres to qr and share link</title> | ||
<meta name="keywords" content="crypto, link, qr"> | ||
<meta name="description" content="Convert crypto addres to link"> | ||
<meta name="author" content="Lex Petrenko"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> | ||
</head> | ||
<body> | ||
<div class="content d-flex vh-100 justify-content-center align-items-center flex-column"> | ||
<div id="qr" class="d-content" style="max-width:90%"> | ||
<h2 class="text-center mb-2">Donate coins</h2> | ||
<div class="border border-dark rounded-3 p-2"> | ||
<img class="w-100 h-auto" style="max-width: 300px;" src="https://chart.googleapis.com/chart?cht=qr&chl=https://linktr.ee/petrolex&chs=300x300&choe=UTF-8&chld=L|2"> | ||
</div> | ||
<p class="text-center text-secondary p-2 text-break"></p> | ||
</div> | ||
</div> | ||
</body> | ||
<script> | ||
document.addEventListener("DOMContentLoaded", () => { | ||
var pay = (getCoin().length != 0) ? getCoin() : 'https://linktr.ee/petrolex'; | ||
var url = 'https://chart.googleapis.com/chart?cht=qr&chl='+pay+'&chs=300x300&choe=UTF-8&chld=L|2'; | ||
document.querySelector('#qr img').src = url; | ||
document.querySelector('#qr p').textContent= pay; | ||
if (getQ().title) document.querySelector('#qr h2').textContent = decodeURI(getQ().title); | ||
}); | ||
|
||
function getQ() { | ||
var qs = window.location.search.substring(1); | ||
var qsa = qs.split('&'); | ||
var $q =[]; | ||
qsa.forEach(e => { | ||
if( e.search('=') > 0 ) { | ||
var se = e.split('='); | ||
$q[se[0]]=se[1]; | ||
} | ||
}); | ||
return (Object.keys($q).length==0) ? qs : $q; | ||
} | ||
|
||
function getCoin() { | ||
var get = getQ(); | ||
if(!get.addr) return get; | ||
var coin = (get.type) ? get.type+':'+get.addr : get.addr; | ||
return (get.amount) ? coin+'?='+get.amount : coin; | ||
} | ||
</script> | ||
</html> |