rebase www template

This commit is contained in:
2026-04-27 11:45:33 +02:00
parent 07bc5ffd9f
commit a42f1b87e9
27 changed files with 2574 additions and 4615 deletions
+21
View File
@@ -0,0 +1,21 @@
export const API = '/api';
export function setupCopyBtn(btn, getText) {
if (!btn) return;
btn.addEventListener('click', () => {
const text = getText();
if (!text) return;
navigator.clipboard.writeText(text).then(() => {
const orig = btn.textContent;
btn.textContent = '✓ copied';
btn.classList.add('copied');
setTimeout(() => { btn.textContent = orig; btn.classList.remove('copied'); }, 1500);
}).catch(() => {});
});
}
export function showError(el, msg) {
if (!el) return;
el.textContent = msg ? `Error: ${msg}` : '';
el.classList.toggle('hidden', !msg);
}