MCPcopy
hub / github.com/FujiwaraChoki/MoneyPrinter / showToast

Function showToast

Frontend/app.js:110–129  ·  view source on GitHub ↗
(message, type = "info")

Source from the content-addressed store, hash-verified

108
109// ===== TOAST NOTIFICATIONS =====
110function showToast(message, type = "info") {
111 const container = document.getElementById("toastContainer");
112 const toast = document.createElement("div");
113 toast.className = `toast toast-${type}`;
114 toast.innerHTML = `
115 <span class="toast-dot"></span>
116 <span class="toast-msg">${message}</span>
117 <button class="toast-close" aria-label="Close">&times;</button>
118 `;
119 toast.querySelector(".toast-close").addEventListener("click", () => {
120 dismissToast(toast);
121 });
122 container.appendChild(toast);
123
124 requestAnimationFrame(() => {
125 requestAnimationFrame(() => toast.classList.add("show"));
126 });
127
128 setTimeout(() => dismissToast(toast), 5000);
129}
130
131function dismissToast(toast) {
132 toast.classList.remove("show");

Callers 5

loadOllamaModelsFunction · 0.85
pollJobFunction · 0.85
cancelGenerationFunction · 0.85
uploadSongsFunction · 0.85
generateVideoFunction · 0.85

Calls 1

dismissToastFunction · 0.85

Tested by

no test coverage detected