28 lines
889 B
JavaScript
28 lines
889 B
JavaScript
|
|
// Main.js - Homepage functionality
|
||
|
|
|
||
|
|
document.addEventListener('DOMContentLoaded', function() {
|
||
|
|
console.log('Goa-GEL Documentation loaded');
|
||
|
|
|
||
|
|
// Smooth scrolling for anchor links
|
||
|
|
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
||
|
|
anchor.addEventListener('click', function (e) {
|
||
|
|
e.preventDefault();
|
||
|
|
const target = document.querySelector(this.getAttribute('href'));
|
||
|
|
if (target) {
|
||
|
|
target.scrollIntoView({
|
||
|
|
behavior: 'smooth',
|
||
|
|
block: 'start'
|
||
|
|
});
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
// Highlight active navigation link
|
||
|
|
const currentPath = window.location.pathname;
|
||
|
|
document.querySelectorAll('.main-nav a').forEach(link => {
|
||
|
|
if (link.getAttribute('href') === currentPath) {
|
||
|
|
link.classList.add('active');
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|