// Custom JavaScript for Django Boilerplate document.addEventListener('DOMContentLoaded', function() { // Auto-dismiss alerts after 5 seconds setTimeout(function() { const alerts = document.querySelectorAll('.alert'); alerts.forEach(function(alert) { const bsAlert = new bootstrap.Alert(alert); bsAlert.close(); }); }, 5000); // Add smooth scrolling to anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); document.querySelector(this.getAttribute('href')).scrollIntoView({ behavior: 'smooth' }); }); }); });