MCPcopy Create free account
hub / github.com/BrainicHQ/DoHSpeedTest / showToast

Function showToast

script.js:292–309  ·  view source on GitHub ↗
(message, type = 'info')

Source from the content-addressed store, hash-verified

290// ─── Toast Notifications ─────────────────────────────────────────────────────
291
292function 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

Callers 3

script.jsFile · 0.85
copyServerDetailsFunction · 0.85
checkServerCapabilitiesFunction · 0.85

Calls 1

$Function · 0.85

Tested by

no test coverage detected