36473-vm/assets/js/main.js
Flatlogic Bot 0c66a3d3f1 1
2025-11-29 16:02:59 +00:00

30 lines
823 B
JavaScript

document.addEventListener('DOMContentLoaded', () => {
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('saved') && urlParams.get('saved') === '1') {
showToast('Growth entry saved successfully!');
// Clean up the URL
history.replaceState(null, '', window.location.pathname);
}
});
function showToast(message) {
const toast = document.createElement('div');
toast.className = 'toast';
toast.textContent = message;
document.body.appendChild(toast);
// Animate in
setTimeout(() => {
toast.classList.add('show');
}, 100);
// Animate out and remove
setTimeout(() => {
toast.classList.remove('show');
setTimeout(() => {
document.body.removeChild(toast);
}, 300);
}, 3000);
}