1/* Manay Timeline Script */ 2let lastScrollY = window.scrollY; 3let scrollDirection = 'down'; 4 5window.addEventListener('scroll', () => { 6 const currentScrollY = window.scrollY; 7 scrollDirection = currentScrollY > lastScrollY ? 'down' : 'up'; 8 lastScrollY = currentScrollY; 9}); 10 11const observerOptions = { 12 root: null, 13 rootMargin: '0px 0px -50% 0px', 14 threshold: 0.1 15}; 16 17const observer = new IntersectionObserver((entries) => { 18 entries.forEach(entry => { 19 const item = entry.target; 20 const itemDate = item.querySelector('.timeline-date'); 21 const itemTitle = item.querySelector('.event-title'); 22 const itemCircle = item.querySelector('.timeline-circle'); 23 const itemLogo = item.querySelector('.logo-container img'); 24 const itemMultiLogos = item.querySelectorAll('.multi-logo-container img'); 25 const isFirstItem = item === document.querySelector('.timeline-item:first-child'); 26 27 if (entry.isIntersecting) { 28 if (itemDate) itemDate.style.color = '#363636'; 29 if (itemTitle) itemTitle.style.color = '#363636'; 30 if (itemCircle) itemCircle.style.background = '#363636'; 31 if (itemLogo) { 32 itemLogo.style.filter = 'brightness(0.4) contrast(1.5)'; 33 } 34 if (itemMultiLogos.length > 0) { 35 itemMultiLogos.forEach(logo => { 36 logo.style.filter = 'brightness(0.4) contrast(1.5)'; 37 }); 38 } 39 } else { 40 if (!isFirstItem) { 41 const rect = item.getBoundingClientRect(); 42 if (scrollDirection === 'up' || rect.top > window.innerHeight || rect.bottom < 0) { 43 if (itemDate) itemDate.style.color = '#D9D9D9'; 44 if (itemTitle) itemTitle.style.color = '#D9D9D9'; 45 if (itemCircle) itemCircle.style.background = '#D9D9D9'; 46 if (itemLogo) { 47 itemLogo.style.filter = 'brightness(0.7) contrast(1.2)'; 48 } 49 if (itemMultiLogos.length > 0) { 50 itemMultiLogos.forEach(logo => { 51 logo.style.filter = 'brightness(0.7) contrast(1.2)'; 52 }); 53 } 54 } 55 } 56 } 57 }); 58}, observerOptions); 59 60document.addEventListener('DOMContentLoaded', () => { 61 const timelineItems = document.querySelectorAll('.timeline-item'); 62 timelineItems.forEach(item => { 63 observer.observe(item); 64 }); 65});
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.