PageSourceSearch

https://nashkiev.ua/assets/js/tildaScroll.js

js nashkiev.ua collected 2026-10-02 04:44:55 UTC 2,265 bytes, 83 lines download raw bytes

1var scroll_0 = 0;
2var scroll_25 = 0;
3var scroll_50 = 0;
4var scroll_75 = 0;
5
6var send_scroll_0 = false;
7var send_scroll_25 = false;
8var send_scroll_50 = false;
9var send_scroll_75 = false;
10
11window.addEventListener('scroll', function(e) {
12    var scrollTop = window.pageYOffset;
13    var Height = document.documentElement.scrollHeight;
14    var clientHeight = document.body.clientHeight;
15
16    var allHeight = (Height - clientHeight)/100;
17
18    if(allHeight*75 < scrollTop && !send_scroll_75){
19        send_scroll_75 = true;
20        scroll_75 = 1
21        if(send_scroll_50){
22            scroll_50 = -1;
23        }
24        if(scroll_25 !== 0){
25            scroll_25 = 0;
26        }
27
28        sendStat()
29
30    }else if(allHeight*50 < scrollTop && !send_scroll_75 && !send_scroll_50){
31        send_scroll_50 = true;
32        scroll_50 = 1
33        if(send_scroll_25){
34            scroll_25 = -1;
35        }
36        if(scroll_0 !== 0){
37            scroll_0 = 0;
38        }
39        sendStat()
40
41    }else if(allHeight*25 < scrollTop && !send_scroll_75 && !send_scroll_50 && !send_scroll_25){
42        send_scroll_25 = true;
43        scroll_25 = 1
44        if(send_scroll_0){
45            scroll_0 = -1;
46        }
47
48        sendStat();
49
50    }else if(50 < scrollTop && !send_scroll_75 && !send_scroll_50 && !send_scroll_25 && !send_scroll_0){
51        send_scroll_0 = true;
52        scroll_0 = 1
53
54        sendStat();
55    }
56
57});
58
59function sendStat() {
60
61    let str = window.location.host;
62    //str = 'nashkiev'; // dev mode
63    let regexp = /nashkiev/;
64
65    if(str.search(regexp) >= 0){
66
67        //console.log('Tilds scrol body', scroll_0, scroll_25, scroll_50, scroll_75);
68
69        var xhr = new XMLHttpRequest();
70        xhr.open('GET', 'https://api.nashkiev.ua/api/ad/analytic/add?objectId='+ScrollTildaID+'&zero='+scroll_0+'&twentyFive='+scroll_25+'&fifty='+scroll_50+'&seventyFive='+scroll_75, false);
71        xhr.send();
72
73        if (xhr.status != 200) {
74            // обработать ошибку
75            console.log( xhr.status + ': ' + xhr.statusText ); // пример вывода: 404: Not Found
76        } else {
77            // вывести результат
78            //console.log( xhr.responseText ); // responseText -- текст ответа.
79        }
80
81    }
82
83}

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.