1/** 2 * GetCheese Interactivity Logic 3 */ 4 5// Initialize Lucide Icons 6if (window.lucide) { 7 lucide.createIcons(); 8} 9 10/** 11 * Smoothly scrolls to a section by ID, accounting for the sticky navbar. 12 * @param {string} id - The ID of the section to scroll to. 13 */ 14function scrollToSection(id) { 15 const element = document.getElementById(id); 16 if (element) { 17 const navHeight = 80; // height of the navbar (h-20) 18 const elementPosition = element.getBoundingClientRect().top; 19 const offsetPosition = elementPosition + window.pageYOffset - navHeight; 20 21 window.scrollTo({ 22 top: offsetPosition, 23 behavior: "smooth" 24 }); 25 } 26} 27 28// Add a shadow to the navbar when scrolling 29window.addEventListener('scroll', () => { 30 const nav = document.querySelector('nav'); 31 if (window.scrollY > 20) { 32 nav.classList.add('shadow-md'); 33 nav.style.backgroundColor = 'rgba(255, 255, 255, 0.95)'; 34 } else { 35 nav.classList.remove('shadow-md'); 36 nav.style.backgroundColor = 'rgba(255, 255, 255, 0.8)'; 37 } 38}); 39 40// Re-run icon initialization if content is dynamically loaded (if needed) 41document.addEventListener('DOMContentLoaded', () => { 42 if (window.lucide) { 43 lucide.createIcons(); 44 } 45});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.