Skip to content
Snippets Groups Projects
Commit 5e964a18 authored by Rhys Nute's avatar Rhys Nute
Browse files

minor changes

parent d61c6ddf
No related branches found
No related tags found
1 merge request!27Qr codes
......@@ -6,7 +6,7 @@
<meta name="viewpoint" content="width-device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/qrstyle.css">
<script src="https://unpkg.com/html5-qrcode"></script>
<script type="module" src="scripts/qr-script.js"></script>
<script type="module" src="scripts/qr-script.mjs"></script>
<title>QR Code</title>
</head>
......
//qr-script file - R Nute
import {Html5QrcodeScanner} from "html5-qrcode";
function domReady(fn){
if (
......
//qr-script file - R Nute
import {Html5QrcodeScanner} from "html5-qrcode";
function domReady(fn){
if (
document.readyState === "complete" ||
document.readyState === "interactive"
){
setTimeout(fn, 1000);
} else {
document.addEventListener("DOMContentLoaded", fn);
}
}
domReady(function (message){
//if QR code found
function onScanSuccess(decodeText, decodeResult){
alert("You have collected: " + decodeText, decodeResult);
}
let htmlscanner = new Html5QrcodeScanner(
"qr-code-reader",
{ fps: 20, qrbos: 250}
);
htmlscanner.render(onScanSuccess);
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment