Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
martinius96 authored Oct 29, 2023
1 parent c349862 commit 1d466ad
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docs/AR/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,21 @@ <h1 id="text-content" style="color: white; font-size: 48px;">HELLO WORLD</h1>
lastQRScanTime = Date.now();
}

let textOverlayTimeout;

scanner.addListener('scan', function (content) {
if (content.startsWith("https://arduino.clanweb.eu/studna_s_prekladom/full_vypis.php")) {
document.getElementById('qr-result').textContent = content;
updateLastQRScanTime(); // Aktualizovat čas posledního skenování QR kódu
showTextOverlay();

// Resetovat interval pro skrytí textu
clearTimeout(textOverlayTimeout);
textOverlayTimeout = setTimeout(hideTextOverlay, 5000);
} else {
document.getElementById('qr-result').textContent = "Invalid QR Code";
hideTextOverlay();
}

// Zobrazit text "HELLO WORLD" bez ohledu na stav načítání
showTextOverlay();

// Skrýt text po 5 sekundách od posledního skenování QR kódu
clearTimeout(window.textOverlayTimeout);
window.textOverlayTimeout = setTimeout(hideTextOverlay, 5000);
});

Instascan.Camera.getCameras().then(function (cameras) {
Expand Down

0 comments on commit 1d466ad

Please sign in to comment.