1jQuery( document ).ready( function( $ ) { 2 3 'use strict'; 4 5 /*-------------------------------------------------------------- 6 Screen size class 7 --------------------------------------------------------------*/ 8 9 function gpScreenSizeClass() { 10 11 if ( $(window).innerWidth() <= 767 && $( 'body' ).hasClass( 'gp-responsive' ) ) { 12 13 $( 'body' ).addClass( 'gp-mobile' ).removeClass( 'gp-desktop' ).removeClass( 'gp-tablet-portrait' ).removeClass( 'gp-tablet-landscape' ); 14 15 } else if ( $(window).innerWidth() <= 982 && $( 'body' ).hasClass( 'gp-responsive' ) ) { 16 17 $( 'body' ).addClass( 'gp-tablet-portrait' ).removeClass( 'gp-desktop' ).removeClass( 'gp-tablet-landscape' ).removeClass( 'gp-mobile' ); 18 19 } else if ( $(window).innerWidth() <= 1082 && $( 'body' ).hasClass( 'gp-responsive' ) ) { 20 21 $( 'body' ).addClass( 'gp-tablet-landscape' ).removeClass( 'gp-desktop' ).removeClass( 'gp-tablet-portrait' ).removeClass( 'gp-mobile' ); 22 23 } else { 24 25 $( 'body' ).addClass( 'gp-desktop' ).removeClass( 'gp-tablet-landscape' ).removeClass( 'gp-tablet-portrait' ).removeClass( 'gp-mobile' ); 26 27 } 28 29 } 30 31 gpScreenSizeClass(); 32 $( window ).resize( gpScreenSizeClass ); 33 34 35 /*-------------------------------------------------------------- 36 Retina images 37 --------------------------------------------------------------*/ 38 39 if ( $( 'body' ).hasClass( 'gp-retina' ) ) { 40 41 window.devicePixelRatio >= 2 && $( '.post-thumbnail img' ).each( function() { 42 $( this ).attr( { src: $( this ).attr( 'data-rel' ) } ); 43 }); 44 45 window.devicePixelRatio >= 2 && $( '.image-loop img' ).each(function() { 46 $( this ).attr( { 'data-original': $( this ).attr( 'data-rel' ) } ); 47 }); 48 49 window.devicePixelRatio >= 2 && $( '.gp-slider .slides > li a' ).each(function(){ 50 var bgImage = $(this).attr( 'data-rel' ); 51 $(this).css( 'background-image', 'url(' + bgImage + ')' ); 52 }); 53 54 } 55 56 57 /*-------------------------------------------------------------- 58 Slide up/down header mobile navigation 59 --------------------------------------------------------------*/ 60 61 function gpHeaderMobileNav() { 62 63 $( '#header-mobile-nav-button' ).toggle( function() { 64 $( '#mobile-nav' ).stop().slideDown(); 65 $( '#header-mobile-nav-button' ).addClass( 'gp-active' ); 66 }, function() { 67 $( '#mobile-nav' ).stop().slideUp(); 68 $( '#header-mobile-nav-button' ).removeClass( 'gp-active' ); 69 }); 70 71 } 72 73 gpHeaderMobileNav(); 74 $( window ).resize( gpHeaderMobileNav ); 75 76 77 /*-------------------------------------------------------------- 78 Slide up/down hub tabs mobile navigation 79 --------------------------------------------------------------*/ 80 81 function gpTabsMobileNav() { 82 83 $( '#hub-tabs #hub-tabs-mobile-nav-button' ).toggle( function() { 84 $( '#hub-tabs ul' ).stop().slideDown(); 85 $( '#hub-tabs-mobile-nav-button' ).addClass( 'gp-active' ); 86 }, function() { 87 $( '#hub-tabs ul' ).stop().slideUp(); 88 $( '#hub-tabs-mobile-nav-button' ).removeClass( 'gp-active' ); 89 }); 90 91 } 92 93 gpTabsMobileNav(); 94 $( window ).resize( gpTabsMobileNav ); 95 96 97 /*-------------------------------------------------------------- 98 Smooth scroll 99 --------------------------------------------------------------*/ 100 101 if ( $( 'body' ).hasClass( 'gp-smooth-scrolling' ) && $( window ).width() > 767 && $( 'body' ).outerHeight( true ) > $( window ).height() ) { 102 $( 'html' ).niceScroll({ 103 scrollspeed: 100, 104 mousescrollstep: 40, 105 cursorwidth: 10, 106 cursorborder: '0', 107 zindex: 10000, 108 cursoropacitymin: 0, 109 cursoropacitymax: 0.6 110 }); 111 } 112 113 114 /*-------------------------------------------------------------- 115 Dropdown Hover Effect 116 --------------------------------------------------------------*/ 117 118 $( '.nav .menu > li' ).hover( 119 function() { 120 $( this ).children( '.sub-menu' ).stop().animate( { opacity: 1 }, 600 ); 121 }, 122 function() { 123 $( this ).children( '.sub-menu' ).stop().animate( { opacity: 0 }, 600 ); 124 } 125 ); 126 127 128 /*-------------------------------------------------------------- 129 Dropdown menu icons 130 --------------------------------------------------------------*/ 131 132 $( '#main-nav .menu > li' ).each( function() { 133 if ( $( this ).find( 'ul' ).length > 0 ) { 134 $( '<i class="dropdown-icon fa fa-caret-down" />' ).appendTo( $( this ).children( ':first' ) ); 135 } 136 }); 137 138 $( '#main-nav .menu > li:not(.megamenu) ul > li' ).each( function() { 139 if ( $( this ).find( 'ul' ).length > 0 ) { 140 $( '<i class="dropdown-icon fa fa-caret-right" />' ).appendTo( $( this ).children( ':first' ) ); 141 } 142 }); 143 144 145 /*-------------------------------------------------------------- 146 Mega menus text/image support 147 --------------------------------------------------------------*/ 148 149 if ( $( '.megamenu' ).length > 0 ) { 150 151 $( '.nav-text > a' ).contents().unwrap(); 152 153 $( '.nav .megamenu .sub-menu .sub-menu li.nav-image' ).each( function() { 154 if ( $( this ).find( 'a' ).length > 0 ) { 155 var src = $( this ).find( 'a' ).attr( 'href' ); 156 $( '<img class="menu-image" alt="">' ).insertAfter( $( this ).children( ':first' ) ); 157 $( this ).find( '.menu-image' ).attr( 'src', src ); 158 $( this ).find( 'a' ).remove(); 159 } 160 }); 161 162 $( '#mobile-nav .nav-image' ).hide(); 163 164 } 165 166 167 /*-------------------------------------------------------------- 168 Parallax Effect 169 --------------------------------------------------------------*/ 170 171 if( $( 'div' ).hasClass( 'gp-parallax' ) || $( 'header' ).hasClass( 'gp-parallax' ) ) { 172 $( window ).stellar( { 173 responsive: true, 174 horizontalScrolling: false 175 }); 176 } 177 178 179 /*-------------------------------------------------------------- 180 Masonry blog 181 --------------------------------------------------------------*/ 182 183 if ( $( '.blog-wrapper' ).hasClass( 'blog-masonry' ) ) { 184 185 var container = $( '.blog-masonry .inner-loop' ); 186 var element = container; 187
188 if ( container.find( 'img' ).length == 0 ) { 189 element = $( '<img />' ); 190 } 191 192 imagesLoaded( element, function( instance ) { 193 194 container.isotope({ 195 itemSelector: '.post-item', 196 masonry: { 197 columnWidth: container.find( '.post-item' )[0], 198 gutter: 20 199 } 200 }); 201 202 container.animate( { 'opacity': 1 }, 1300 ); 203 $( 'ul.page-numbers' ).animate( { 'opacity': 1 }, 1300 ); 204 205 }); 206 207 } 208 209 210 /*-------------------------------------------------------------- 211 Lazyload Images 212 --------------------------------------------------------------*/ 213 214 if ( $( 'div' ).hasClass( 'images-wrapper' ) ) { 215 216 $( '.image-loop img' ).lazyload({ 217 effect: 'fadeIn' 218 }); 219 220 $( '.images-wrapper').animate( { 'opacity': 1 }, 1300 ); 221 222 } 223 224 225 /*-------------------------------------------------------------- 226 Remove gallery shortcode when gallery slider active 227 --------------------------------------------------------------*/ 228 229 $( '.gallery-slider-active .gallery' ).remove(); 230 231 232 /*-------------------------------------------------------------- 233 Back to top button 234 --------------------------------------------------------------*/ 235 236 if ( $( 'body' ).hasClass( 'gp-back-to-top' ) ) { 237 $().UItoTop({ 238 text: '<i class="fa fa-chevron-up"></i>', 239 scrollSpeed: 600 240 }); 241 } 242 243 244 /*-------------------------------------------------------------- 245 prettyPhoto lightbox 246 --------------------------------------------------------------*/ 247 248 $(' a[class^="prettyPhoto"]' ).prettyPhoto({ 249 theme: 'pp_default', 250 deeplinking: false, 251 social_tools: '', 252 default_width: '768' 253 }); 254 255 256 /*-------------------------------------------------------------- 257 Remove WooCommerce Comment Meta Dash 258 --------------------------------------------------------------*/ 259 260 $( '.comment-text .meta' ).html( function( index, text ) { 261 return text.replace( 'â', '' ); 262 }); 263 264 265 /*-------------------------------------------------------------- 266 WooCommerce image overlay 267 --------------------------------------------------------------*/ 268 269 $( '.product-image-container .image-overlay' ).css( 'opacity', 0 ).hover( function() { 270 $( this ).fadeTo( 'fast', 1 ); 271 }, function() { 272 $( this ).fadeTo( 'fast', 0 ); 273 }); 274 275 276 /*-------------------------------------------------------------- 277 Set slider height to auto 278 --------------------------------------------------------------*/ 279 280 $( window ).load( function() { 281 if ( $(window).innerWidth() > 1082 ) { 282 $( '#homepage-slider' ).css( 'height', 'auto' ); 283 } 284 }); 285 286 287 /*-------------------------------------------------------------- 288 Title header video 289 --------------------------------------------------------------*/ 290 291 if ( $( '.entry-header' ).hasClass( 'video-header' ) ) { 292 headerVideo.init({ 293 mainContainer: $( '.large-header.entry-header' ), 294 videoContainer: $( '.header-video' ), 295 header: $( '.header-video-media' ), 296 videoTrigger: $( '.play-video-button' ), 297 autoPlayVideo: false 298 }); 299 } 300 301 /*-------------------------------------------------------------- 302 Resize header 303 --------------------------------------------------------------*/ 304 305 function gpResizeHeader() { 306 307 // Before Scrolling 308 309 if ( ( $( window ).innerWidth() <= 982 && $( 'body' ).hasClass( 'gp-responsive' ) ) || ( $( window ).scrollTop() > 0 && $( 'body' ).hasClass( 'gp-desktop' ) ) ) { 310 311 $( '.gp-header-standard #main-header' ).data( 'size', 'small' ).addClass( 'header-small' ).removeClass( 'header-large' ).stop().css({ 312 height: parseInt( gp_script.smallHeaderHeight ) 313 }); 314 315 $( '.gp-header-centered #main-header' ).data( 'size', 'small' ).addClass( 'header-small' ).removeClass( 'header-large' ).stop().css({ 316 height: parseInt( gp_script.smallHeaderHeight ) + parseInt( gp_script.logoMarginTop ) / gp_script.headerSizeReduction + parseInt( gp_script.logoMarginBottom ) / gp_script.headerSizeReduction 317 }); 318 319 $( '#main-header #logo' ).stop().css({ 320 marginTop: parseInt( gp_script.logoMarginTop ) / gp_script.headerSizeReduction, 321 marginBottom: parseInt( gp_script.logoMarginBottom ) / gp_script.headerSizeReduction 322 }); 323 324 $( '#main-header #logo img' ).stop().css({ 325 height: parseInt( gp_script.logoHeight ) / gp_script.headerSizeReduction 326 }); 327 328 329 $( '#fixed-header-padding' ).stop().css({ 330 paddingTop: parseInt( gp_script.smallHeaderHeight ) 331 }); 332 333 } else { 334 335 $( '.gp-header-standard #main-header' ).data( 'size', 'large' ).addClass( 'header-large' ).removeClass( 'header-small' ).stop().css({ 336 height: gp_script.headerHeight 337 }); 338 339 $( '.gp-header-centered #main-header' ).data( 'size', 'large' ).addClass( 'header-large' ).removeClass( 'header-small' ).stop().css({ 340 height: parseInt( gp_script.headerHeaderHeight ) + parseInt( gp_script.logoMarginTop ) + parseInt( gp_script.logoMarginBottom ) 341 }); 342 343 $( '#main-header #logo' ).stop().css({ 344 marginTop: parseInt( gp_script.logoMarginTop ), 345 marginBottom: parseInt( gp_script.logoMarginBottom ) 346 }); 347 348 $( '#main-header #logo img' ).stop().css({ 349 height: parseInt( gp_script.logoHeight ) 350 }); 351 352 353 $( '#fixed-header-padding' ).stop().css({ 354 paddingTop: parseInt( gp_script.headerHeight ) 355 }); 356 357 } 358 359 // Upon Scrolling 360 361 $( window ).scroll( function() { 362 363 if ( $( 'body' ).hasClass( 'gp-desktop' ) && $( 'body' ).hasClass( 'gp-fixed-header' ) && $( 'body' ).hasClass( 'gp-header-resize' ) ) { 364 365 if ( $( document ).scrollTop() > 50 ) { 366 367 if ( $( '#main-header' ).data( 'size' ) == 'large' ) { 368 369 $( '.gp-header-standard #main-header' ).data( 'size', 'small' ).addClass( 'header-small' ).removeClass( 'header-large' ).stop().animate({ 370 height: parseInt( gp_script.smallHeaderHeight ) 371 }, 300 ); 372 373 $( '.gp-header-centered #main-header' ).data( 'size', 'small' ).addClass( 'header-small' ).removeClass( 'header-large' ).stop().animate({ 374 height: parseInt( gp_script.smallHeaderHeight ) + parseInt( gp_script.logoMarginTop ) / gp_script.headerSizeReduction + parseInt( gp_script.logoMarginBottom ) / gp_script.headerSizeReduction 375 }, 300 ); 376 377 $( '#main-header #logo' ).stop().animate({ 378 marginTop: parseInt( gp_script.logoMarginTop ) / gp_script.headerSizeReduction, 379 marginBottom: parseInt( gp_script.logoMarginBottom ) / gp_script.headerSizeReduction 380 }, 300 ); 381 382 $( '#main-header #logo img' ).stop().animate({ 383 height: parseInt( gp_script.logoHeight ) / gp_script.headerSizeReduction 384 }, 300 ); 385 386 387 $( '#fixed-header-padding' ).stop().animate({ 388 paddingTop: parseInt( gp_script.smallHeaderHeight ) 389 }, 400 ); 390 391 } 392 393 } else { 394 395 if ( $( '#main-header' ).data( 'size' ) == 'small' ) { 396 397 $( '.gp-header-standard #main-header' ).data( 'size', 'large' ).addClass( 'header-large' ).removeClass( 'header-small' ).stop().animate({ 398 height: gp_script.headerHeight 399 }, 300 ); 400 401 $( '.gp-header-centered #main-header' ).data( 'size', 'large' ).addClass( 'header-large' ).removeClass( 'header-small' ).stop().animate({ 402 height: parseInt( gp_script.headerHeaderHeight ) + parseInt( gp_script.logoMarginTop ) + parseInt( gp_script.logoMarginBottom ) 403 }, 300 ); 404 405 $( '#main-header #logo' ).stop().animate({ 406 marginTop: parseInt( gp_script.logoMarginTop ), 407 marginBottom: parseInt( gp_script.logoMarginBottom ) 408 }, 300 ); 409 410 $( '#main-header #logo img' ).stop().animate({ 411 height: parseInt( gp_script.logoHeight ) 412 }, 300 ); 413 414 415 $( '#fixed-header-padding' ).stop().animate({ 416 paddingTop: parseInt( gp_script.headerHeight ) 417 }, 400 ); 418 419 } 420 421 } 422 423 } 424 425 }); 426 427 } 428 429 gpResizeHeader(); 430 $( window ).resize( gpResizeHeader ); 431 432});
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.