(message, type = 'info')
| 290 | // ─── Toast Notifications ───────────────────────────────────────────────────── |
| 291 | |
| 292 | function showToast(message, type = 'info') { |
| 293 | const container = $('toastContainer'); |
| 294 | const toast = document.createElement('div'); |
| 295 | const colors = { |
| 296 | info: 'bg-slate-800 dark:bg-slate-200 text-white dark:text-slate-900', |
| 297 | success: 'bg-emerald-700 text-white', |
| 298 | error: 'bg-red-700 text-white' |
| 299 | }; |
| 300 | toast.className = `toast-enter pointer-events-auto px-4 py-2.5 rounded-lg text-sm font-medium shadow-lg ${colors[type] || colors.info}`; |
| 301 | toast.textContent = message; |
| 302 | container.appendChild(toast); |
| 303 | |
| 304 | setTimeout(() => { |
| 305 | toast.classList.remove('toast-enter'); |
| 306 | toast.classList.add('toast-exit'); |
| 307 | toast.addEventListener('animationend', () => toast.remove()); |
| 308 | }, 2800); |
| 309 | } |
| 310 | |
| 311 | // ─── Share ──────────────────────────────────────────────────────────────────── |
| 312 |
no test coverage detected