PageSourceSearch

https://www.citymouse.org/wp-content/plugins/wd_portfolio/js/wd.animation.js?ver=4.2.32

js citymouse.org collected 2026-10-10 02:21:23 UTC 14,881 bytes, 315 lines download raw bytes

1var txt_modCont             = "#portfolio-container > #portfolio-container-holder";  
2touchDevice = 0 ;
3    function showOtherThumbs( galleryHolder ){        
4       galleryHolder.find(".thumb-holder").each( function(){ $(this).css("display", "inline").css("top", "0px"); } );
5    }
6
7    function getAvailableScrollbar(){
8        var scrollbar_v1    = $("#module-container #module-scrollbar-holder");
9        var scrollbar_v2    = $("#module-container #module-scrollbar-holder_v2");
10        var availScrollbar  = (scrollbar_v1.length > 0) ? scrollbar_v1 : scrollbar_v2;
11        return availScrollbar;
12    }
13
14    function afterGalleryStartupAnimation( visibleH ){
15        var textPageInstanceHolder    = jQuery( txt_modCont);
16        var textPageInstance          = jQuery( "#portfolio-galleries", textPageInstanceHolder);
17        if( textPageInstance.length <= 0){return;}
18        jQuery("#portfolio-galleries-holder", textPageInstance).find(".thumb-holder").each( function(){ jQuery(this).css("display", "inline"); } ); 
19        jQuery("#portfolio-galleries-preview").wipetouch({
20              tapToClick: false, /* if user taps the screen, triggers a click event*/
21              preventDefault:false,/* if user taps the screen, triggers a click event*/
22              wipeLeft: function(result) { wipeChange( 1 ); },
23              wipeRight: function(result) { wipeChange( -1 ); }
24        });     
25    }
26    function getDirectionCSS( jQueryelement, coordinates ){
27		
28        /** the width and height of the current div **/
29    	var w = jQueryelement.width(), h = jQueryelement.height(),
30    		/** calculate the x and y to get an angle to the center of the div from that x and y. **/ /** gets the x value relative to the center of the DIV and "normalize" it **/
31    		x = ( coordinates.x - jQueryelement.offset().left - ( w/2 )) * ( w > h ? ( h/w ) : 1 ),
32    		y = ( coordinates.y - jQueryelement.offset().top  - ( h/2 )) * ( h > w ? ( w/h ) : 1 ),
33    		/** the angle and the direction from where the mouse came in/went out clockwise (TRBL=0123);**/
34    		/** first calculate the angle of the point, add 180 deg to get rid of the negative values divide by 90 to get the quadrant
35    		add 3 and do a modulo by 4  to shift the quadrants to a proper clockwise TRBL (top/right/bottom/left) **/
36    		direction = Math.round( ( ( ( Math.atan2(y, x) * (180 / Math.PI) ) + 180 ) / 90 ) + 3 )  % 4;
37            var fromClass, toClass;
38            switch( direction ) {
39    			case 0:/* from top */ 
40                    fromClass = {instance:'hover-slideFromTop', val1: "0px", val2:"-100%"};                    
41    				toClass	  = {instance:'hover-slideTopLeft', val1: "0px", val2:"0px"};
42    				break;
43    			case 1:/* from right */
44    			    fromClass = {instance:'hover-slideFromRight', val1: "100%", val2:"0px"};
45    				toClass	  = {instance:'hover-slideTopLeft', val1: "0px", val2:"0px"};
46    				break;
47    			case 2:/* from bottom */
48    				fromClass = {instance:'hover-slideFromBottom', val1: "0px", val2:"100%"};
49    				toClass	  = {instance:'hover-slideTopLeft', val1: "0px", val2:"0px"};
50    				break;
51    			case 3:/* from left */
52    				fromClass = {instance:'hover-slideFromLeft', val1: "-100%", val2:"0px"};
53    				toClass	  = {instance:'hover-slideTopLeft', val1: "0px", val2:"0px"};
54    				break;
55    		};
56    	return { from : fromClass, to: toClass };
57    }
58
59    function customHoverAnimation( type, event, parent, child ){
60        var directionCSS = getDirectionCSS( parent, { x : event.pageX, y : event.pageY } );
61		
62        if( type == "over" ){
63            //child.removeClass(); 
64			child.css("left", directionCSS.from.val1); 
65			child.css("top", directionCSS.from.val2);
66			TweenMax.to( child, .3, { css:{ left:directionCSS.to.val1, top: directionCSS.to.val2},  ease:Sine.easeInOut });
67        }
68        else if( type == "out" ){
69			TweenMax.to( child, .3, { css:{ left:directionCSS.from.val1, top: directionCSS.from.val2},  ease:Sine.easeInOut }); 
70		}
71    }
72
73
74
75    function rgb2hex(rgb){     
76         var value = "";
77         if( rgb != undefined )
78        {
79            if ( (jQuery.browser.msie && (jQuery.browser.version == "9.0" && isIE9Std() == true )) ||  !jQuery.browser.msie ){  
80            rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);            
81            value = "#" + ("0" + parseInt(rgb[1],10).toString(16)).slice(-2) + ("0" + parseInt(rgb[2],10).toString(16)).slice(-2) + ("0" + parseInt(rgb[3],10).toString(16)).slice(-2);
82             }
83             else{ value = rgb; }
84        }
85         
86         return value;
87    }
88
89	function animateThumb( img ){ 
90		jQuery(img).parent().width(jQuery(img).parent().parent().width());
91		TweenMax.to( img, 0, {css:{opacity:"1"}, easing:Sine.easeOut});
92	}
93	
94	
95	function moduleGallery(){
96		touchDevice = !!("ontouchstart" in window) ? 1 : 0; 
97		if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent) ) {
98			touchDevice = 1;
99		}		
100	    var textPageInstanceHolder = jQuery( txt_modCont );
101        var textPageInstance          = jQuery( textPageInstanceHolder ).children('#portfolio-galleries');//jQuery( "#portfolio-galleries", textPageInstanceHolder);
102        if( textPageInstance.length <= 0 ){return;}       
103        
104        	
105		var moduleWidth               = textPageInstanceHolder.width();
106		var moduleHeight              = textPageInstanceHolder.height();
107
108        var galleryHolder       = jQuery("#portfolio-galleries-holder", textPageInstance);
109        var thumbMarginRight    = parseInt(jQuery(".thumb-holder").css("margin-right"), 10);
110        var thumbMarginBottom   = parseInt(jQuery(".thumb-holder").css("margin-bottom"), 10);
111		//var thumbMarginRight    = 0;
112        //var thumbMarginBottom	= 0;
113        var thumbWidth          = jQuery(".thumb-holder").width();
114        var thumbHeight         = jQuery(".thumb-holder").height();
115        var containerWidth      = galleryHolder.width();
116        var containerHeight     = galleryHolder.height();
117        var visibleHeight       = textPageInstance.height();
118        
119		var gallery_width 		= jQuery("#portfolio-galleries-holder").width();
120		var item_width			= jQuery("#portfolio-galleries-holder").children('.item:first').width();
121		var numberColumns		= Math.round(gallery_width/item_width);
122		//var numberColumns       = Math.round( containerWidth / ( thumbWidth + thumbMarginRight) );
123        var numberLines         = Math.floor( visibleHeight / ( thumbHeight + thumbMarginBottom) + 1);
124        var totalVisibleThumbs  = numberColumns * numberLines - 1;
125        var windowH             = jQuery(window).height() + 50;
126        var windowW             = jQuery(window).width();
127        visibleGalleryH         = visibleHeight;
128        galleryColumns          = numberColumns;
129        galleryLines            = numberLines;
130        galleryItemArr          = [];
131        galleryTopPos = 0;
132        // setPreview();
133		// storePreviewMedia();
134        // addControlsListeners();
135
136		
137		
138        if( windowW < 480 && galleryColumns > 2 ){ galleryColumns = 1;}
139        
140        if( touchDevice == 1 && windowW <= 320 && galleryColumns == 1){         
141        }
142       
143        //jQuery(".thumb-holder" + ":nth-child(" + galleryColumns + "n+" + galleryColumns + ")", galleryHolder).css("margin-right",  "0px");
144       // moduleUpdate( textPageInstanceHolder, textPageInstance, jQuery("div:first", textPageInstance), sideType );
145		textPageInstanceHolder.css("visibility", "visible");	
146        var galleryItem         = jQuery("#portfolio-galleries-holder .thumb-holder", textPageInstance);
147        var backgOverColor      = "#3f3f3f";
148        var backgOutColor       = '#ffffff';//rgb2hex( galleryItem.css("background-color") );
149        var text1BaseColor      = '#3f3f3f';//rgb2hex( jQuery(".thumb-tag p", galleryItem).css("color") );  
150        if( touchDevice == 0 ){
151
152		}
153		if(	touchDevice == 1 ){
154			jQuery('<div id="hidden-fancy"></div>').hide().appendTo('body');
155			galleryItem.each(function(index,value){
156				jQuery(value).find('a.zoom-gallery').appendTo('#hidden-fancy');
157			});
158			galleryItem.find('.hover-default').hide();
159			galleryItem.children('.thumbnail').each(function(_index,_value){
160				jQuery(_value).live('click',
161					function(event) {
162						jQuery('#hidden-fancy > a.zoom-gallery').eq(_index).click();
163						event.preventDefault();
164						return false;
165
166				});
167			});
168		}
169
170        var childLength         = galleryHolder.children('.item').length - 1;
171        totalVisibleThumbs      = ( childLength < totalVisibleThumbs ) ?  childLength : totalVisibleThumbs;
172        galleryVisibleThumbs    = totalVisibleThumbs + 1;
173        var i = 0;
174        var tempI = 0;
175        var tempJ = 0;
176        var onceD  = true;
177        //galleryHolder.find(".thumb-holder").each(
178		
179		
180		galleryHolder.find(".thumb-holder").each(
181                function(){
182					//alert(jQuery(this).html());
183                    if( i > totalVisibleThumbs){
184						jQuery(this).css("display", "none");
185					}else{
186						jQuery(this).css("top", windowH + "px");
187						jQuery(this).parent().css("opacity", "1");
188					}
189                    galleryItemArr[ i ] = jQuery(this); 
190                    i++;
191                      
192        });
193        i         = 0
194        var tempI = 0;
195        var tempJ = 0;
196        var onceD = true;
197		
198
199        galleryHolder.find(".thumb-holder").each(
200                function(){
201                    if( i <= totalVisibleThumbs ){
202                        tempI = Math.floor( i / (numberColumns));
203                        tempJ = (i - (tempI * (numberColumns))) * 0.15;
204                        tempI = tempI * 0.1;
205                        var delay = (0.1 )+ (tempJ) + (tempI);                        
206                        if( i == totalVisibleThumbs ){TweenMax.to( jQuery(this), .6, { css:{ top:"0px" }, delay: delay,  ease:Circ.easeOut, onComplete: afterGalleryStartupAnimation, onCompleteParams:[ visibleHeight ] });}
207                        else{TweenMax.to( jQuery(this), .6, { css:{ top:"0px" }, delay: delay,  ease:Circ.easeOut });}
208                    } 
209                    else{ return;}
210                    i++;
211        });
212       return;      
213	}
214	
215	
216	
217    function endModuleGallery( reverse ){
218	
219	
220        var textPageInstanceHolder  = jQuery( txt_modCont);
221        var textPageInstance        = jQuery( "#portfolio-galleries", textPageInstanceHolder);
222        var galleryHolder           = jQuery("#portfolio-galleries-holder", textPageInstance);
223        var thumbInstance           = jQuery(".thumb-holder", textPageInstance);
224        var thumbHeight             = jQuery(".thumb-holder").height();
225		
226		
227		var gallery_width 			= jQuery("#portfolio-galleries-holder").width();
228		var item_width				= jQuery("#portfolio-galleries-holder").children('.item:first').width();
229//		var thumbMarginRight    	= parseInt(jQuery(".thumb-holder").css("margin-right"), 10);
230//      var thumbWidth          	= jQuery(".thumb-holder").width();
231//		var containerWidth      	= galleryHolder.width();
232//		var galleryColumns			= Math.round( containerWidth / ( thumbWidth + thumbMarginRight) );
233		var galleryColumns__		= Math.round(gallery_width/item_width);
234		
235		var containerPos            = parseInt(galleryHolder.css("top"), 10);
236		containerPos = 0;
237        var currLine                = Math.floor(Math.abs( containerPos / thumbHeight ));
238		currLine = 0;
239        var startNumber             = currLine * galleryColumns__;
240        var endNumber               = startNumber + galleryVisibleThumbs;
241        var windowH                 = jQuery(window).height() + 50; 
242        var totalVisibleThumbs      = galleryColumns__ * galleryLines - 1;
243        
244        var childLength             = galleryHolder.children().length - 1;
245        var currH                   = galleryHolder.height()
246        var i = 0;
247        var t                       = galleryItemArr.length;
248
249		
250		
251        if( reverse == true ){
252            totalVisibleThumbs      = ( childLength < totalVisibleThumbs ) ?  childLength : totalVisibleThumbs;
253            
254            while(t--){
255                if( t >= totalVisibleThumbs){galleryItemArr[t].css("display", "none");}
256                else{galleryItemArr[t].css("top", windowH + "px");}    
257            }
258        }
259        else{             
260           t = galleryItemArr.length;
261           while(t--){
262                if( t < startNumber || t >= endNumber ){ galleryItemArr[t].css("display", "none");}     
263            }
264        }
265		
266        if( currH > jQuery(window).height() ){ galleryHolder.css("top", "0px"); }
267        i = 0;
268        var j       = 0;
269        var tempI   = 0;
270        var tempJ   = 0;
271        var onceD  = true;   
272        if( reverse == true ){
273            moduleEnd = true;
274            galleryHolder.find(".thumb-holder").each(
275                    function(){
276                        if( i <= totalVisibleThumbs ){                            
277                            tempI = Math.floor( i / (galleryColumns__));
278                            tempJ = (i - (tempI * (galleryColumns__))) * 0.15;
279                            tempI = tempI * 0.1;
280                            var delay = (0.1 )+ (tempJ) + (tempI); 
281                            TweenMax.killTweensOf( jQuery(this) );                       
282                            if( i == totalVisibleThumbs ){TweenMax.to( jQuery(this), .6, { css:{ top:"0px" }, delay: delay,  ease:Circ.easeOut, onComplete: showOtherThumbs, onCompleteParams:[galleryHolder] });}
283                            else{TweenMax.to( jQuery(this), .6, { css:{ top:"0px" }, delay: delay,  ease:Circ.easeOut });}
284                        } 
285                        else{ return;}
286                        i++;
287            });           
288        }
289        else {
290            t = galleryItemArr.length;
291            i = 0;
292			startNumber = 0;
293            while(t--){                  
294                if(  t >= startNumber ){
295					
296                    tempI = Math.floor( i / (galleryColumns__));
297                    tempJ = (i - (tempI * (galleryColumns__))) * 0.15;
298                    tempI = tempI * 0.1;
299                    var delay = (0.1 )+ (tempJ) + (tempI);          
300                    if( t == startNumber && reverse == true){
301						TweenMax.to( galleryItemArr[t], 0.8, { css:{ top: windowH + "px" }, delay: delay,  ease:Circ.easeInOut, onComplete: showOtherThumbs, onCompleteParams:[galleryHolder]});
302					}else{
303
304						TweenMax.to( galleryItemArr[t], 0.8, { css:{ top: windowH + "px" }, delay: delay,  ease:Circ.easeInOut});
305					}     
306                    
307                    if( onceD == true && jQuery("#dragger-holder").length > 0 ){
308                        onceD = false;
309                        TweenMax.to( jQuery("#dragger-holder"), 0.8, { css:{ top: windowH + "px" },  ease:Circ.easeInOut });
310                    }
311                    i++;
312                }      
313            } 
314        }  
315    }

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.