PageSourceSearch

http://enriccarreras.com/wp-content/themes/shuffle/assets/js/modules/plugins/counter.js?ver=7.1.2

js enriccarreras.com collected 2026-10-03 18:26:50 UTC 2,783 bytes, 62 lines download raw bytes

1/*
2 **	Plugin for counter shortcode
3 */
4(function($) {
5	"use strict";
6
7	$.fn.countTo = function(options) {
8		// merge the default plugin settings with the custom options
9		options = $.extend({}, $.fn.countTo.defaults, options || {});
10
11		// how many times to update the value, and how much to increment the value on each update
12		var loops = Math.ceil(options.speed / options.refreshInterval),
13			increment = (options.to - options.from) / loops;
14
15		return $(this).each(function() {
16			var _this = this,
17				loopCount = 0,
18				value = options.from,
19				interval = setInterval(updateTimer, options.refreshInterval);
20
21			function updateTimer() {
22				value += increment;
23				loopCount++;
24				$(_this).html(value.toFixed(options.decimals));
25
26				if (typeof(options.onUpdate) === 'function') {
27					options.onUpdate.call(_this, value);
28				}
29
30				if (loopCount >= loops) {
31					clearInterval(interval);
32					value = options.to;
33
34					if (typeof(options.onComplete) === 'function') {
35						options.onComplete.call(_this, value);
36					}
37				}
38			}
39		});
40	};
41
42	$.fn.countTo.defaults = {
43		from: 0,  // the number the element should start at
44		to: 100,  // the number the element should end at
45		speed: 1000,  // how long it should take to count between the target numbers
46		refreshInterval: 100,  // how often the element should be updated
47		decimals: 0,  // the number of decimal places to show
48		onUpdate: null,  // callback method for every time the element is updated,
49		onComplete: null  // callback method for when the element finishes updating
50	};
51
52	$.fn.absoluteCounter=function(b){b=$.extend({},$.fn.absoluteCounter.defaults,b||{});return $(this).each(function(){var d=this,g=b.speed,f=b.setStyles,e=b.delayedStart,c=b.fadeInDelay;if(f){$(d).css({display:"block",position:"relative",overflow:"hidden"}).addClass('animated')}$(d).css("opacity","0");$(d).animate({opacity:0}
52,e,function(){var l=$(d).text();$(d).text("");for(var k=0;k<l.length;k++){var n=l.charAt(k);var m="";if(parseInt(n,10)>=0){m='<span class="onedigit p'+(l.length-k)+" d"+n+'">';for(var h=0;h<=parseInt(n,10);h++){m+='<span class="n'+(h%10)+'">'+(h%10)+"</span>"}m+="</span>"}else{m='<span class="onedigit p'+(l.length-k)+' char"><span class="c">'+n+"</span></span>"}$(d).append(m)}$(d).animate({opacity:1},c);$("span.onedigit",d).each(function(i,o){if(f){$(o).css({"float":"left",position:"relative"});$("span",$(o)).css({display:"block"})}var p=$("span",$(o)).length,j=$(d).height();$(o).css({height:(p*j)+"px",top:"0"});$("span",$(o)).css({height:j+"px"});$(o).animate({top:-1*((p-1)*j)+"px"},g,function(){if(typeof(b.onComplete)==="function"){b.onComplete.call(d)}})})})})};
53
54	$.fn.absoluteCounter.defaults= {
55		speed:2000,
56		setStyles:true,
57		onComplete:null,
58		delayedStart:0,
59		fadeInDelay:0
60	};
61
62})(jQuery);

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.