PageSourceSearch

https://www.nikkobangkok.com/wp-content/themes/carmelina/assets/js/cursor.js?ver=1.1.3

js nikkobangkok.com collected 2026-10-07 02:38:26 UTC 5,417 bytes, 175 lines download raw bytes

1;(function ($) {
2  	"use strict";
3  
4    if($(document).find('.pxl-cursor-icon').length > 0){ 
5		var cursor_icon  = $(".pxl-cursor-icon");
6		var follower     = $(".pxl-cursor-follower");
7		var cursor_img   = $(".cursor-img");
8	    var posX = 0,
9	        posY = 0,
10	        posX1 = 0,
11	        posY1 = 0;
12         
13	    var mouseX = 0,
14	        mouseY = 0;
15
16	    if( cursor_img.length > 0){
17	        gsap.set(cursor_img, {
18	            scale: 0
19	        });
20	    }
21  
22        $(document).on("mousemove", function(e) {
23	        mouseX = e.clientX;
24	        mouseY = e.clientY;
25	    });
26
27	    var tl = gsap.timeline({
28            paused: true
29        });
30
31	    if( cursor_img.length > 0){
32	        tl.to(cursor_img, {
33	            scale: 1,
34	            opacity: 1,
35	            duration: 0.5,
36	            ease: "expo.inOut"
37	        });
38	    }
39
40		initCursor();
41		extraCursor();
42
43	    function initCursor() {
44	    	var cursor_icon_width = cursor_icon.width();
45	    	var cursor_follower_width = follower.width();
46	    	if( cursor_img.length > 0){
47		    	var cursor_img_width = cursor_img.width();
48		    }
49	    	TweenMax.to({}, 0.01, {
50				repeat: -1,
51				onRepeat: function() {
52					posX += (mouseX - posX) / 1;
53					posY += (mouseY - posY) / 1;
54					posX1 += (mouseX - posX1) / 9;
55					posY1 += (mouseY - posY1) / 9;
56					if($(".pxl-cursor-icon.active").length > 0){
57						TweenMax.set($(".pxl-cursor-icon.active"), {
58						    css: {
59							    left: posX - (cursor_icon_width / 2),
60							    top: posY - (cursor_icon_width / 2)
61						    }
62						});
63					}
64					if(cursor_img.length > 0){
65						TweenMax.set(cursor_img, {
66						    css: {
67							    left: posX1 - (cursor_img_width / 2) - 2,
68							    top: posY1 - (cursor_img_width / 2) - 2
69						    }
70						});
71					}
72				}
73		    });
74		    
75	    }
76
77      	function show_cursor(cur, bool){  
78			cur.addClass("active");   
79  			if(bool == true){
80  				cursor.removeClass("active").addClass('hide');  
81  				follower.removeClass("active").addClass('hide');  
82  			} 
83      	}
84      	function hide_cursor(cur, bool){
85			cur.removeClass("active");     
86  			if(bool == true){
87  				cursor.removeClass("hide");  
88  				follower.removeClass("hide");  
89  			}  
90      	}
91       
92      	 
93      	function extraCursor(){
94      		
95	      	$('.product-main-img.pxl-light-gallery .zoom').on("mouseenter", function() {  
96		        show_cursor(cursor_icon, false);   
97		        cursor_icon.removeClass('hide'); 
98		    });
99		     
100		    $('.pxl-content-main:not(.layout-grid-gallery) .product-main-img.pxl-light-gallery .zoom').on("mouseleave", function() {
101		        hide_cursor(cursor_icon, false);   
102		        cursor_icon.css({
103	      			top: '24px',
104	      			left: 'auto',
105	      			right: '36px'
106	      		});
107		    });
108		    $('.layout-grid-gallery .product-main-img.pxl-light-gallery .zoom').on("mouseleave", function() {
109		        hide_cursor(cursor_icon, false);   
110		        cursor_icon.css({
111	      			top: '40px',
112	      			left: 'auto',
113	      			right: '36px'
114	      		});
115		    });  
116
117		    $('.pxl-page-overlay').on("mouseenter", function() {  
118		        show_cursor(cursor_icon, false);    
119		    });
120		    $('.pxl-page-overlay').on("mouseleave", function() {  
121		        hide_cursor(cursor_icon, false);    
122		    });
123
124		    $('.pxl-hidden-template.pos-center').on("mouseenter", function() {  
125		        show_cursor(cursor_icon, false);    
126		    });
127		    $('.pxl-hidden-template.pos-center').on("mouseleave", function() {  
128		        hide_cursor(cursor_icon, false);    
129		    });
130
131		    $('.pxl-hidden-template.menu-page-popup').on("mouseenter", function() {  
132		        show_cursor(cursor_icon, false);    
133		    });
134		    $('.pxl-hidden-template.menu-page-popup').on("mouseleave", function() {  
135		        hide_cursor(cursor_icon, false);    
136		    });
137
138		    $('.pxl-hidden-template.pos-center .pxl-hidden-template-wrap').on("mouseenter", function() {  
139		        hide_cursor(cursor_icon, false);    
140		    });
141		    $('.pxl-hidden-template.pos-center .pxl-hidden-template-wrap').on("mouseleave", function() {  
142		        show_cursor(cursor_icon, false);    
143		    });
144		    $('.pxl-hidden-template.menu-page-popup .pxl-hidden-template-wrap').on("mouseenter", function() {  
145		        hide_cursor(cursor_icon, false);    
146		    });
147		    $('.pxl-hidden-template.menu-page-popup .pxl-hidden-template-wrap').on("mouseleave", function() {  
148		        show_cursor(cursor_icon, false);    
149		    });
150
151		    $('.pxl-fancybox-wrap.layout-1').on("mouseenter", function() { 
152		        show_cursor(cursor_icon, false);    
153		    });
154		    $('.pxl-fancybox-wrap.layout-1').on("mouseleave", function() {  
155		        hide_cursor(cursor_icon, false);    
156		    });
157
158		    $('.pxl-tabs-list.hover-img-yes .content-item .item-title').on("mouseenter", function() {
159		        var target = $(this).closest('.content-item').attr('data-target');
160		        var item_cls = target.substring(1, target.length);
161		        cursor_img.find('.'+item_cls).addClass('active');
162		        tl.play();
163		    });
164		    $('.pxl-tabs-list.hover-img-yes .content-item .item-title').on("mouseleave", function() {
165		        var target = $(this).closest('.content-item').attr('data-target');
166		        var item_cls = target.substring(1, target.length);
167		        cursor_img.find('.'+item_cls).removeClass('active');
168		        tl.reverse();
169		    });
170  			 
171      	}
172    } 
173    
174     
175})(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.