From 179d28f8f1266cdc1439df20eb41443bb1d739e0 Mon Sep 17 00:00:00 2001 From: admtracksteel Date: Sat, 6 Jun 2026 21:50:21 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Auto-deploy:=20Camila=20atualiza?= =?UTF-8?q?do=20em=2006/06/2026=2021:50:21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/app.js | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/public/app.js b/public/app.js index b0b37db..e85d79a 100644 --- a/public/app.js +++ b/public/app.js @@ -11,6 +11,62 @@ function escapeHtml(text) { .replace(/'/g, "'"); } +// Função global para exibir notificações elegantes estilo Toast +function showToast(message, type = 'info') { + let container = document.getElementById('toast-container'); + if (!container) { + container = document.createElement('div'); + container.id = 'toast-container'; + container.style.position = 'fixed'; + container.style.bottom = '24px'; + container.style.right = '24px'; + container.style.zIndex = '99999'; + container.style.display = 'flex'; + container.style.flexDirection = 'column'; + container.style.gap = '10px'; + document.body.appendChild(container); + } + + const toast = document.createElement('div'); + toast.className = `custom-toast toast-${type}`; + toast.style.background = type === 'success' ? '#10b981' : type === 'error' ? '#ef4444' : '#3b82f6'; + toast.style.color = '#fff'; + toast.style.padding = '12px 24px'; + toast.style.borderRadius = '8px'; + toast.style.boxShadow = '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)'; + toast.style.fontFamily = "'Outfit', sans-serif"; + toast.style.fontSize = '0.9rem'; + toast.style.fontWeight = '500'; + toast.style.minWidth = '250px'; + toast.style.transition = 'all 0.3s ease'; + toast.style.opacity = '0'; + toast.style.transform = 'translateY(20px)'; + toast.style.display = 'flex'; + toast.style.alignItems = 'center'; + + // Icon + const icon = type === 'success' ? '✅' : type === 'error' ? '❌' : 'ℹ️'; + toast.innerHTML = `${icon}${message}`; + + container.appendChild(toast); + + // Trigger animation + setTimeout(() => { + toast.style.opacity = '1'; + toast.style.transform = 'translateY(0)'; + }, 10); + + // Auto remove + setTimeout(() => { + toast.style.opacity = '0'; + toast.style.transform = 'translateY(-20px)'; + setTimeout(() => { + toast.remove(); + }, 300); + }, 3500); +} +window.showToast = showToast; // Tornar acessível globalmente + // Função auxiliar para exibir alerta customizado e elegante (substitui o alert nativo) function showCustomAlert(title, message) { return new Promise((resolve) => {