PageSourceSearch

https://sandiegowebdesignco.com/wp-content/themes/uncode/library/js/cursor.js?ver=537541253

js sandiegowebdesignco.com collected 2026-10-05 08:44:42 UTC 6,459 bytes, 210 lines download raw bytes

1(function($) {
2	"use strict";
3
4	UNCODE.magicCursor = function(){
5	var $customCursor = $('#uncode-custom-cursor'),
6		$customPilot = $('#uncode-custom-cursor-pilot'),
7		$tooltip = $('.title-tooltip', $customCursor),
8		$cursorSpan = $('> span', $tooltip),
9		currentBg = false,
10		fromTitle = false,
11		setTime,
12		mouseEvent;
13
14		var spanW, spanH,
15		maxW = false;
16
17	function delayChangeCursor(cursorType, cursorTitle, cursorBg, delayt_time, dataTitle, fontClass){
18		if ( currentBg !== false && cursorBg === false && cursorType === 'auto' ) {
19			$tooltip.css({opacity: 0});
20			delayt_time += 400;
21		}
22		clearRequestTimeout(setTime);
23		setTime = requestTimeout(function() {
24
25			$tooltip.css({opacity: ''});
26
27			$customCursor.find('> span:first-child').add($tooltip).removeClass('tooltip-boing');
28
29			if ( cursorTitle !== '' ) {
30				if ( fromTitle && dataTitle === 'boing' ) {
31					setTimeout(function(){
32						$customCursor.find('> span:first-child').add($tooltip).addClass('tooltip-boing');
33					}, 5);
34				}
35				$cursorSpan.attr('class', fontClass).html( cursorTitle );
36			} else {
37				if ( cursorType !== 'auto' ) {
38					$cursorSpan.html('');
39				}
40			}
41
42			$cursorSpan.addClass('in-tooltip');
43
44			$customCursor.attr('data-cursor', cursorType);
45
46			if ( fromTitle ) {
47				$customCursor.addClass('from-tooltip-title');
48			} else {
49				$customCursor.removeClass('from-tooltip-title');
50			}
51
52			if ( cursorBg !== false ) {
53				$customCursor.attr('data-bg', 'transparent');
54			} else {
55				$customCursor.removeAttr('data-bg');
56			}
57
58			currentBg = cursorBg;
59
60			if ( cursorTitle !== '' ) {
61				fromTitle = true;
62				$customCursor.attr('data-cursor', cursorType);
63				$customCursor.attr('data-title', 'true');
64				$cursorSpan.css({width: ''});
65			} else {
66				fromTitle = false;
67				$customCursor.removeAttr('data-title');
68			}
69			spanW = $cursorSpan.outerWidth();
70			
71			if ( spanW >= maxW && maxW !== false ) {
72				$customCursor.find('> span:first-child').add($tooltip).addClass('max-width');	
73				$customCursor.find('> span:first-child').add($tooltip).add($cursorSpan).css({
74					width: maxW
75				});
76				spanW = maxW;
77			} else {
78				$customCursor.find('> span:first-child').removeClass('max-width');
79			}
80			spanH = $cursorSpan.outerHeight();
81			if ( spanW && spanH && cursorTitle !== '' && cursorType.indexOf('icon-') >= 0 ) {
82				$customCursor.find('> span:first-child').add($tooltip).css({
83					width: spanW,
84					height: spanH
85				});
86			} else {
87				$customCursor.find('> span:first-child').add($tooltip).removeAttr("style");
88			}
89			if ( $customPilot.length ) {
90				$customPilot.attr('data-cursor', cursorType);
91			}
92		}, delayt_time);
93	}
94
95	function changeCursor($wrap){
96		$wrap = typeof $wrap === 'undefined' ? $('body') : $wrap;
97		var href = SiteParameters.custom_cursor_selector != '' ? SiteParameters.custom_cursor_selector : '[href], a[data-lbox]',
98			$href = $wrap.find(href),
99			cursorType,
100			cursorTitle = '',
101			tooltip_class = '',
102			cursorBg = false;
103
104		$wrap.filter(":not(.cursor-init)").on("mouseenter.cursor", href, function (e) {
105			var $this = $(this).addClass("cursor-init"),
106				$tmb = $this.closest('.tmb'),
107				data_cursor = $this.closest('[data-cursor]').attr('data-cursor') || $this.attr('data-cursor'),
108				cursor_bg = $this.closest('[data-cursor]').attr('data-cursor-transparent') || $this.attr('data-cursor-transparent'),
109				data_title = $this.closest('[data-cursor]').attr('data-cursor-title') || $this.attr('data-cursor-title'),
110				data_class = $this.closest('[data-cursor]').attr('data-tooltip-class') || $this.attr('data-tooltip-class'),
111				custom_text = ($this.closest('[data-cursor]').attr('data-tooltip-text') || $this.attr('data-tooltip-text')),
112				$title = $('.t-entry-title', $tmb),
113				is_frontend_editor = $this.closest('.vc_controls').length,
114				hasSrcOrClck = $('[src]', $this).length || $('.t-background-cover', $this).length || $this.closest('.tmb-click-row').length,
115				$parent_cursor = $this.closest('[class*="custom-cursor"]');
116
117			if ( is_frontend_editor ) {
118				cursorType = 'auto';
119			} else if ( typeof data_cursor !== 'undefined' && data_cursor !== '' && hasSrcOrClck ) {
120				cursorType = data_cursor;
121			} else if ( $parent_cursor.length ) {
122				if ( $parent_cursor.hasClass('custom-cursor-light') ) {
123					cursorType = 'icon-light';
124				} else if ( $parent_cursor.hasClass('custom-cursor-diff') ) {
125					cursorType = 'icon-diff';
126				} else if ( $parent_cursor.hasClass('custom-cursor-accent') ) {
127					cursorType = 'icon-accent';
128				} else {
129					cursorType = 'icon-dark';
130				}
131			} else {
132				cursorType = 'pointer';
133			}
134
135			if ( typeof data_title !== 'undefined' && data_title !== '' ) {
136				if ( typeof custom_text !== 'undefined' && custom_text !== '' ) {
137					cursorTitle = custom_text;
138				} else {
139					cursorTitle = $title.clone();
140					$('a', cursorTitle).replaceWith(function() {
141						return this.childNodes;
142					});
143					$('*', cursorTitle).replaceWith(function(){
144						return $(this).removeAttr('class');
145					});
146					cursorTitle = cursorTitle.html();
147				}
148			} else {
149				cursorTitle = '';
150			}
151
152			if ( typeof data_class !== 'undefined' && data_class !== '' ) {
153				tooltip_class = data_class;
154			} else {
155				tooltip_class = '';
156			}
157
158			if ( cursor_bg == 'true' ) {
159				cursorBg = true;
160			} else {
161				cursorBg = false;
162			}
163
164			delayChangeCursor(cursorType, cursorTitle, cursorBg, 0, data_title, tooltip_class);
165		}).on("mouseleave.cursor", href, function(e) {
166			var outTime = 150;
167			if ( currentBg !== false && cursorBg === false ) {
168				outTime = 0;
169			}
170			delayChangeCursor('auto', '', false, outTime, false, '');
171		});
172
173		$(window).on('disable-hover', function(event) {
174			document.addEventListener("mousemove", function(e) {
175				mouseEvent = e;
176			});
177			delayChangeCursor('auto', cursorTitle, cursorBg, 0, false, '');
178		});
179
180		$(window).on('enable-hover', function(event) {
181			if ( typeof mouseEvent !== 'undefined' ) {
182				var x = mouseEvent.clientX,
183					y = mouseEvent.clientY;
184
185				var elements = document.elementsFromPoint(x, y),
186					$element = $(elements[0]);
187
188				$element.closest(href).trigger('mouseenter');
189			}
190		});
191
192	}
193
194	$(window).on('load uncode-custom-cursor uncode-quick-view-loaded', function(event) {
195		changeCursor();
196	});
197
198	$(document).ajaxComplete(function( event, xhr, settings ) {
199		changeCursor();
200	});
201
202	$('.isotope-container').on('isotope-layout-complete', function() {
203		var $this = $(this);
204		changeCursor($this);
205	});
206
207};
208
209
210})(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.