20 lines
632 B
JavaScript
20 lines
632 B
JavaScript
// assets/js/main.js
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
// Activate toast notifications
|
|
var toastEl = document.getElementById('contactToast');
|
|
if (toastEl) {
|
|
var toast = new bootstrap.Toast(toastEl);
|
|
toast.show();
|
|
}
|
|
|
|
// Smooth scrolling for anchor links
|
|
document.querySelectorAll('a.nav-link[href^="#"]').forEach(anchor => {
|
|
anchor.addEventListener('click', function (e) {
|
|
e.preventDefault();
|
|
document.querySelector(this.getAttribute('href')).scrollIntoView({
|
|
behavior: 'smooth'
|
|
});
|
|
});
|
|
});
|
|
});
|