1// ÐÑÐ³ÐºÐ°Ñ Ð»Ð¾Ð³Ð¸ÐºÐ° ÑÐµÐ¼Ñ + анимаÑÐ¸Ñ Ð±ÐµÐ¹Ð´Ð¶Ð° 2document.addEventListener('DOMContentLoaded', function () { 3 // ÐеÑеклÑÑаÑÐµÐ»Ñ ÑÐµÐ¼Ñ (еÑли пÑиÑÑÑÑÑвÑÐµÑ Ð² Ñапке) 4 const themeToggle = document.getElementById('themeToggle'); 5 if (themeToggle) { 6 const savedTheme = localStorage.getItem('theme') || 'light'; 7 document.documentElement.setAttribute('data-theme', savedTheme); 8 updateThemeIcon(savedTheme); 9 10 themeToggle.addEventListener('click', () => { 11 const current = document.documentElement.getAttribute('data-theme'); 12 const next = current === 'light' ? 'dark' : 'light'; 13 document.documentElement.setAttribute('data-theme', next); 14 localStorage.setItem('theme', next); 15 updateThemeIcon(next); 16 17 // неболÑÑÐ°Ñ Ð°Ð½Ð¸Ð¼Ð°ÑÐ¸Ñ ÐºÐ½Ð¾Ð¿ÐºÐ¸ 18 themeToggle.style.transform = 'scale(0.92)'; 19 setTimeout(() => { themeToggle.style.transform = ''; }, 150); 20 }); 21 22 function updateThemeIcon(theme) { 23 const icon = themeToggle.querySelector('i'); 24 if (!icon) return; 25 if (theme === 'dark') { 26 icon.classList.remove('fa-moon'); 27 icon.classList.add('fa-sun'); 28 } else { 29 icon.classList.remove('fa-sun'); 30 icon.classList.add('fa-moon'); 31 } 32 } 33 } 34 35 // ÐнимаÑÐ¸Ñ Ð±ÐµÐ¹Ð´Ð¶ÐµÐ¹ Ðовое/Топ 36 const badges = document.querySelectorAll('.article-badge'); 37 badges.forEach(badge => { 38 badge.addEventListener('mouseenter', () => { 39 if (badge.classList.contains('pulse-animation')) { 40 badge.classList.remove('pulse-animation'); 41 } 42 }); 43 badge.addEventListener('mouseleave', () => { 44 if (!badge.classList.contains('pulse-animation')) { 45 setTimeout(() => { badge.classList.add('pulse-animation'); }, 100); 46 } 47 }); 48 }); 49});
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.