1console.log('Main.js at your service!!!:)') 2 3const table_links = document.querySelectorAll(".table_link") 4 5for (let link of table_links) { 6 link.addEventListener('click', function (e) { 7 e.preventDefault(); 8 9 const blockID = this.getAttribute('href').replace('#', ''); 10 const target = document.getElementById(blockID); 11 12 if (!target) return; 13 14 const topOffset = 70; 15 16 const elementPosition = 17 target.getBoundingClientRect().top + window.scrollY; 18 19 window.scrollTo({ 20 top: elementPosition - topOffset, 21 behavior: 'smooth' 22 }); 23 }); 24} 25 26// ÐÑовеÑка ÑÑÑеÑÑÐ²Ð¾Ð²Ð°Ð½Ð¸Ñ ÑлеменÑа пеÑед иÑполÑзованием 27const inputForm = document.querySelector('.form'); 28if (inputForm) { 29 30} 31 32// Scroll to top 33const scrollTopBtn = document.querySelector('.scrollTop'); 34if (scrollTopBtn) { 35 scrollTopBtn.addEventListener('click', () => 36 window.scrollTo({ top: 0, behavior: 'smooth' }) 37 ) 38} 39 40function openCloseMenu(e){ 41 e.preventDefault() 42 const mobileMenu = document.getElementById('mobileMenu'); 43 const overlay = document.querySelector('.overlay'); 44 45 if (mobileMenu) { 46 mobileMenu.toggleAttribute('hidden') 47 } 48 if (overlay) { 49 overlay.toggleAttribute('hidden') 50 } 51} 52 53const burger = document.querySelector('.burger'); 54const closeBtn = document.querySelector('.close'); 55const overlay = document.querySelector('.overlay'); 56 57if (burger) { 58 burger.addEventListener('click', openCloseMenu) 59} 60if (closeBtn) { 61 closeBtn.addEventListener('click', openCloseMenu) 62} 63if (overlay) { 64 overlay.addEventListener('click', openCloseMenu) 65} 66 67// Button click handlers 68for (let b of document.querySelectorAll('button')){ 69 b.addEventListener('click', function() { 70 let goal = this.getAttribute('data-goal') 71 if (typeof ym === "function") { 72 ym(105910831,'reachGoal', goal) 73 } 74 console.log(`goal ${goal} reached`) 75 let link = 'https://perfstream.net/click?key=75ac480444464137ae57c17516043bbb' 76 let split = this.getAttribute('data-split') 77 location.href=`${link}&split=${split}` 78 }) 79} 80 81// Scroll top button visibility 82const handleScroll = () => { 83 const scrollTopElement = document.querySelector('.scrollTop'); 84 if (scrollTopElement) { 85 if (window.scrollY > 1000) { 86 scrollTopElement.style.opacity = '1'; 87 } else { 88 scrollTopElement.style.opacity = '0'; 89 } 90 } 91} 92 93window.addEventListener('scroll', handleScroll); 94 95// Yandex Metrika initialization 96setTimeout(function(){
vendor: 399 bytes, lines 96-102
96 97 (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; 98 m[i].l=1*new Date(); 99 for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} 100 k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) 101 (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); 102 ym(
102105910831
vendor: 117 bytes, lines 102-109
102, "init", { 103 clickmap:true, 104 trackLinks:true, 105 accurateTrackBounce:true, 106 webvisor:true 107 }); 108 109
109let thirdScroll = false 110 let halfScroll = false 111 let fullScroll = false 112 113 window.onscroll = function() { 114 115 let pageY = window.scrollY 116 let innerHeight = document.documentElement.scrollHeight; 117 let delta = innerHeight / pageY; 118 119 console.log('pageY', pageY) 120 console.log('height', innerHeight) 121 console.log('delta', delta) 122 123 if( delta >= 2 && thirdScroll == false ){ 124 thirdScroll = true 125 console.log('partsScrollGoal1 reached') 126 127 if (typeof window.ym != 'undefined') { 128 ym(105910831,'reachGoal','partsScrollGoal1') 129 } 130 131 } 132 133 if( delta <= 2 && delta >= 1.5 && halfScroll == false ){ 134 135 halfScroll = true 136 console.log('partsScrollGoal2 reached') 137 if (typeof window.ym != 'undefined') { 138 ym(105910831,'reachGoal','partsScrollGoal2') 139 } 140 141 } 142 143 if( delta <= 1.5 && fullScroll == false ){ 144 fullScroll = true 145 console.log('partsScrollGoal3 reached') 146 147 if (typeof window.ym != 'undefined') { 148 ym(105910831,'reachGoal','partsScrollGoal3') 149 } 150 151 } 152 153 154 } 155}, 3500)
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.