HEX
Server: LiteSpeed
System: Linux linux31.centraldnserver.com 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
User: salamatk (1501)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open
Upload Files
File: /home/salamatk/takarzan.ir/wp-content/themes/xts-luman/js/scripts/circleProgressBarElement.js
/* global xts_settings */
(function($) {
	XTSThemeModule.xtsElementorAddAction('frontend/element_ready/xts_circle_progress.default', function() {
		XTSThemeModule.circleProgressBarElement();
	});

	XTSThemeModule.circleProgressBarElement = function() {
		if (typeof ($.fn.waypoint) === 'undefined') {
			return;
		}

		$('.xts-circle-progress').each(function() {
			var $element = $(this);
			var $circleValue = $element.find('.xts-circle-meter-value');
			var $counter = $element.find('.xts-circle-number');
			var counterFinal = $counter.data('final');
			var duration = $element.data('duration');

			$element.waypoint(function() {
				if ('done' !== $counter.attr('data-state') && $counter.text() !== counterFinal) {
					$counter.prop('Counter', 0).animate({
						Counter: counterFinal
					}, {
						duration: duration,
						easing  : 'swing',
						step    : function(now) {
							if (now >= counterFinal) {
								$counter.attr('data-state', 'done');
							}

							$counter.text(Math.ceil(now));
						}
					});
				}

				// animate progress
				var circumference = parseInt($element.data('circumference'));
				var dashoffset = circumference * (1 - ($circleValue.data('value') / 100));

				$circleValue.css({
					'transitionDuration': duration + 'ms',
					'strokeDashoffset'  : dashoffset
				});

			}, {
				offset: '90%'
			});
		});
	};

	$(document).ready(function() {
		XTSThemeModule.circleProgressBarElement();
	});
})(jQuery);