-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
32 lines (31 loc) · 1008 Bytes
/
index.html
File metadata and controls
32 lines (31 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Lit + TS</title>
<link rel="stylesheet" href="./src/index.css" />
<script type="module" src="/src/QRCodeWebC.ts"></script>
</head>
<body>
<div style="margin-bottom: 12px;">
<label for="qr-code">Insert the text:</label>
<input type="text" id="url-input" />
</div>
<div>
<qrcode-webc value="some-code" id="qr-code">
<h1>Vite + Lit</h1>
</qrcode-webc>
</div>
<script>
document.addEventListener("DOMContentLoaded", () => {
const qrcode = document.getElementById("qr-code");
const inputEl = document.getElementById("url-input");
inputEl.addEventListener("change", (e) => {
qrcode.setAttribute("value", e.currentTarget.value);
});
});
</script>
</body>
</html>