PageSourceSearch

https://istokrtps.ru/assets/js/home-counter.js

js istokrtps.ru collected 2026-10-07 21:36:49 UTC 2,704 bytes, 89 lines download raw bytes

1
2/* Функция счетчика1 */
3function start_count1() {
4    const counter = function(elem, delay, num) {
5        for(let currentIndex=0; currentIndex<=num; currentIndex+=1) {
6            (function(index) {
7              setTimeout(function() {
8                elem.textContent = index;
9                /*if(index == num) {
10                  num++;
11                  setInterval(function(){
12                    elem.textContent = num;
13                    num++;
14                  }, 3000)
15                }*/
16              }, delay*index);
17            })(currentIndex);
18          }
19    }
20    const counterNumber = document.getElementsByClassName('count1')[0];
21    counter(counterNumber, 0.3, 4752);
22}
23
24/* Функция счетчика2 */
25function start_count2() {
26    const counter = function(elem, delay, num) {
27        for(let currentIndex=0; currentIndex<=num; currentIndex+=1) {
28            (function(index) {
29              setTimeout(function() {
30                elem.textContent = index;
31              }, delay*index);
32            })(currentIndex);
33          }
34    }
35    const counterNumber = document.getElementsByClassName('count2')[0];
36    counter(counterNumber, 5, 50);
37}
38
39/* Функция счетчика3 */
40function start_count3() {
41    const counter = function(elem, delay, num) {
42        for(let currentIndex=0; currentIndex<=num; currentIndex+=1) {
43            (function(index) {
44              setTimeout(function() {
45                elem.textContent = index;
46              }, delay*index);
47            })(currentIndex);
48          }
49    }
50    const counterNumber = document.getElementsByClassName('count3')[0];
51    counter(counterNumber, 10, 5);
52}
53
54/* Функция счетчика4 */
55function start_count4() {
56    const counter = function(elem, delay, num) {
57        for(let currentIndex=0; currentIndex<=num; currentIndex+=1) {
58            (function(index) {
59              setTimeout(function() {
60                elem.textContent = index;
61              }, delay*index);
62            })(currentIndex);
63          }
64    }
65    const counterNumber = document.getElementsByClassName('count4')[0];
66    counter(counterNumber, 0.3, 6100);
67}
68
69
70/* Запуск счетчика при появлении на экране */
71var counter = 1;
72$(document).ready(function() {
73    var windowHeight = $(window).height();
74	$(document).on('scroll', function() {
75		$('.count').each(function() {
76			var self = $(this),
77			height = self.offset().top + self.height();
78			if ($(document).scrollTop() + windowHeight >= height) {
79			    if (counter == 1) {
80				    start_count1();
81				    start_count2();
82				    start_count3();
83				    
84				    counter++; 
85                }
86			}
87		});
88	});
89});

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.