1(function () { 2 const SELECTOR = ".bets-table-live__container"; // конÑÐµÐ¹Ð½ÐµÑ Ñо ÑÑÑоками 3 const VISIBLE_ROWS = 7; // ÑколÑко ÑÑÑок показÑваÑÑ 4 const INTERVAL_MS = 3000; // Ñаг пÑокÑÑÑки 5 const DIRECTION = "up"; // "down" или "up" 6 7 function init() { 8 const scroller = document.querySelector(SELECTOR); 9 if (!scroller) return; 10 11 const rows = Array.from(scroller.querySelectorAll(".bets-table-row")); 12 if (rows.length <= VISIBLE_ROWS) return; // неÑего кÑÑÑиÑÑ 13 14 // СÑиÑаем ÑкоÑÑ Ñ ÑÑÑÑом margin/gap: иÑполÑзÑем offsetTop оÑноÑиÑелÑно конÑейнеÑа 15 const baseTop = rows[0].offsetTop; 16 const anchors = rows.map(r => r.offsetTop - baseTop); 17 18 // ÐÑÑоÑа окна = ÑаÑÑÑоÑние Ð¾Ñ Ð½Ð°Ñала 0-й до наÑала VISIBLE_ROWS-й ÑÑÑоки 19 const windowHeight = anchors[VISIBLE_ROWS] ?? (rows[0].getBoundingClientRect().height * VISIBLE_ROWS); 20 scroller.style.height = windowHeight + "px"; 21 scroller.style.overflowY = "hidden"; 22 23 // ÐаÑалÑÐ½Ð°Ñ Ð¿Ð¾Ð·Ð¸ÑÐ¸Ñ 24 let index = (DIRECTION === "down") ? 0 : rows.length - VISIBLE_ROWS; 25 scroller.scrollTop = anchors[index]; 26 27 const tick = () => { 28 if (DIRECTION === "down") { 29 index++; 30 if (index <= rows.length - VISIBLE_ROWS) { 31 scroller.scrollTo({ top: anchors[index], behavior: "smooth" }); 32 } else { 33 index = 0; 34 scroller.scrollTo({ top: anchors[0], behavior: "auto" }); 35 } 36 } else { // "up" 37 index--; 38 if (index >= 0) { 39 scroller.scrollTo({ top: anchors[index], behavior: "smooth" }); 40 } else { 41 index = rows.length - VISIBLE_ROWS; 42 scroller.scrollTo({ top: anchors[index], behavior: "auto" }); 43 } 44 } 45 }; 46 47 setInterval(tick, INTERVAL_MS); 48 } 49 50 // ÐдÑм, пока загÑÑзÑÑÑÑ ÐºÐ°ÑÑинки, ÑÑÐ¾Ð±Ñ Ð²ÑÑоÑÑ ÑÑабилизиÑовалиÑÑ 51 if (document.readyState === "complete") init(); 52 else window.addEventListener("load", init); 53})();
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.