QRMaker/script.js
Kumi a2335a7082
feat: add initial version of QRMaker web app
Introduced QRMaker, a simple web app for generating QR codes from user input. Key features include real-time QR code generation, multi-line input, and responsive design using Bootstrap. Added initial project setup with HTML, CSS, JS, and a README for setup and usage instructions.
2024-09-07 20:00:43 +02:00

22 lines
No EOL
545 B
JavaScript

document.addEventListener('DOMContentLoaded', function () {
const textInput = document.getElementById('text-input');
const qrCodeContainer = document.getElementById('qrcode');
const qrCode = new QRCode(qrCodeContainer, {
text: "",
width: 256,
height: 256,
});
function updateQRCode() {
const text = textInput.value;
qrCode.clear();
if (text) {
qrCode.makeCode(text);
}
}
textInput.addEventListener('input', updateQRCode);
updateQRCode();
});