Update index.html

This commit is contained in:
ErikrafT 2025-04-12 10:46:28 -03:00 committed by GitHub
parent fb940c813a
commit e69f00906e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 0 deletions

View File

@ -969,6 +969,7 @@
document.addEventListener("DOMContentLoaded", function () {
const resultInput = document.getElementById("result");
const qrCodeDialog = document.querySelector(".app__dialog");
const qrReader = document.getElementById('qr-reader'); // Referência ao leitor de QR code
const qrCodeScanner = new Html5Qrcode("qr-reader");
@ -1002,6 +1003,20 @@
document.querySelector(".app__dialog-close").addEventListener("click", () => {
qrCodeDialog.classList.add("app__dialog--hide");
});
// Função para mostrar o leitor
function showQRReader() {
qrReader.style.display = 'block';
}
// Função para esconder o leitor
function hideQRReader() {
qrReader.style.display = 'none';
}
// Exemplo de uso
document.getElementById('show-reader-button').addEventListener('click', showQRReader);
document.getElementById('hide-reader-button').addEventListener('click', hideQRReader);
});
</script>