PageSourceSearch

https://www.hppc.co.uk/wp-content/themes/hurst/assets/src/js/statistics.js?ver=1791082802

js hppc.co.uk collected 2026-10-04 03:07:02 UTC 3,386 bytes, 118 lines download raw bytes

1/*Counter*/
2function countUp(ele,amount,steps){
3    var endAmount = parseInt(ele.attr('data-end'));
4    var html_op = Math.round(amount);
5
6    if(amount < endAmount){
7        setTimeout(function(){
8            amount += steps;
9            var innerAngle = amount * 2,
10            outerAngle = amount * -1;
11            ele.attr('data-start', amount);
12
13            ele.parent().siblings('.inner_circle').addClass('animate');
14            ele.parent().siblings('.outer_circle').addClass('animate');
15
16            if(amount > 1e3){
17                html_op = String((amount / 1e3).toFixed(2)) + 'k';
18            }
19            if(amount > 1e6){
20                html_op = String((amount / 1e6 ).toFixed(2)) + 'm';
21            }
22            if(amount >= 1e9){
23                html_op = String((amount / 1e9 ).toFixed(2)) + 'b';
24            }
25            
26            ele.html(html_op);
27            countUp(ele,amount,steps);
28        },5);
29    } else {
30        ele.html( ele.attr('data-end'));
31        amount = ele.attr('data-end');
32        html_op = amount;
33
34        if(amount > 1e3){
35            html_op = String((amount / 1e3).toFixed(2)) + 'k';
36        }
37        if(amount > 1e6){
38            html_op = String((amount / 1e6 ).toFixed(2)) + 'm';
39        }
40        if(amount >= 1e9){
41            html_op = String((amount / 1e9 ).toFixed(2)) + 'b';
42        }
43
44        ele.html(html_op);
45    }
46}
47
48
49
50
51
52//CHARTS
53function initChart(chartjs){
54    var 
55    $dataType = chartjs.attr('data-type'),
56    $dataTitle = chartjs.attr('data-title'),
57    $dataLabels = chartjs.attr('data-labels'),
58    $dataValues = chartjs.attr('data-values'),
59    $dataColours = chartjs.attr('data-colours'),
60    config = {
61        type: $dataType,
62        data: {
63            datasets: [{
64                data: $dataValues.split(';'),
65                backgroundColor: $dataColours.split(';'),
66                label: 'Dataset 1'
67            }],
68            labels: $dataLabels.split(';')
69        },
70        options: {
71            responsive: true,
72            aspectRatio: 1,
73
74            legend: {
75                display: false,
76            },
77            title: {
78                display: true,
79                text: $dataTitle
80            },
81            animation: {
82                animateScale: true,
83                animateRotate: true,
84            }
85        }
86    },
87    ctx = chartjs.find('canvas').get(0).getContext('2d');
88    window.newChart = new Chart(ctx, config); 
89}
90
91
92
93
94$(window).on('scroll resize load touchmove',function(){
95    var wScroll = $(window).scrollTop() + ( $(window).height() / 1.5 );
96    $('.counter_items .counter_item').each(function(){
97        var varChild = $(this).find('.stat-container').find('.value');        
98        if(varChild.offset().top < wScroll && !$(this).hasClass('run')){
99            $(this).addClass('run');
100            setTimeout(function(){
101                countUp(varChild, parseInt(varChild.attr('data-start')), parseFloat(varChild.attr('data-steps')));
102            },500);
103        }
104        
105    });
106    $('.stat_loader').each(function(){
107        if($(this).offset().top < wScroll && !$(this).hasClass('load')){
108            $(this).addClass('load');
109        }
110    });
111
112    $('.chartjs').each(function(){
113        if($(this).offset().top < wScroll && !$(this).hasClass('loaded')){
114            $(this).addClass('loaded');
115            initChart($(this));
116        }
117    });
118});

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.