diff --git a/src/main/resources/static/qr-scanner.html b/src/main/resources/static/qr-scanner.html index 8ff5ab8f2143b1cd4f5b4bb8e9557ef9cd607d1e..5e273537577b03541cdc3f4833df7f3b2bec8bf1 100644 --- a/src/main/resources/static/qr-scanner.html +++ b/src/main/resources/static/qr-scanner.html @@ -4,10 +4,10 @@ <head> <meta charset="UTF-8"> <meta name="viewpoint" content="width-device-width, initial-scale=1.0"> - <link rel="stylesheet" href="qrstyle.css"> + <link rel="stylesheet" href="css/qrstyle.css"> + <script src="https://unpkg.com/html5-qrcode"> </script> + <script src="scripts/qr-script.js"></script> <title>QR Code</title> - <script th:src="@{https://unpkg.com/html5-qrcode}" type="text/javascript"></script> - <script th:src="@{scripts/qr-script.js}" class="domReady"></script> </head> <body> @@ -18,6 +18,5 @@ </div> </div> </div> - </body> </html> diff --git a/src/main/resources/static/scripts/qr-script.js b/src/main/resources/static/scripts/qr-script.js index 324040794cfcdf7503f5e2485174c27ab7b13b60..6eed85dd3eaf029a9b8d4dc676930c3f0922feb7 100644 --- a/src/main/resources/static/scripts/qr-script.js +++ b/src/main/resources/static/scripts/qr-script.js @@ -14,13 +14,13 @@ function domReady(fn){ } domReady(function (){ //if QR code found - function onQRSuccess(decodeText, decodeResult){ + function onScanSuccess(decodeText, decodeResult){ alert("You have collected: " + decodeText, decodeResult); } -let htmlscanner = new Html5QrcodeScanner( + let htmlscanner = new Html5QrcodeScanner( "qr-code-reader", - { fps: 10, qrbos: 250} -) - htmlscanner.render(onQRSuccess); + { fps: 20, qrbos: 250} + ); + htmlscanner.render(onScanSuccess); });