Rework UI by returning error/statuses, some refactorings

This commit is contained in:
Ettore Di Giacinto
2025-03-03 22:34:46 +01:00
parent 365f89cd5e
commit 173eda4fb3
9 changed files with 614 additions and 161 deletions

View File

@@ -220,4 +220,29 @@ select::-webkit-scrollbar-thumb {
}
</style>
</style>
<script>
// Function to show toast notifications
function showToast(message, type) {
const toast = document.getElementById('toast');
const toastMessage = document.getElementById('toast-message');
// Set message
toastMessage.textContent = message;
// Set toast type (success/error)
toast.className = 'toast';
toast.classList.add(type === 'success' ? 'toast-success' : 'toast-error');
// Show toast
setTimeout(() => {
toast.classList.add('toast-visible');
}, 100);
// Hide toast after 3 seconds
setTimeout(() => {
toast.classList.remove('toast-visible');
}, 3000);
}
</script>