PageSourceSearch

https://gggi.org/wp-content/themes/gggi/resources/js/home-functions.js

js gggi.org collected 2026-10-02 02:31:22 UTC 4,319 bytes, 165 lines download raw bytes

1var site_url = '/';
2theme_dir = site_url + 'site/assets/themes/gggi/';
3
4(function ($) {
5   
6  $(function () {
7    
8    $('.slider').slick();
9
10/*
11    $('.hero-slider').slick({
12      asNavFor: '.slider-hero-thumbnails',
13      fade: true,
14      dots: false,
15      arrows: false,
16      draggable: false
17    });
18  	
19    $('.slider-hero-thumbnails').slick({
20      asNavFor: '.hero-slider',
21      slidesToShow: 3,
22      dots: false,
23      arrows: false,
24      centerMode: false,
25      focusOnSelect: true,
26      variableWidth: false,
27      draggable: false
28    });
29  	
30    $('.themes-slider').slick({
31      asNavFor: '.slider-themes-thumbnails',
32      fade: true,
33      dots: false,
34      arrows: false,
35      draggable: false
36    });
37    
38    $('.slider-themes-thumbnails').slick({
39      asNavFor: '.themes-slider',
40      slidesToShow: 4,
41      dots: false,
42      arrows: false,
43      centerMode: false,
44      focusOnSelect: true,
45      variableWidth: false,
46      useTransform: false,
47      draggable: false
48    });
49*/
50    
51    
52  
53  });
54}(jQuery));
55
56jQuery(document).ready(function() {
57	var bodyOffset = jQuery('body').offset();
58	jQuery(window).scroll(function() {
59		if (jQuery(document).scrollTop() > bodyOffset.top) {
60			jQuery('header').addClass('sticky');
61		} else {
62			jQuery('header').removeClass('sticky');
63		}
64	});
65});
66
67(function ($) {
68	$.fn.countTo = function (options) {
69		options = options || {};
70		
71		return $(this).each(function () {
72			// set options for current element
73			var settings = $.extend({}, $.fn.countTo.defaults, {
74				from:            $(this).data('from'),
75				to:              $(this).data('to'),
76				speed:           $(this).data('speed'),
77				refreshInterval: $(this).data('refresh-interval'),
78				decimals:        $(this).data('decimals')
79			}, options);
80			
81			// how many times to update the value, and how much to increment the value on each update
82			var loops = Math.ceil(settings.speed / settings.refreshInterval),
83				increment = (settings.to - settings.from) / loops;
84			
85			// references & variables that will change with each update
86			var self = this,
87				$self = $(this),
88				loopCount = 0,
89				value = settings.from,
90				data = $self.data('countTo') || {};
91			
92			$self.data('countTo', data);
93			
94			// if an existing interval can be found, clear it first
95			if (data.interval) {
96				clearInterval(data.interval);
97			}
98			data.interval = setInterval(updateTimer, settings.refreshInterval);
99			
100			// initialize the element with the starting value
101			render(value);
102			
103			function updateTimer() {
104				value += increment;
105				loopCount++;
106				
107				render(value);
108				
109				if (typeof(settings.onUpdate) == 'function') {
110					settings.onUpdate.call(self, value);
111				}
112				
113				if (loopCount >= loops) {
114					// remove the interval
115					$self.removeData('countTo');
116					clearInterval(data.interval);
117					value = settings.to;
118					
119					if (typeof(settings.onComplete) == 'function') {
120						settings.onComplete.call(self, value);
121					}
122				}
123			}
124			
125			function render(value) {
126				var formattedValue = settings.formatter.call(self, value, settings);
127				$self.html(formattedValue);
128			}
129		});
130	};
131	
132	$.fn.countTo.defaults = {
133		from: 0,               // the number the element should start at
134		to: 0,                 // the number the element should end at
135		speed: 1000,           // how long it should take to count between the target numbers
136		refreshInterval: 100,  // how often the element should be updated
137		decimals: 0,           // the number of decimal places to show
138		formatter: formatter,  // handler for formatting the value before rendering
139		onUpdate: null,        // callback method for every time the element is updated
140		onComplete: null       // callback method for when the element finishes updating
141	};
142	
143	function formatter(value, settings) {
144		return value.toFixed(settings.decimals);
145	}
146}(jQuery));
147
148
149jQuery(function ($) {
150  // custom formatting example
151  $('.count-number').data('countToOptions', {
152	formatter: function (value, options) {
153	  return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, ',');
154	}
155  });
156  
157  // start all the timers
158  $('.timer').each(count);  
159  
160  function count(options) {
161	var $this = $(this);
162	options = $.extend({}, options || {}, $this.data('countToOptions') || {});
163	$this.countTo(options);
164  }
165});

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.