30 lines
823 B
JavaScript
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);
|
|
}
|