PageSourceSearch

https://niravadya.com/wp-content/themes/civi/elementor/assets/js/widgets/widget-fancy-heading.js

js niravadya.com collected 2026-09-24 13:31:07 UTC 2,773 bytes, 101 lines download raw bytes

1(function ($) {
2	"use strict";
3	var CiviFancyHeadingHandler = function ($scope) {
4		var $element = $scope.find(".civi-fancy-heading");
5
6		var options_default = {
7			animationDelay: 4000,
8			barAnimationDelay: 3000,
9			typingSpeed: 200,
10			typingDelay: 2000,
11			typingLoop: false,
12			typingCursor: false,
13		};
14
15		$element.each(function () {
16			var $this = $(this);
17			var options = $this.data("settings-options");
18			var animationDelay = options.animationDelay;
19			options = $.extend({}, options_default, options);
20			options.barAnimationDelay = options.animationDelay;
21
22			if (options.animationDelay < 3000) {
23				options.barWaiting = options.animationDelay * (10 / 100);
24			}
25			if (options.animationDelay >= 3000) {
26				options.barWaiting = options.animationDelay - 3000;
27			}
28
29			var duration = animationDelay;
30
31			if ($this.hasClass("loading-bar")) {
32				duration = options.barAnimationDelay;
33				setTimeout(function () {
34					$this.find(".civi-fancy-heading-animated").addClass("is-loading");
35				}, options.barWaiting);
36			}
37
38			if ($this.hasClass("civi-fancy-heading-typing")) {
39				var txt = $this.data("text");
40				$this.find(".civi-fancy-heading-animated").typed({
41					strings: txt,
42					typeSpeed: options.typingSpeed,
43					backSpeed: 0,
44					startDelay: 300,
45					backDelay: options.typingDelay,
46					showCursor: options.typingCursor,
47					loop: options.typingLoop,
48				});
49			} else {
50				setTimeout(function () {
51					hideWord($this.find(".civi-fancy-heading-show").eq(0), options);
52				}, duration);
53			}
54		});
55
56		function hideWord($word, options) {
57			var nextWord = takeNext($word);
58			if (
59				$word
60					.parents(".civi-fancy-heading")
61					.hasClass("civi-fancy-heading-loading")
62			) {
63				$word.parent(".civi-fancy-heading-animated").removeClass("is-loading");
64				switchWord($word, nextWord);
65				setTimeout(function () {
66					hideWord(nextWord, options);
67				}, options.barAnimationDelay);
68				setTimeout(function () {
69					$word.parent(".civi-fancy-heading-animated").addClass("is-loading");
70				}, options.barWaiting);
71			} else {
72				switchWord($word, nextWord);
73				setTimeout(function () {
74					hideWord(nextWord, options);
75				}, options.animationDelay);
76			}
77		}
78
79		function takeNext($word) {
80			return !$word.is(":last-child")
81				? $word.next()
82				: $word.parent().children().eq(0);
83		}
84
85		function switchWord($oldWord, $newWord) {
86			$oldWord
87				.removeClass("civi-fancy-heading-show")
88				.addClass("civi-fancy-heading-hidden");
89			$newWord
90				.removeClass("civi-fancy-heading-hidden")
91				.addClass("civi-fancy-heading-show");
92		}
93	};
94
95	$(window).on("elementor/frontend/init", function () {
96		elementorFrontend.hooks.addAction(
97			"frontend/element_ready/civi-fancy-heading.default",
98			CiviFancyHeadingHandler
99		);
100	});
101})(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.