This commit is contained in:
Mateusz Gruszczyński
2026-09-16 11:27:36 +02:00
parent 0d73844f23
commit 0bd33958da
25 changed files with 269 additions and 207 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ function toast(message, error = false) {
const host = $('#toastStack'); if (!host) return;
const item = document.createElement('div');
item.className = `toast-item ${error ? 'error' : 'success'}`;
item.innerHTML = `<span class="toast-icon">${error ? '!' : '✓'}</span><div class="toast-copy"><strong>${esc(error ? tr('toast.errorTitle') : tr('toast.successTitle'))}</strong><span>${esc(message)}</span></div><button class="toast-close" type="button" aria-label="${esc(tr('actions.close'))}">×</button><i class="toast-progress"></i>`;
item.innerHTML = `<span class="toast-icon">${error ? '!' : uiIcon('check')}</span><div class="toast-copy"><strong>${esc(error ? tr('toast.errorTitle') : tr('toast.successTitle'))}</strong><span>${esc(message)}</span></div><button class="toast-close" type="button" aria-label="${esc(tr('actions.close'))}">${uiIcon('close')}</button><i class="toast-progress"></i>`;
host.appendChild(item);
requestAnimationFrame(() => item.classList.add('show'));
const remove = () => { item.classList.remove('show'); item.classList.add('leaving'); setTimeout(() => item.remove(), 220); };