-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
28 lines (26 loc) · 1.58 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function get_qr(){
var url = document.getElementById("qr-code").value;
var sizeOfCode = document.getElementById("size-of-code").value;
var borderOfCode = document.getElementById("border-of-code").value;
var bgColor = document.getElementById("bg-color").value;
var qrVersion = document.getElementById("qr-version").value;
if (url=='' || sizeOfCode=='' || borderOfCode=='' || bgColor=='' || qrVersion==''){
document.getElementById("warning-sign").style.display = 'block';
} else {
document.getElementById("theImage").src = `https://salambae.pythonanywhere.com/api/v1/qr-code-generator?url=${url}&size=${sizeOfCode}&border=${borderOfCode}&background=${bgColor}&ver=${qrVersion}`;
document.getElementById("linkDownload").href = `https://salambae.pythonanywhere.com/api/v1/qr-code-generator?url=${url}&size=${sizeOfCode}&border=${borderOfCode}&background=${bgColor}&ver=${qrVersion}`;
document.getElementById("theImage").style.display = 'block';
document.getElementById("linkDownload").style.display = 'block';
document.getElementById("warning-sign").style.display = 'none';
}
}
function reset() {
document.getElementById("qr-code").value = "";
document.getElementById("size-of-code").value = "";
document.getElementById("border-of-code").value = "";
document.getElementById("bg-color").value = "";
document.getElementById("qr-version").value = "";
document.getElementById("theImage").style.display = 'none';
document.getElementById("linkDownload").style.display = 'none';
document.getElementById("warning-sign").style.display = 'none';
}