The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import "./style.css"; |
| 2 | |
| 3 | let count = 0; |
| 4 | const counter = document.querySelector<HTMLButtonElement>("#counter")!; |
| 5 | counter.addEventListener("click", () => { |
| 6 | counter.textContent = `count: ${++count}`; |
| 7 | }); |
| 8 | |
| 9 | const greeting = document.querySelector<HTMLElement>("#greeting")!; |
| 10 | document.querySelector("#load-greeting")!.addEventListener("click", async () => { |
| 11 | try { |
| 12 | const response = await fetch("/example.json"); |
| 13 | if (!response.ok) throw new Error(`HTTP ${response.status}`); |
| 14 | const body = (await response.json()) as { greeting: string }; |
| 15 | greeting.textContent = body.greeting; |
| 16 | } catch { |
| 17 | greeting.textContent = "Could not load the greeting. Try again."; |
| 18 | } |
| 19 | }); |