tilfluktsrom/pwa/src/ui/status-bar.ts
Ole-Morten Duesund 3c1da8adec Legg til haptisk tilbakemelding på knappetrykk og listeval (#11)
Android: HapticFeedbackConstants.VIRTUAL_KEY på alle knappar og
listeelement. PWA: navigator.vibrate(10ms) på same interaksjonar.

Closes #11

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 10:01:58 +01:00

18 lines
482 B
TypeScript

/**
* Status bar: status text + refresh button.
*/
/** Update the status text. */
export function setStatus(text: string): void {
const el = document.getElementById('status-text');
if (el) el.textContent = text;
}
/** Set the refresh button click handler. */
export function onRefreshClick(handler: () => void): void {
const btn = document.getElementById('refresh-btn');
if (btn) btn.addEventListener('click', () => {
navigator.vibrate?.(10);
handler();
});
}