Memperbaiki beberapa kesalahan
This commit is contained in:
+12
-4
@@ -314,10 +314,18 @@
|
||||
}
|
||||
|
||||
function showToast(msg, type = 'info') {
|
||||
const el = document.getElementById('toast');
|
||||
el.textContent = msg;
|
||||
el.className = 'show' + (type ? ' ' + type : '');
|
||||
setTimeout(() => { el.className = ''; }, 3000);
|
||||
const container = document.getElementById('toast');
|
||||
const toast = document.createElement('div');
|
||||
toast.className = `toast-item toast-${type}`;
|
||||
toast.textContent = msg;
|
||||
container.appendChild(toast);
|
||||
|
||||
setTimeout(() => {
|
||||
toast.style.opacity = '0';
|
||||
toast.style.transform = 'translateX(30px)';
|
||||
toast.style.transition = 'all 0.3s ease';
|
||||
setTimeout(() => toast.remove(), 300);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
|
||||
Reference in New Issue
Block a user