39249-vm/assets/js/main.js
Flatlogic Bot 36ead92a6c 1
2026-03-20 12:52:25 +00:00

20 lines
635 B
JavaScript

document.addEventListener('DOMContentLoaded', () => {
const navLinks = document.querySelectorAll('a.nav-link[href^="#"]');
navLinks.forEach((link) => {
link.addEventListener('click', (event) => {
const targetId = link.getAttribute('href');
const target = document.querySelector(targetId);
if (target) {
event.preventDefault();
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
});
});
const toastEl = document.querySelector('.toast');
if (toastEl && window.bootstrap) {
const toast = new bootstrap.Toast(toastEl, { delay: 4000 });
toast.show();
}
});