Last active
July 11, 2022 12:58
-
-
Save enricobottazzi/9d31cafe2a1841dbe6acb9f079957e94 to your computer and use it in GitHub Desktop.
Create QR Code
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
// el is the HTML DOM element into which the generated QR Code will be added | |
// data is the auth reponse (or any information) that has to be rendered inside the QR Code | |
function makeQr(el, data) { | |
return new QRCode(el, { | |
text: JSON.stringify(data), | |
width: 300, | |
height: 300, | |
colorDark: "#000", | |
colorLight: "#e9e9e9", | |
correctLevel: QRCode.CorrectLevel.H | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment