Files
hitstar/public/js/utils.js
Elmar Kresse 35b88c0b29
All checks were successful
Build and Push Docker Image / docker (push) Successful in 9s
refactor: Modularize JavaScript Code into Separate Files
2025-09-05 14:41:55 +02:00

16 lines
348 B
JavaScript

// Shared small utilities
export function showToast(msg) {
const el = document.getElementById('toast');
if (!el) return;
el.textContent = msg;
el.style.opacity = '1';
setTimeout(() => {
el.style.opacity = '0';
}, 1200);
}
export function wire(el, type, handler, options) {
if (el) el.addEventListener(type, handler, options);
}