Delete assets/js/notifications.js

This commit is contained in:
SubleXBle
2025-07-30 16:56:43 +02:00
committed by GitHub
parent fc37fdca68
commit 2d5a96beea

View File

@@ -1,28 +0,0 @@
/**
* Shows a toast-style notification in the page.
*
* @param {string} message - The text to show in the notification.
* @param {boolean} isError - Whether this is an error (red) or success/info (green).
*/
function showNotification(message, isError = false) {
const container = document.getElementById('notification-container');
if (!container) return;
const note = document.createElement('div');
note.className = 'notification';
note.style.backgroundColor = isError ? '#722' : '#a8d5ba'; // red for errors, soft green for success
note.style.color = isError ? '#f8f8f8' : '#2e4d32'; // light text on red, dark text on green
note.style.padding = '0.5em 1em';
note.style.marginBottom = '0.5em';
note.style.borderRadius = '4px';
note.style.boxShadow = '0 2px 4px rgba(0,0,0,0.2)';
note.style.fontSize = '0.95em';
note.innerText = message;
container.appendChild(note);
// Remove notification after 5 seconds
setTimeout(() => {
note.remove();
}, 5000);
}