| |
|
| | |
| | document.querySelectorAll('a').forEach(anchor => { |
| | |
| | if (anchor.href && anchor.href.startsWith(window.location.origin)) { |
| | anchor.addEventListener('click', function(e) { |
| | |
| | if (this.getAttribute('href').startsWith('#')) { |
| | e.preventDefault(); |
| | document.querySelector(this.getAttribute('href')).scrollIntoView({ |
| | behavior: 'smooth' |
| | }); |
| | } |
| | |
| | }); |
| | } |
| | }); |
| |
|
| | document.querySelectorAll('a[href^="#"]').forEach(anchor => { |
| | anchor.addEventListener('click', function (e) { |
| | e.preventDefault(); |
| | document.querySelector(this.getAttribute('href')).scrollIntoView({ |
| | behavior: 'smooth' |
| | }); |
| | }); |
| | }); |
| | |
| | const observer = new IntersectionObserver((entries) => { |
| | entries.forEach(entry => { |
| | if (entry.isIntersecting) { |
| | entry.target.classList.add('animate-fadeIn'); |
| | observer.unobserve(entry.target); |
| | } |
| | }); |
| | }, { |
| | threshold: 0.1, |
| | rootMargin: '0px 0px -100px 0px' |
| | }); |
| | document.querySelectorAll('[class*="animate-"]').forEach(el => { |
| | observer.observe(el); |
| | }); |
| |
|
| | |
| | function setupMobileMenu() { |
| | const menuButton = document.querySelector('[aria-controls="mobile-menu"]'); |
| | if (menuButton) { |
| | const menu = document.getElementById('mobile-menu'); |
| | menuButton.addEventListener('click', () => { |
| | const expanded = menuButton.getAttribute('aria-expanded') === 'true'; |
| | menuButton.setAttribute('aria-expanded', !expanded); |
| | menu.classList.toggle('hidden'); |
| | }); |
| | } |
| | } |
| | |
| | document.addEventListener('DOMContentLoaded', () => { |
| | setupMobileMenu(); |
| | |
| | |
| | feather.replace(); |
| | |
| | |
| | document.querySelectorAll('custom-navbar, custom-footer').forEach(el => { |
| | if (el.shadowRoot) { |
| | const icons = el.shadowRoot.querySelectorAll('[data-feather]'); |
| | icons.forEach(icon => { |
| | feather.replace(icon); |
| | }); |
| | } |
| | }); |
| | }); |
| |
|