1/* 2 * Corpkit Theme Js 3 */ 4 5(function( $ ) { 6 7 "use strict"; 8 9 var corpkit_body_atts = corpkit_ajax_var.body_atts; 10 var responsive_width = corpkit_body_atts && corpkit_body_atts.res_width ? corpkit_body_atts.res_width : 360; 11 12 $( document ).ready(function() { 13 14 /* Set Header Height */ 15 var $window = $(window); 16 var $header_cont = $('.portfolio-single-wrapper .portfolio-single-slide .item'); 17 $header_cont.height( $window.height() ); 18 $window.resize(function() { 19 $header_cont.height( $window.height() ); 20 }); 21 22 /* Shortcode CSS Append */ 23 var css_out = ''; 24 $( ".corpkit-inline-css" ).each(function() { 25 var shortcode = $( this ); 26 if( shortcode.attr("data-css") ){ 27 var shortcode_css = shortcode.attr("data-css"); 28 css_out += ($).parseJSON( shortcode_css ); 29 shortcode.removeAttr("data-css"); 30 } 31 }); 32 33 if( css_out != '' ){ 34 $('head').append( '<style id="corpkit-shortcode-styles">'+ css_out +'</style>' ); 35 } 36 37 /* Secondary Toggle */ 38 $( document ).on( "click", ".secondary-space-toggle", function() { 39 $('.secondary-space-toggle').toggleClass('active'); 40 $('body').toggleClass('secondary-active'); 41 var sec_width = $( ".secondary-menu-area" ).width(); 42 var sec_pos = $( ".secondary-menu-area" ).data('pos') ? $( ".secondary-menu-area" ).data('pos') : 'left'; 43 44 if( sec_pos == 'overlay' ){ 45 $( ".secondary-menu-area" ).fadeToggle(500); 46 }else if( $('body').hasClass('secondary-active') ){ 47 if( sec_pos == 'left' ){ 48 if( $( ".secondary-menu-area" ).hasClass('left-overlay') ){ 49 $( ".secondary-menu-area" ).animate( { left : "0" }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } ); 50 }else{ 51 $('body').toggleClass('secondary-push-actived'); 52 $( ".secondary-menu-area" ).animate( { left : "0" }, { duration: 500 } ); 53 $( "body" ).css('overflow','hidden'); 54 $( "body .corpkit-wrapper" ).animate( { left : sec_width +"px" }, 500 ); 55 if( $( ".sticky-outer" ).length ) { 56 $( ".sticky-outer .header-sticky, .sticky-outer .show-menu" ).animate( { left : sec_width +"px", right: "-" + sec_width +"px" }, 500 ); 57 } 58 } 59 }else{ 60 if( $( ".secondary-menu-area" ).hasClass('right-overlay') ){ 61 $( ".secondary-menu-area" ).animate( { right : "0" }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } ); 62 }else{ 63 $('body').toggleClass('secondary-push-actived'); 64 $( ".secondary-menu-area" ).animate( { right : "0" }, { duration: 500 } ); 65 $( "body" ).css('overflow','hidden'); 66 $( "body .corpkit-wrapper" ).animate( { right : sec_width +"px" }, 500 ); 67 if( $( ".sticky-outer" ).length ){ 68 $( ".sticky-outer .header-sticky, .sticky-outer .show-menu" ).animate( { right : sec_width +"px", left : "-" + sec_width +"px" }, 500 ); 69 } 70 } 71 } 72 }else{ 73 if( sec_pos == 'left' ){ 74 if( $( ".secondary-menu-area" ).hasClass('left-overlay') ){ 75 $( ".secondary-menu-area" ).animate( { left : "-"+ sec_width +"px" }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } ); 76 }else{ 77 $('body').toggleClass('secondary-push-actived'); 78 $( ".secondary-menu-area" ).animate( { left : "-"+ sec_width +"px" }, { duration: 500 } ); 79 $( "body .corpkit-wrapper" ).animate( { left : 0 }, 500, function(){ $( "body" ).css('overflow-y','scroll'); } ); 80 if( $( ".sticky-outer" ).length ){ 81 $( ".sticky-outer .header-sticky, .sticky-outer .show-menu" ).animate( { left : 0, right: 0 }, 500 ); 82 } 83 } 84 }else{ 85 if( $( ".secondary-menu-area" ).hasClass('right-overlay') ){ 86 $( ".secondary-menu-area" ).animate( { right : "-"+ sec_width +"px" }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } ); 87 }else{ 88 $('body').toggleClass('secondary-push-actived'); 89 $( ".secondary-menu-area" ).animate( { right : "-"+ sec_width +"px" }, { duration: 500 } ); 90 $( "body .corpkit-wrapper" ).animate( { right : 0 }, 500, function(){ $( "body" ).css('overflow-y','scroll'); } ); 91 if( $( ".sticky-outer" ).length ){ 92 $( ".sticky-outer .header-sticky, .sticky-outer .show-menu" ).animate( { right: 0, left : 0 }, 500 ); 93 } 94 } 95 } 96 } 97 98 /* Slider Revolution Issue Fixed */ 99 if( $(".rev_slider_wrapper").length ){ 100 $(".rev_slider_wrapper").css("left" , "inherit"); 101 } 102 103 return false; 104 }); 105 106 //Sticky code from 107 108 /* Sticky Header Space Menu to Modern Toggle Menu Convert */ 109 if( $('.sticky-header-space').length ){ 110 111 //Add toggle dropdown icon 112 $( ".sticky-header-space .corpkit-main-menu" ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle ti-plus"></span>' ); 113 $( ".sticky-header-space .corpkit-main-menu" ).find('.sub-menu').slideToggle(); 114 115 //zmm dropdown toggle 116 $( ".sticky-header-space .zmm-dropdown-toggle" ).on( "click", function() { 117 var parent = $( this ).parent('li').children('.sub-menu'); 118 $( this ).parent('li').children('.sub-menu').slideToggle(); 119 $( this ).toggleClass('ti-minus'); 120 if( $( parent ).find('.sub-menu').length ){ 121 $( parent ).find('.sub-menu').slideUp(); 122 $( parent ).find('.zmm-dropdown-toggle').removeClass('ti-minus'); 123 } 124 }); 125 126 } 127 128 //Custom Responsive Width 129 var win_width = $(window).width(); 130 if( responsive_width ){ 131 corpkit_set_custom_hidden_elements( win_width, responsive_width ); 132 } 133 134 /* Full Search Toggle */ 135 $( document ).on( "click", ".full-search-toggle", function() { 136 $('.full-search-wrapper').toggleClass("search-wrapper-opened"); 137 $('.full-search-wrapper').fadeToggle(500); 138 var search_in = $('.search-wrapper-opened').find("input.form-control"); 139 search_in.focus(); 140 return false; 141 }); 142 143 /* Mobile Bar Animate Toggle */ 144 $( document ).on( "click", ".mobile-bar-toggle", function() { 145 $( ".mobile-bar" ).toggleClass('active'); 146 $( "body" ).toggleClass('mobile-bar-active'); 147 if( $( ".mobile-bar" ).hasClass('animate-from-left') ){ 148 if( $( ".mobile-bar" ).hasClass('active') ) 149 $( ".mobile-bar" ).animate( { left : 0 }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } ); 150 else 151 $( ".mobile-bar" ).animate( { left : "-100%" }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } ); 152 } 153 if( $( ".mobile-bar" ).hasClass('animate-from-right') ){ 154 if( $( ".mobile-bar" ).hasClass('active') ) 155 $( ".mobile-bar" ).animate( { right : 0 }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } ); 156 else 157 $( ".mobile-bar" ).animate( { right : "-100%" }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } ); 158 } 159 if( $( ".mobile-bar" ).hasClass('animate-from-top') ){ 160 if( $( ".mobile-bar" ).hasClass('active') ) 161 $( ".mobile-bar" ).animate( { top : 0 }, { duration: 500, specialEasing: { top: "easeInOutExpo" } } ); 162 else 163 $( ".mobile-bar" ).animate( { top : "-100%" }, { duration: 500, specialEasing: { top: "easeInOutExpo" } } ); 164 } 165 if( $( ".mobile-bar" ).hasClass('animate-from-bottom') ){ 166 if( $( ".mobile-bar" ).hasClass('active') ) 167 $( ".mobile-bar" ).animate( { bottom : 0 }, { duration: 500, specialEasing: { bottom: "easeInOutExpo" } } ); 168 else 169 $( ".mobile-bar" ).animate( { bottom : "-100%" }, { duration: 500, specialEasing: { bottom: "easeInOutExpo" } } ); 170 } 171 return false; 172 }); 173 174 /* Mobile Bar Menu to Modern Toggle Menu Convert */ 175 if( $('.mobile-bar').length ){ 176 177 if( $( ".corpkit-main-menu" ).length || $( ".secondary-menu-area-inner ul.menu" ).length ){ 178 179 var main_menu = ".corpkit-main-menu"; 180 if( !$( ".corpkit-main-menu" ).length ){ 181 $( ".secondary-menu-area-inner ul.menu" ).addClass( "corpkit-main-menu" ); 182 } 183 184 var mobile_menu = ".mobile-bar .corpkit-mobile-main-menu"; 185 var find_classes = ".dropdown, .mega-dropdown, .dropdown-toggle, .dropdown-menu, .mega-dropdown-menu, .mega-child-heading, .mega-child-dropdown, .mega-child-dropdown-menu, .hidden-xs-up, .row, .mega-sub-dropdown, .mega-sub-dropdown-menu, .mega-sub-child, .mega-sub-child-inner, .left-side"; 186 var removable_classes = "dropdown mega-dropdown dropdown-toggle dropdown-menu mega-dropdown-menu mega-child-heading mega-child-dropdown mega-child-dropdown-menu hidden-xs-up row mega-sub-dropdown mega-sub-dropdown-menu mega-sub-child mega-sub-child-inner left-side"; 187 188 //Mobile menu copy from main menu 189 if( $(mobile_menu).html() == '' ) $(main_menu).clone().appendTo( mobile_menu ); 190 191 //Add main class name 192 $( mobile_menu + " " + main_menu ).addClass( "flex-column" ); 193 194 //Remove unwanted item from mobile menu 195 $( mobile_menu + " .mega-child-widget" ).parent( "li.menu-item" ).remove(); 196 $( mobile_menu + " .mega-child-divider" ).remove(); 197 $( mobile_menu + " .menu-item-logo" ).remove(); 198 $( mobile_menu + " li.menu-item" ).removeClass (function (index, css) { 199 return ( css.match (/\bcol-\S+/g) || [] ).join(' '); 200 201 }); 202 $( mobile_menu + " li.menu-item" ).removeClass (function (index, css) { 203 return ( css.match (/\bmax-col-\S+/g) || [] ).join(' '); 204 }); 205 206 //Change class name 207 $( mobile_menu ).find( ".dropdown-menu, .mega-child-dropdown-menu, .mega-sub-child-inner" ).toggleClass( "sub-menu" ); 208 209 //Content reform 210 $( mobile_menu + " .mega-child-item-disabled" ).replaceWith( "<a class='nav-link' href='#'>" + $( mobile_menu + " .mega-child-item-disabled" ).html() + "</a>" ); 211 212 //Remove unwanted classes 213 $( mobile_menu ).find( find_classes ).removeClass( removable_classes ); 214
215 //Remove Background 216 $( mobile_menu + " .sub-menu" ).css('background','none'); 217 218 //Add toggle dropdown icon 219 //$( ".mobile-bar " + main_menu ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle ti-plus"></span>' ); 220 221 $( ".mobile-bar " + main_menu ).find('li.menu-item > ul.sub-menu').each(function() { 222 $(this).parent("li").append( '<span class="zmm-dropdown-toggle ti-plus"></span>' ); 223 224 }); 225 226 $( ".mobile-bar " + main_menu ).find('.sub-menu').slideToggle(); 227 228 $( ".mobile-bar " + main_menu ).removeClass('corpkit-main-menu').addClass('corpkit-mobile-menu'); 229 230 //dropdown toggle 231 $( ".mobile-bar .zmm-dropdown-toggle" ).on( "click", function() { 232 var parent = $( this ).parent('li').children('.sub-menu'); 233 $( this ).parent('li').children('.sub-menu').slideToggle(); 234 $( this ).toggleClass('ti-minus'); 235 if( $( parent ).find('.sub-menu').length ){ 236 $( parent ).find('.sub-menu').slideUp(); 237 $( parent ).find('.zmm-dropdown-toggle').removeClass('ti-minus'); 238 } 239 }); 240 }// check page have main menu or not 241 242 } 243 244 /* Mobile Bar Menu to Modern Toggle Menu Convert */ 245 if( $('.secondary-menu-area-inner ul.menu').length ){ 246 247 var sec_menu = ".secondary-menu-area-inner ul.menu"; 248 //Add main class name 249 $( sec_menu ).addClass( "flex-column" ); 250 251 //Add toggle dropdown icon 252 $( sec_menu ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle ti-plus"></span>' ); 253 $( sec_menu ).find('.sub-menu').slideToggle(); 254 255 //dropdown toggle 256 $( sec_menu + " .zmm-dropdown-toggle" ).on( "click", function() { 257 var parent = $( this ).parent('li').children('.sub-menu'); 258 $( this ).parent('li').children('.sub-menu').slideToggle(); 259 $( this ).toggleClass('ti-minus'); 260 if( $( parent ).find('.sub-menu').length ){ 261 $( parent ).find('.sub-menu').slideUp(); 262 $( parent ).find('.zmm-dropdown-toggle').removeClass('ti-minus'); 263 } 264 }); 265 266 } 267 268 /* Menu Scroll */ 269 var cur_offset = 0; 270 271 var o_stat = 0; // One Page Menu Status 272 $( '.corpkit-main-menu li.menu-item, .corpkit-mobile-menu li.menu-item' ).each(function( index ) { 273 var cur_item = this; 274 var target = $(cur_item).children("a").attr("href"); 275 if( target && target.indexOf("#section-") != -1 ){ 276 o_stat = 1; 277 var res = target.split("#"); 278 if( res.length == 2 ){ 279 $(cur_item).children("a").attr("data-target", res[0]); 280 $(cur_item).children("a").attr("href", "#"+res[1]); 281 } 282 } 283 }); 284 285 if( o_stat ){ 286 287 if( $('.corpkit-main-menu .menu-item').find('a[href="#section-top"]').length ){ 288 $("body").attr("id","section-top"); 289 } 290 291 $( '.corpkit-main-menu li.menu-item, .corpkit-mobile-menu li.menu-item' ).removeClass("current-menu-item"); 292 293 $(window).on('scroll', function () { 294 var minus_height = $("#wpadminbar").length ? $("#wpadminbar").outerHeight() : 0; 295 minus_height += win_width >= corpkit_body_atts.res_width ? parseInt( corpkit_body_atts.menu_offset ) + 1 : parseInt( corpkit_body_atts.mobile_menu_offset ); 296 $('section.elementor-section[id*="section-"], body').each(function () { 297 var anchored = $(this).attr("id"), 298 targetOffset = $(this).offset().top - minus_height; 299 300 if ($(window).scrollTop() > targetOffset) { 301 $('.corpkit-main-menu .menu-item').find("a").removeClass("active"); 302 $('.corpkit-main-menu .menu-item').find('a[href="#'+ anchored +'"]').addClass("active"); 303 304 //Mobile menu scroll spy active 305 $('.corpkit-mobile-menu .menu-item').find("a").removeClass("active"); 306 $('.corpkit-mobile-menu .menu-item').find('a[href="#'+ anchored +'"]').addClass("active"); 307 } 308 }); 309 }); 310 311 $( '.corpkit-main-menu .menu-item > a[href^="#section-"], .corpkit-mobile-main-menu .menu-item > a[href^="#section-"]' ).on('click',function (e) { 312 313 var cur_item = this; 314 var target = $(cur_item).attr("href"); 315 316 if( $(cur_item).parents(".corpkit-mobile-main-menu").length ) { 317 $(".mobile-bar-toggle.close").trigger( "click" ); 318 } 319 if( $( ".secondary-menu-area" ) ){ 320 $( ".secondary-menu-area .secondary-space-toggle.active" ).trigger( "click" ); 321 } 322 323 var target_id = target.slice( target.indexOf("#"), ( target.length ) ); 324 var cur_url = location.protocol + '//' + location.host + location.pathname; //window.location.href; 325 var data_targ = $(cur_item).attr("data-target"); 326 var another_page = false; 327 if( target_id == '#section-top' && data_targ != '' ){ 328 if( cur_url != data_targ ){ 329 another_page = true; 330 } 331 } 332 333 if( $( target_id ).length && !another_page ){ 334 335 var minus_height = $("#wpadminbar").length ? $("#wpadminbar").outerHeight() : 0; 336 minus_height += win_width >= corpkit_body_atts.res_width ? parseInt( corpkit_body_atts.menu_offset ) : parseInt( corpkit_body_atts.mobile_menu_offset );
337 var offs = $(target_id).offset().top - minus_height; 338 var sec_ani_call = 1; 339 if( target_id == '#section-top' ){ 340 sec_ani_call = 1; 341 offs = 0; 342 } 343 $('html,body').animate({ 'scrollTop': offs }, 0, 'easeInOutExpo' ); 344 345 return false; 346 }else{ 347 348 if( target_id == '#section-top' && cur_url == data_targ ){ 349 $('html,body').animate({ 'scrollTop': 0 }, 0, 'easeInOutExpo' ); 350 return false; 351 }else{ 352 if( cur_url != data_targ && target_id != '#' ){ 353 window.location.href = data_targ + target; 354 }else{ 355 window.location.href = target; 356 } 357 } 358 359 } 360 361 }); 362 363 } 364 365 /*Back to top*/ 366 if( $( ".back-to-top" ).length ){ 367 $( document ).on('click', '#back-to-top', function(){ 368 $('html,body').animate({ 'scrollTop': 0 }, 0, 'easeInOutExpo' ); 369 return false; 370 }); 371 $( document ).scroll(function() { 372 var y = $( this ).scrollTop(); 373 if ( y > 300 ) 374 $( '#back-to-top' ).fadeIn(); 375 else 376 $( '#back-to-top' ).fadeOut(); 377 }); 378 } 379 380 /* Top Sliding Bar */ 381 if( $( ".top-sliding-bar" ).length ){ 382 $( document ).on('click', '.top-sliding-toggle', function(){ 383 $( ".top-sliding-bar-inner" ).slideToggle(); 384 $( ".top-sliding-toggle" ).toggleClass( "ti-minus" ); 385 return false; 386 }); 387 } 388 389 /* Sticky Header Space */ 390 if( $('.sticky-header-space').length ){ 391 var elem_pos = $('.sticky-header-space').hasClass('left-sticky') ? 'left' : 'right'; 392 var elem_width = $('.sticky-header-space').outerWidth(); 393 394 corpkit_sticky_header_adjust(elem_pos, elem_width); 395 $( window ).resize(function() { 396 corpkit_sticky_header_adjust(elem_pos, elem_width); 397 }); 398 } 399 400 /* Toggle Search Modal Triggers */ 401 if( $( ".textbox-search-toggle" ).length ){ 402 $( document ).on('click', '.textbox-search-toggle', function(){ 403 $(this).parents('.search-toggle-wrap').toggleClass('active'); 404 return false; 405 }); 406 }else if( $( ".full-bar-search-toggle" ).length ){ 407 $( document ).on('click', '.full-bar-search-toggle', function(){ 408 $('.full-bar-search-wrap').toggleClass('active'); 409 setTimeout(function(){ 410 var search_in = $('.full-bar-search-wrap').find("input.form-control"); 411 search_in.focus(); 412 }, 350); 413 return false; 414 }); 415 }else if( $( ".bottom-search-toggle" ).length ){ 416 $( document ).on('click', '.bottom-search-toggle', function(){ 417 $(this).parents('.search-toggle-wrap').toggleClass('active'); 418 return false; 419 }); 420 } 421 422 /* Sticky Footer */ 423 if( $( ".footer-fixed" ).length ){ 424 if( $( window ).width() > 1023 ){ 425 $( ".corpkit-wrapper" ).css({ 'margin-bottom' : $( ".footer-fixed" ).outerHeight() + 'px' }); 426 }else{ 427 $( ".corpkit-wrapper" ).css({ 'margin-bottom' : '0' }); 428 } 429 }else if( $( ".footer-bottom-fixed" ).length ){ 430 if( $( window ).width() > 1023 ){ 431 $( ".corpkit-wrapper" ).css({ 'margin-bottom' : $( ".footer-bottom-fixed" ).outerHeight() + 'px' }); 432 }else{ 433 $( ".corpkit-wrapper" ).css({ 'margin-bottom' : '0' }); 434 } 435 } 436 $( window ).resize(function() { 437 if( $( ".footer-fixed" ).length ){ 438 if( $( window ).width() > 1023 ){ 439 $( ".corpkit-wrapper" ).css({ 'margin-bottom' : $( ".footer-fixed" ).outerHeight() + 'px' }); 440 }else{ 441 $( ".corpkit-wrapper" ).css({ 'margin-bottom' : '0' }); 442 } 443 }else if( $( ".footer-bottom-fixed" ).length ){ 444 if( $( window ).width() > 1023 ){ 445 $( ".corpkit-wrapper" ).css({ 'margin-bottom' : $( ".footer-bottom-fixed" ).outerHeight() + 'px' }); 446 }else{ 447 $( ".corpkit-wrapper" ).css({ 'margin-bottom' : '0' }); 448 } 449 } 450 }); 451 452 /* Stellar Parallax */ 453 if( $(".parallax-item").length ){ 454 $.stellar({ 455 horizontalScrolling: false, 456 verticalOffset: 40 457 }); 458 } 459 460 /* Magnific Zoom Gallery Code */ 461 if( $('.zoom-gallery').length ){ 462 $('.zoom-gallery').magnificPopup({ 463 delegate: 'a', 464 type: 'image', 465 closeOnContentClick: false, 466 closeBtnInside: false, 467 mainClass: 'mfp-with-zoom mfp-img-mobile', 468 gallery: { 469 enabled: true 470 }, 471 zoom: { 472 enabled: true, 473 duration: 300, // don't foget to change the duration also in CSS 474 opener: function(element) { 475 return element.find('img'); 476 } 477 } 478 }); 479 } 480 481 if( $('.popup-video-post').length ){ 482 /* Magnific Popup Code */ 483 $('.popup-video-post').magnificPopup({ 484 disableOn: 700, 485 type: 'iframe', 486 mainClass: 'mfp-fade', 487 removalDelay: 160, 488 preloader: false,
489 fixedContentPos: false 490 }); 491 } 492 493 if( $('.popup-with-zoom-anim').length ){ 494 $('.popup-with-zoom-anim').magnificPopup({ 495 disableOn: 700, 496 type: 'inline', 497 mainClass: 'mfp-fade', 498 removalDelay: 160, 499 preloader: false, 500 fixedContentPos: false, 501 callbacks: { 502 open: function() { 503 // Play video on open: 504 if( !$( this.content ).find('video').length ){ 505 var parent = $( this.content ).parent( "post-video-wrap" ); 506 var url = $( this.content ).find('span').data( "url" ); 507 var video = '<video width="100%" height="450" preload="true" style="max-width:100%;" autoplay="true"><source src="'+ url +'" type="video/mp4"></video>'; 508 $( this.content ).find('span').replaceWith( video ); 509 }else{ 510 $(this.content).find('video')[0].load(); 511 } 512 }, 513 close: function() { 514 // Reset video on close: 515 $(this.content).find('video')[0].pause(); 516 517 } 518 } 519 }); 520 } 521 522 //corpkit Popup 523 if( $('.corpkit-popup-wrapper').length ){ 524 $('.corpkit-popup-trigger').magnificPopup({ 525 type: 'inline', 526 preloader: false, 527 //focus: '#username', 528 modal: true, 529 mainClass: 'mfp-fade', 530 removalDelay: 300 531 }); 532 $(document).on('click', '.corpkit-popup-dismiss', function (e) { 533 e.preventDefault(); 534 $.magnificPopup.close(); 535 }); 536 } 537 538 /* Set Blockquote Background */ 539 if( $( ".post-quote-wrap, .post-link-wrap" ).length ){ 540 $( ".post-quote-wrap, .post-link-wrap" ).each(function() { 541 var img_url = $(this).data('url'); 542 if( img_url ){ 543 $(this).css( 'background-image','url('+ img_url +')' ); 544 } 545 }); 546 } 547 548 /* Set Background Image */ 549 if( $( ".set-bg-img" ).length ){ 550 $( ".set-bg-img" ).each(function() { 551 var img_url = $(this).data('src'); 552 if( img_url ){ 553 $(this).css( 'background-image','url('+ img_url +')' ); 554 } 555 }); 556 } 557 558 /* Sticky Element */ 559 if( $( ".corpkit-sticky-wrapper" ).length ){ 560 $("a.corpkit-sticky-trigger").on( "click", function(e){ 561 $(this).parent(".corpkit-sticky-wrapper").toggleClass("active"); 562 return false; 563 }); 564 } 565 566 if( $('a.onclick-video-post').length ){ 567 $(document).on( "click", "a.onclick-video-post", function(){ 568 569 var parent = $(this).parent('.post-video-wrap'); 570 var frame = '<iframe src="'+ $(this).attr("href") +'?autoplay=1" width="100%" height="'+ parent.height() +'" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'; 571 $(this).fadeOut(300); 572 $(this).replaceWith( frame ); 573 return false; 574 }); 575 } 576 577 if( $('a.onclick-custom-video').length ){ 578 $(document).on( "click", ".onclick-custom-video", function(){ 579 580 var parent = $(this).parent('.post-video-wrap'); 581 var video = '<video width="100%" height="'+ parent.height() +'" preload="true" style="max-width:100%;" autoplay="true"><source src="'+ $(this).data("url") +'" type="video/mp4"></video>'; 582 $(this).fadeOut(300); 583 $(this).replaceWith( video ); 584 return false; 585 }); 586 } 587 588 /* Page Title Background Video */ 589 if( $( "#page-title-bg .page-title-wrap-inner" ).length ){ 590 $( "#page-title-bg .page-title-wrap-inner" ).YTPlayer(); 591 } 592 593 /* Comments Like/Dislike */ 594 if( $(".comment-like-wrapper").length ){ 595 $( document ).on( 'click', ".comment-like", function( event) { 596 597 var cmt_cur = $(this); 598 var cmt_meta = cmt_cur.data('id'); 599 var cmt_id = cmt_cur.data('cmt-id'); 600 var parent = cmt_cur.parents('.comment-like-wrapper'); 601 if( cmt_meta == '1' ){ 602 cmt_cur.parents('.list-inline').find('.comment-liked').removeClass('theme-color comment-liked').addClass('comment-like'); 603 cmt_cur.removeClass('comment-like').addClass('theme-color comment-liked'); 604 }else{ 605 cmt_cur.parents('.list-inline').find('.comment-liked').removeClass('theme-color comment-liked').addClass('comment-like'); 606 cmt_cur.removeClass('comment-like').addClass('theme-color comment-liked'); 607 } 608 609 if( cmt_id != '' && cmt_meta != '' ){ 610 // Ajax call 611 (jQuery).ajax({ 612 type: "post", 613 url: corpkit_ajax_var.admin_ajax_url, 614 data: "action=comment_like&nonce="+corpkit_ajax_var.cmt_nonce+"&cmt_id="+cmt_id+"&cmt_meta="+cmt_meta, 615 success: function(res){ 616 $( parent ).html(res); 617 }, 618 error: function (jqXHR, exception) { 619 console.log(jqXHR); 620 } 621 });
622 } 623 return false; 624 }); 625 } 626 627 /*Mailchimp Code*/ 628 if( $('.zozo-mc').length ){ 629 $('.zozo-mc').on( "click", function () { 630 631 var c_btn = $(this); 632 var mc_wrap = $( this ).parents('.mailchimp-wrapper'); 633 var mc_form = $( this ).parents('.zozo-mc-form'); 634 635 if( mc_form.find('input[name="zozo_mc_email"]').val() == '' ){ 636 mc_wrap.find('.mc-notice-msg').text( corpkit_ajax_var.must_fill ); 637 }else{ 638 c_btn.attr( "disabled", "disabled" ); 639 $.ajax({ 640 type: "POST", 641 url: corpkit_ajax_var.admin_ajax_url, 642 data: 'action=zozo-mc&nonce='+corpkit_ajax_var.mc_nounce+'&'+mc_form.serialize(), 643 success: function (data) { 644 //Success 645 c_btn.removeAttr( "disabled" ); 646 mc_wrap.find('.mc-notice-msg').removeClass("mc-success mc-failed"); 647 if( data == 'success' ){ 648 mc_wrap.find('.mc-notice-msg').addClass("mc-success"); 649 mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-success') ); 650 }else{ 651 mc_wrap.find('.mc-notice-msg').addClass("mc-failed"); 652 mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-fail') ); 653 } 654 },error: function(xhr, status, error) { 655 c_btn.removeAttr( "disabled" ); 656 mc_wrap.find('.mc-notice-msg').removeClass("mc-success mc-failed"); 657 mc_wrap.find('.mc-notice-msg').addClass("mc-failed"); 658 mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-fail') ); 659 } 660 }); 661 } 662 }); 663 } // if mailchimp exists 664 665 /* Facbook Comment Width Resize */ 666 if( $( '.fb-comments-wrapper' ).length ){ 667 $( window ).resize(function() { 668 setTimeout(function(){ 669 if($( window ).width() <= 768 ){ 670 $( ".fb-comments-wrapper iframe" ).width( $( ".content-area" ).width() ); 671 }else{ 672 $( ".fb-comments-wrapper iframe" ).width( $( ".content-area .fb-comments" ).data('width') ); 673 } 674 }, 200); 675 }); 676 } 677 678 if( $('.popover-wrapper .popover-trigger').length ){ 679 $(".popover-trigger").each(function( index ) { 680 var _evnt_name = $(this).attr("data-event") ? $(this).attr("data-event") : 'hover'; 681 if( _evnt_name == 'hover' ){ 682 $(this).on( "mouseenter mouseleave", function ( e ) { 683 e.preventDefault(); 684 $(this).parent(".popover-wrapper").toggleClass("popover-active"); 685 }); 686 }else{ 687 $(this).on( "click", function ( e ) { 688 e.preventDefault(); 689 $(this).parent(".popover-wrapper").toggleClass("popover-active"); 690 }); 691 } 692 }); 693 } 694 695 $(window).scroll(function(){ 696 corpkit_scroll_animation(); 697 }); 698 699 }); // doc ready end 700 701 702 $( window ).load(function() { 703 704 705 // Set Sticky Height for Menu Bars 706 corpkit_set_sticky_outer_height(); 707 708 /* Sticky Menu */ 709 if($('.header-inner .sticky-head').length){ 710 corpkit_sticky_part( '.header-inner' ); 711 } 712 713 /* Scroll Sticky */ 714 if($('.header-inner .sticky-scroll').length){ 715 corpkit_sticky_scroll_up_part( '.header-inner', 'header' ); 716 } 717 718 /* Mobile Header Sticky Menu */ 719 if($('.mobile-header-inner .sticky-head').length){ 720 corpkit_sticky_part( '.mobile-header-inner' ); 721 } 722 723 /* Mobile Header Scroll Sticky */ 724 if($('.mobile-header-inner .sticky-scroll').length){ 725 corpkit_sticky_scroll_up_part( '.mobile-header-inner', '.mobile-header' ); 726 } 727 728 //Page loader 729 if( $(".page-loader").length ){ 730 $(".page-loader").fadeOut("slow"); 731 }else if( $("body.opacity-zero").length ){ 732 $("body").removeClass("opacity-zero"); 733 $("body").addClass("opacity-one"); 734 }else if( $('body[data-corestat="1"]').length ){ 735 $("body").removeAttr("data-corestat"); 736 $("body").addClass("opacity-one"); 737 } 738 739 //Header slider height 740 if( $( ".header-slider-wrapper" ).length ){ 741 $( ".header-slider-wrapper" ).css({ 'height' : 'auto' }); 742 } 743 744 // Grid Layout Set Width for Owl and Isotope 745 if( $( ".grid-layout.grid-normal" ).length ){ 746 747 $( ".grid-layout.grid-normal" ).each(function() { 748 749 var c_elem = $( this ); 750 var parent_width = c_elem.width(); 751 var gutter_size = c_elem.data( "gutter" ); 752 var grid_cols = c_elem.data( "cols" ); 753 754 var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 755 var gn_ele = 1; // grid normal element variable 756 c_elem.children("article").each(function() { 757 if( gn_ele % grid_cols == 0 ){ 758 $( this ).css({'width':net_width+'px', 'margin-right': '0', 'margin-bottom': gutter_size+'px'}); 759 }else{ 760 $( this ).css({'width':net_width+'px', 'margin-right': gutter_size+'px', 'margin-bottom': gutter_size+'px'}); 761 } 762 gn_ele++; 763 }); 764 765 c_elem.children("article").addClass("grid-dyno-visible"); 766 767 $( window ).resize(function() { 768 setTimeout(function(){ 769 parent_width = c_elem.width(); 770 var mgrid_cols = 1; 771 if( $(window).width() < 768 ){ 772 mgrid_cols = 1; 773 }else{ 774 mgrid_cols = grid_cols; 775 } 776 var net_width = Math.floor( ( parent_width - ( gutter_size * ( mgrid_cols - 1 ) ) ) / mgrid_cols ); 777 var gn_ele = 1; // grid normal element variable 778 c_elem.children("article").each(function() { 779 if( gn_ele % mgrid_cols == 0 ){ 780 $( this ).css({'width':net_width+'px', 'margin-right': '0', 'margin-bottom': gutter_size+'px'}); 781 }else{ 782 $( this ).css({'width':net_width+'px', 'margin-right': gutter_size+'px', 'margin-bottom': gutter_size+'px'}); 783 } 784 gn_ele++; 785 }); 786 }, 200); 787 }); 788 789 c_elem.find( ".top-standard-post article" ).css({'width':'auto'}); 790 791 }); // each end 792 } // .grid-layout 793 794 /// Theme Owl Carousel Code 795 $( ".owl-carousel" ).each(function() { 796 if( !$( this ).parents( ".isotope" ).length ){ 797 corpkit_owl_settings( $( this ) ); 798 } 799 }); 800 801 // Isotope Grid Layout 802 if( $( ".grid-layout > .isotope" ).length ){ 803 $( ".grid-layout > .isotope" ).each(function() { 804 805 var c_elem = $( this ); 806 var parent_width = c_elem.width(); 807 var gutter_size = c_elem.data( "gutter" ); 808 var grid_cols = c_elem.data( "cols" ); 809 810 var layoutmode = c_elem.is('[data-layout]') ? c_elem.data( "layout" ) : ''; 811 812 layoutmode = layoutmode ? layoutmode : 'masonry'; 813 814 if( $(window).width() < 768 ) grid_cols = 1; 815 816 var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 817 c_elem.find( "article" ).css({'width':net_width+'px', 'margin-bottom':gutter_size+'px'}); 818 if( $( ".top-standard-post" ).length ){ 819 $( ".top-standard-post article" ).css({'margin-bottom':gutter_size+'px'}); 820 } 821 822 c_elem.find( ".owl-carousel" ).each(function() { 823 corpkit_owl_settings( $( this ) ); 824 }); 825 826 c_elem.find( "video" ).each(function( index ) { 827 $( this ).attr( "src", $( this ).find( "source" ).attr( "src" ) ); 828 $( this ).css({ 'height':'200px' }); 829 }); 830 831 var filter = "*"; 832 var isot_parent = c_elem.parent(".grid-layout"); 833 if( $( isot_parent ).attr("data-filter-stat") == 0 ){ 834 filter = $( isot_parent ).attr("data-first-cat") ? "." + $( isot_parent ).attr("data-first-cat") : '*'; 835 } 836 837 c_elem.imagesLoaded( function(){ 838 c_elem.isotope({ 839 itemSelector: 'article', 840 layoutMode: layoutmode, 841 filter: filter, 842 masonry: { 843 gutter: gutter_size 844 }, 845 fitRows: { 846 gutter: gutter_size 847 } 848 });
849 }); 850 851 c_elem.children("article").addClass("grid-dyno-visible"); 852 853 /* Portfolio Filter Item */ 854 if( $(".portfolio-filter").length ){ 855 $( ".portfolio-filter-item" ).on( 'click', function() { 856 $( this ).parents("ul.nav").find("li").removeClass("active"); 857 $( this ).parent("li").addClass("active"); 858 var filterValue = $( this ).attr( "data-filter" ); 859 c_elem = $( this ).parents( ".portfolio-wrapper" ).find( ".grid-layout .isotope" ); 860 c_elem.isotope({ 861 filter: filterValue 862 }); 863 return false; 864 }); 865 } 866 867 $( window ).resize(function() { 868 869 setTimeout(function(){ 870 grid_cols = c_elem.data( "cols" ); 871 if( $(window).width() < 768 ) grid_cols = 1; 872 873 var parent_width = c_elem.width(); 874 net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 875 c_elem.find( "article" ).css({'width':net_width+'px'}); 876 c_elem.imagesLoaded( function(){ 877 var $isot = c_elem.isotope({ 878 itemSelector: 'article', 879 masonry: { 880 gutter: gutter_size 881 } 882 }); 883 $isot.on( 'arrangeComplete', isotopeArrange ); 884 }); 885 886 }, 200); 887 888 }); 889 890 // Isotope Grid Infinite 891 if( c_elem.data( "infinite" ) == 1 && $(".post-pagination").length ){ 892 893 c_elem.infinitescroll({ 894 navSelector : '.post-pagination',//'#page_nav', // selector for the paged navigation 895 nextSelector : 'a.next-page',//'#page_nav a', // selector for the NEXT link (to page 2) 896 itemSelector : 'article', // selector for all items you'll retrieve 897 loading: { 898 msgText : corpkit_ajax_var.load_posts, 899 finishedMsg: corpkit_ajax_var.no_posts, 900 img: corpkit_ajax_var.infinite_loader 901 } 902 }, 903 // call Isotope as a callback 904 function( newElements ) { 905 906 var elems = $(newElements); 907 908 var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 909 c_elem.find( "article" ).css({'width':net_width+'px', 'margin-bottom':gutter_size+'px'}); 910 if( $( ".top-standard-post" ).length ){ 911 $( ".top-standard-post article" ).css({'margin-bottom':gutter_size+'px'}); 912 } 913 914 c_elem.find( ".owl-carousel" ).each(function() { 915 corpkit_owl_settings( $( this ) ); 916 }); 917 918 elems.find( "video" ).each(function( index ) { 919 $( this ).attr( "src", $( this ).find( "source" ).attr( "src" ) ); 920 $( this ).css({ 'height':'200px' }); 921 }); 922 923 elems.imagesLoaded( function(){ 924 c_elem.isotope( 'appended', elems ); 925 elems.addClass("grid-dyno-visible"); 926 }); 927 928 if( c_elem.find( "article" ).hasClass( "corpkit-animate" ) ){ 929 corpkit_scroll_animation(); 930 } 931 932 }); 933 } 934 }); // each end 935 } 936 937 // Related Slider Empty Post Image Height Set 938 if( $( ".related-slider .empty-post-image" ).length ){ 939 if( $( ".related-slider .item .wp-post-image" ).length ){ 940 $( ".related-slider .item .empty-post-image" ).height( $( ".related-slider .item .wp-post-image" ).height() ); 941 } 942 } 943 944 // Featured Slider Empty Post Image Height Set 945 if( $( ".featured-slider .empty-post-image" ).length ){ 946 if( $( ".featured-slider .item .wp-post-image" ).length ){ 947 $( ".featured-slider .item .empty-post-image" ).height( $( ".featured-slider .item .wp-post-image" ).height() ); 948 } 949 } 950 951 // Sticky Sidebar 952 if( $( ".corpkit-sticky-obj" ).length ){ 953 var $sticky_sidebars = $( ".corpkit-sticky-obj" ); 954 if( $( window ).width() > 767 ) { 955 $sticky_sidebars.stick_in_parent(); 956 } 957 $( window ).resize(function() { 958 if( $( window ).width() > 767 ) { 959 $sticky_sidebars.trigger( "sticky_kit:detach" ); 960 $sticky_sidebars.stick_in_parent(); 961 $sticky_sidebars.trigger( "sticky_kit:recalc" ); 962 }else{ 963 $sticky_sidebars.trigger( "sticky_kit:detach" ); 964 } 965 }); 966 } 967 968 // Circle Counter Shortcode Script 969 if( $( '.circle-progress-circle' ).length ){ 970 var circle = $( '.circle-progress-circle' ); 971 circle.appear(function() { 972 973 var c_circle = $( this ); 974 var c_value = c_circle.attr( "data-value" ); 975 var c_size = c_circle.attr( "data-size" ); 976 var c_thickness = c_circle.attr( "data-thickness" ); 977 var c_duration = c_circle.attr( "data-duration" ); 978 var c_empty = c_circle.attr( "data-empty" ) != '' ? c_circle.attr( "data-empty" ) : 'transparent'; 979 var c_scolor = c_circle.attr( "data-scolor" ); 980 var c_ecolor = c_circle.attr( "data-ecolor" ) != '' ? c_circle.attr( "data-ecolor" ) : c_scolor; 981 982 c_circle.circleProgress({ 983 value: Math.floor( c_value ) / 100, 984 size: Math.floor( c_size ), 985 thickness: Math.floor( c_thickness ), 986 emptyFill: c_empty, 987 animation: { 988 duration: Math.floor( c_duration ) 989 }, 990 lineCap: 'round', 991 fill: { 992 gradient: [c_scolor, c_ecolor] 993 } 994 }).on( 'circle-animation-progress', function( event, progress ) { 995 $( this ).find( '.progress-value' ).html( Math.round( c_value * progress ) + '%' ); 996 }); 997 }); 998 } 999 1000 // Day Counter Shortcode Script 1001 if( $( '.day-counter' ).length ){ 1002 $( '.day-counter' ).each(function() { 1003 var day_counter = $( this ); 1004 var dprogress = $(day_counter).hasClass("day-counter-progress") ? true : false; 1005 var c_date = day_counter.attr('data-date'); 1006 day_counter.countdown( c_date, function(event) { 1007 if( day_counter.find('.counter-day').length ){ 1008 day_counter.find('.counter-day h3').text( event.strftime('%D') ); 1009 if( dprogress ){ 1010 var yr = parseInt( event.strftime('%D') ); 1011 yr = yr ? parseInt( yr / 365 * 100 ) : 100; 1012 corpkit_day_circle( day_counter.find('.counter-day'), yr ); 1013 } 1014 } 1015 if( day_counter.find('.counter-hour').length ){ 1016 day_counter.find('.counter-hour h3').text( event.strftime('%H') ); 1017 if( dprogress ){ 1018 var hur = parseInt( event.strftime('%H') ); 1019 hur = hur ? parseInt( hur / 24 * 100 ) : 100; 1020 corpkit_day_circle( day_counter.find('.counter-hour'), hur ); 1021 } 1022 } 1023 if( day_counter.find('.counter-min').length ){ 1024 day_counter.find('.counter-min h3').text( event.strftime('%M') ); 1025 if( dprogress ){ 1026 var mnth = parseInt( event.strftime('%M') ); 1027 mnth = mnth ? parseInt( mnth / 60 * 100 ) : 100; 1028 corpkit_day_circle( day_counter.find('.counter-min'), mnth ); 1029 } 1030 } 1031 if( day_counter.find('.counter-sec').length ){ 1032 day_counter.find('.counter-sec h3').text( event.strftime('%S') ); 1033 if( dprogress ){ 1034 var tme = parseInt( event.strftime('%S') ); 1035 tme = tme ? parseInt( tme / 60 * 100 ) : 100; 1036 corpkit_day_circle( day_counter.find('.counter-sec'), tme ); 1037 } 1038 } 1039 if( day_counter.find('.counter-week').length ){ 1040 day_counter.find('.counter-week h3').text( event.strftime('%w') ); 1041 if( dprogress ){ 1042 var wk = parseInt( event.strftime('%S') ); 1043 wk = wk ? parseInt( wk / 60 * 100 ) : 100; 1044 corpkit_day_circle( day_counter.find('.counter-week'), wk ); 1045 } 1046 } 1047 }); 1048 }); 1049 } 1050 1051 // Canvas Shapes 1052 if( $(".canvas_agon").length ){ 1053 $( '.canvas_agon' ).each(function() { 1054 corpkit_agon( $(this) ); 1055 }); 1056 } 1057 1058 // Header Bar Center Item Margin Fun 1059 setTimeout( corpkit_center_menu_margin, 300 ); 1060 1061 // Google map 1062 if( $( ".corpkitgmap" ).length ){ 1063 initCorpkitGmap(); 1064 } 1065 1066 //Elementor RTL issue 1067 if( $("body.rtl").length && $("section.elementor-section-stretched").length ){ 1068 corpkit_for_elementor_row(); 1069 } 1070 1071 // Scroll animation 1072 corpkit_scroll_animation(); 1073 1074 }); 1075 1076 // Using window smartresize instead of resize function 1077 $( window ).smartresize(function() { 1078 1079 //Elementor RTL issue 1080 if( $("body.rtl").length && $("section.elementor-section-stretched").length ){ 1081 corpkit_for_elementor_row(); 1082 } 1083 1084 /* Custom Responsive Width */ 1085 var win_width = $(window).width(); 1086 if( responsive_width ){ 1087 corpkit_set_custom_hidden_elements( win_width, responsive_width ); 1088 } 1089 1090 /* Mobile Bar Toggle */ 1091 setTimeout( function(){ $(".mobile-bar.active").length ? $( ".mobile-header .mobile-bar-toggle" ).trigger( "click" ) : ''; }, 100 ); 1092 1093 /* Pull Center Reset */ 1094 setTimeout( corpkit_center_menu_margin, 300 ); 1095 1096 /* Sticky Menu */ 1097 setTimeout( corpkit_set_sticky_outer_height, 100 ); 1098 1099 /* Sticky Menu */ 1100 if($('.header-inner .sticky-head').length){ 1101 setTimeout( corpkit_sticky_part( '.header-inner' ), 100 ); 1102 } 1103 1104 /* Scroll Sticky */ 1105 if($('.header-inner .sticky-scroll').length){ 1106 setTimeout( corpkit_sticky_scroll_up_part( '.header-inner', 'header' ), 100 ); 1107 } 1108 1109 /* Mobile Header Sticky Menu */ 1110 if($('.mobile-header-inner .sticky-head').length){ 1111 setTimeout( corpkit_sticky_part( '.mobile-header-inner' ), 100 ); 1112 } 1113 1114 /* Mobile Header Scroll Sticky */ 1115 if($('.mobile-header-inner .sticky-scroll').length){ 1116 setTimeout( corpkit_sticky_scroll_up_part( '.mobile-header-inner', '.mobile-header' ), 100 ); 1117 } 1118 1119 corpkit_scroll_animation(); 1120 1121 }); 1122 1123 //Day Counter Progress 1124 function corpkit_day_circle( ele, value ){ 1125 var c_circle = $( ele ); 1126 var parent_ele = $( ele ).parent( ".day-counter-progress" ); 1127 var c_value = value; 1128 var c_size = $( parent_ele ).attr("data-size") ? $( parent_ele ).attr("data-size") : 100; 1129 var c_thickness = $( parent_ele ).attr("data-thick") ? $( parent_ele ).attr("data-thick") : 10; 1130 var c_duration = 0; 1131 var c_empty = $( parent_ele ).attr("data-empty-color") ? $( parent_ele ).attr("data-empty-color") : '#eee'; 1132 var c_scolor = $( parent_ele ).attr("data-fill-color") ? $( parent_ele ).attr("data-fill-color") : '#333'; 1133 var c_ecolor = c_scolor; 1134
1135 c_circle.circleProgress({ 1136 value: Math.floor( c_value ) / 100, 1137 size: Math.floor( c_size ), 1138 thickness: Math.floor( c_thickness ), 1139 emptyFill: c_empty, 1140 animation: { 1141 duration: Math.floor( c_duration ) 1142 }, 1143 lineCap: 'round', 1144 fill: { 1145 gradient: [c_scolor, c_ecolor] 1146 } 1147 }); 1148 } 1149 1150 function isotopeArrange() { 1151 $( ".grid-layout > .isotope" ).find( "audio, video" ).each(function( index ) { 1152 $( this )[0].play(); 1153 $( this )[0].pause(); 1154 }); 1155 } 1156 1157 function corpkit_for_elementor_row(){ 1158 $("body.rtl section.elementor-section-stretched").each(function() { 1159 var left_pos = $(this).css( "left" ); 1160 left_pos = Math.abs( parseFloat(left_pos) ); 1161 if( left_pos ) $(this).css( "left", left_pos ); 1162 }); 1163 } 1164 1165 function corpkit_set_custom_hidden_elements( win_width, responsive_width ){ 1166 if( win_width > responsive_width ){ 1167 $(".header-inner").show(); 1168 $(".mobile-header-inner, .mobile-topbar-wrap").hide(); 1169 }else{ 1170 $(".header-inner").hide(); 1171 $(".mobile-header-inner, .mobile-topbar-wrap").show(); 1172 } 1173 } 1174 1175 function corpkit_sticky_header_adjust(elem_pos, elem_width){ 1176 var win_width = $(window).width(); 1177 var compare_wdth; 1178 if( $('.corpkit-header .header-inner.hidden-md-land-down' ).length ){ 1179 compare_wdth = 1024; 1180 }else{ 1181 compare_wdth = 991; 1182 } 1183 if( win_width <= compare_wdth ){ 1184 if( elem_pos == 'left' ){ 1185 $('.sticky-header-space').css( 'left', '-'+ elem_width +'px' ); 1186 $('body, .top-sliding-bar').css( 'padding-left', '0' ); 1187 }else{ 1188 $('.sticky-header-space').css( 'right', '-'+ elem_width +'px' ); 1189 $('body, .top-sliding-bar').css( 'padding-right', '0' ); 1190 } 1191 }else{ 1192 if( elem_pos == 'left' ){ 1193 $('.sticky-header-space').css( 'left', 0 ); 1194 $('body, .top-sliding-bar').css( 'padding-left', elem_width +'px' ); 1195 }else{ 1196 $('.sticky-header-space').css( 'right', 0 ); 1197 $('body, .top-sliding-bar').css( 'padding-right', elem_width +'px' ); 1198 } 1199 } 1200 } 1201 1202 function corpkit_center_menu_margin(){ 1203 //Center item margin fixing 1204 $.each([ 'topbar', 'logobar', 'navbar', 'mobile-header', 'footer-bottom' ], function( index, margin_key ) { 1205 1206 var left_width = 0, 1207 right_width = 0, 1208 center_width = 0, 1209 margin_left = 0, 1210 parent_width = 0; 1211 1212 if( $('.'+ margin_key +' .'+ margin_key +'-inner .pull-center').length ){ 1213 1214 if( margin_key == 'mobile-header' ) 1215 parent_width = $('.'+ margin_key +' .'+ margin_key +'-inner .container').width(); 1216 else 1217 parent_width = $('.'+ margin_key +' .'+ margin_key +'-inner').width(); 1218 1219 if( $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-left').length ){ 1220 left_width = $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-left').width(); 1221 } 1222 if( $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-right').length ){ 1223 right_width = $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-right').width(); 1224 } 1225 if( $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').length ){ 1226 center_width = $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').width(); 1227 } 1228 1229 if( left_width + center_width + right_width ){ 1230 1231 if( margin_key == 'mobile-header' ){ 1232 parent_width -= ( left_width + center_width + right_width ); 1233 margin_left = parent_width / 2; 1234 }else{ 1235 var midd_point = parent_width / 2; 1236 var left_point = midd_point - ( center_width / 2 ); 1237 margin_left = Math.floor( left_point - left_width ); 1238 } 1239 1240 if( !$( "body.rtl" ).length ){ 1241 $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').css( 'margin-left', margin_left+'px' ); 1242 }else{ 1243 $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').css( 'margin-right', margin_left+'px' ); 1244 } 1245 1246 $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').addClass("show-opacity"); 1247 1248 } 1249 } 1250 }); 1251 } 1252 1253 function corpkit_sticky_part( main_class ){ 1254 1255 var outer_class = '.sticky-outer'; 1256 var lastScrollTop = 0; 1257 var header_top = 0; 1258 1259 var t_header_h = $(main_class + ' ' + outer_class).data( "height" ); 1260 $(main_class + ' ' + outer_class).css( 'height', t_header_h ); 1261 header_top = $(main_class + ' ' + outer_class).offset().top; 1262 header_top += t_header_h; 1263 1264 $(window).scroll(function(event){ 1265 1266 var st = $(this).scrollTop(); 1267 if( st > header_top ){ 1268 $(main_class + ' .sticky-head').addClass('header-sticky'); 1269 }else{ 1270 $(main_class + ' .sticky-head').removeClass('header-sticky'); 1271 } 1272 1273 if( st == 0 ){ 1274 $(main_class + ' .sticky-head').removeClass('header-sticky'); 1275 } 1276 1277 lastScrollTop = st; 1278 }); 1279 } 1280 1281 function corpkit_sticky_scroll_up_part( main_class, sticky_div ){ 1282 1283 var outer_class = '.sticky-outer'; 1284 var out_height = ''; 1285 var lastScrollTop = 0; 1286 var header_top = 0; 1287 1288 $(main_class + ' ' + outer_class).css( 'height', $(main_class + ' ' + outer_class).data( "height" ) ); 1289 out_height = '-' + $(main_class + ' ' + outer_class).outerHeight() + 'px'; 1290 header_top = $(main_class + ' ' + outer_class).offset().top; 1291 sticky_div = $(sticky_div).height(); 1292 1293 $(window).scroll(function(event){ 1294 1295 var st = $(this).scrollTop(); 1296 1297 if( st < lastScrollTop && header_top < lastScrollTop ){ 1298 // upscroll code 1299 $(main_class + ' .sticky-scroll').addClass('show-menu'); 1300 $(main_class + ' .sticky-scroll.show-menu').css({'transform': 'translate3d(0px, 0px, 0px)'}); 1301 }else{ 1302 // downscroll code 1303 if( st < sticky_div ){ 1304 $(main_class + ' .sticky-scroll').css({'transform': ''}); 1305 $(main_class + ' .sticky-scroll.show-menu').removeClass('show-menu'); 1306 }else{ 1307 $(main_class + ' .sticky-scroll').css({'transform': 'translate3d(0px, '+ out_height +', 0px)'}); 1308 } 1309 } 1310 1311 if( st == 0 ){ 1312 $(main_class + ' .sticky-scroll').css({'transform': ''}); 1313 $(main_class + ' .sticky-scroll.show-menu').removeClass('show-menu'); 1314 } 1315 1316 lastScrollTop = st; 1317 }); 1318 1319 } 1320 1321 function corpkit_set_sticky_outer_height(){ 1322 $( ".sticky-outer" ).each(function() { 1323 1324 var class_name = ''; 1325 var sticky_parent = $( this ).parent( "div" ); 1326 1327 if( $( sticky_parent ).is('[class*=hidden-]') ){ 1328 class_name = $( sticky_parent ).attr("class"); 1329 var t_stat = ''; 1330 if( $( sticky_parent ).hasClass( "mobile-header-inner" ) ){
1331 class_name = class_name.replace( "mobile-header-inner", "" ); 1332 t_stat = 'm'; 1333 } 1334 if( $( sticky_parent ).hasClass( "header-inner" ) ){ 1335 class_name = class_name.replace( "header-inner", "" ); 1336 t_stat = 'd'; 1337 } 1338 $( sticky_parent ).attr("class", ""); 1339 if( t_stat == 'm' ){ 1340 $( sticky_parent ).attr("class", "mobile-header-inner"); 1341 } 1342 if( t_stat == 'd' ){ 1343 $( sticky_parent ).attr("class", "header-inner"); 1344 } 1345 } 1346 1347 $( this ).css({ 'position':'relative', 'visibility':'hidden', 'display':'block', 'height':'auto' }); 1348 var hght = $( this ).outerHeight(); 1349 $( this ).attr( "data-height", hght ); 1350 1351 if( class_name != '' ){ 1352 $( sticky_parent ).addClass(class_name); 1353 } 1354 1355 $( this ).css({ 'position':'', 'visibility':'', 'display':'', 'height': hght }); 1356 1357 }); 1358 } 1359 1360 function corpkit_agon( canvas_ele ){ 1361 var canvas = document.getElementById("canvas_agon"); 1362 var cxt = canvas.getContext("2d"); 1363 var agon_size = canvas_ele.attr( "data-size" ); 1364 var agon_side = canvas_ele.attr( "data-side" ); 1365 var agon_color = canvas_ele.attr( "data-color" ); 1366 var div_val = 1; 1367 1368 switch( parseInt( agon_side ) ){ 1369 case 3: 1370 div_val = 6; 1371 break; 1372 case 4: 1373 div_val = 4; 1374 break; 1375 case 5: 1376 div_val = 3.3; 1377 break; 1378 case 6: 1379 div_val = 3; 1380 break; 1381 case 7: 1382 div_val = 2.8; 1383 break; 1384 case 8: 1385 div_val = 2.7; 1386 break; 1387 case 9: 1388 div_val = 2.6; 1389 break; 1390 case 10: 1391 div_val = 2.5; 1392 break; 1393 } 1394 1395 // hexagon 1396 var numberOfSides = parseInt( agon_side ), 1397 size = parseInt( agon_size ), 1398 Xcenter = parseInt( agon_size ), 1399 Ycenter = parseInt( agon_size ), 1400 step = 2 * Math.PI / numberOfSides,//Precalculate step value 1401 shift = (Math.PI / div_val);//(Math.PI / 180.0);// * 44;//Quick fix ;) 1402 1403 cxt.beginPath(); 1404 1405 for (var i = 0; i <= numberOfSides;i++) { 1406 var curStep = i * step + shift; 1407 cxt.lineTo (Xcenter + size * Math.cos(curStep), Ycenter + size * Math.sin(curStep)); 1408 } 1409 1410 /* Direct Output */ 1411 cxt.fillStyle = agon_color; 1412 cxt.fill(); 1413 } 1414 1415 function corpkittesipagecallback(event){ 1416 var current = event.item.index; 1417 $( event.target ).find(".owl-item.active").eq(0).addClass("current"); 1418 } 1419 1420 function corpkit_owl_settings(c_owlCarousel){ 1421 1422 var page_slide = false; 1423 var pagi_slide = false; 1424 if( c_owlCarousel.hasClass("corpkit-page-carousel") ){ page_slide = true; } 1425 if( c_owlCarousel.hasClass("corpkit-pagination-carousel") ){ pagi_slide = true; } 1426 1427 // Data Properties 1428 var loop = c_owlCarousel.data( "loop" ); 1429 var margin = c_owlCarousel.data( "margin" ); 1430 var center = c_owlCarousel.data( "center" ); 1431 var nav = c_owlCarousel.data( "nav" ); 1432 var dots_ = c_owlCarousel.data( "dots" ); 1433 var items = c_owlCarousel.data( "items" ); 1434 var items_tab = c_owlCarousel.data( "items-tab" ); 1435 var items_mob = c_owlCarousel.data( "items-mob" ); 1436 var duration = c_owlCarousel.data( "duration" ); 1437 var smartspeed = c_owlCarousel.data( "smartspeed" ); 1438 var scrollby = c_owlCarousel.data( "scrollby" ); 1439 var autoheight = c_owlCarousel.data( "autoheight" ); 1440 var autoplay = c_owlCarousel.data( "autoplay" ); 1441 var rtl = $( "body.rtl" ).length ? true : false; 1442 1443 $( c_owlCarousel ).owlCarousel({ 1444 rtl : rtl, 1445 loop : loop, 1446 autoplayTimeout : duration, 1447 smartSpeed : smartspeed, 1448 center: center, 1449 margin : margin, 1450 nav : nav, 1451 dots : dots_, 1452 autoplay : autoplay, 1453 autoheight : autoheight, 1454 slideBy : scrollby, 1455 responsive:{ 1456 0:{ 1457 items: items_mob 1458 }, 1459 544:{ 1460 items: items_tab 1461 }, 1462 992:{ 1463 items: items 1464 } 1465 }, 1466 onInitialized: pagi_slide ? corpkittesipagecallback : '' 1467 }); 1468 1469 if( pagi_slide ){ 1470 var cur_testi_slide = $( c_owlCarousel ).parent("div").children(".corpkit-page-carousel"); 1471 var cur_pagination_slide = $( c_owlCarousel ); 1472 $( c_owlCarousel ).on('click', '.owl-item', function(event) { 1473 var current = $(this).index(); 1474 $(cur_testi_slide).trigger("to.owl.carousel", [current, 500]); 1475 }); 1476 $( c_owlCarousel ).on('dragged.owl.carousel', function(event) { 1477 var current = event.item.index; 1478 $(cur_testi_slide).trigger("to.owl.carousel", [current, 500]); 1479 cur_pagination_slide.find(".owl-item.current").removeClass("current"); 1480 cur_pagination_slide.find(".owl-item").eq(current).addClass("current"); 1481 }); 1482 } 1483 if( page_slide ){ 1484 var cur_pagination_slide = $( c_owlCarousel ).parent("div").children(".corpkit-pagination-carousel"); 1485 $( c_owlCarousel ).on('changed.owl.carousel', function(event) { 1486 var current = event.item.index; 1487 $(cur_pagination_slide).trigger("to.owl.carousel", [current, 500]); 1488 $(cur_pagination_slide).find(".owl-item.current").removeClass("current"); 1489 $(cur_pagination_slide).find(".owl-item").eq(current).addClass("current"); 1490 }); 1491 } 1492 1493 } 1494 1495 function convert_time(duration) { 1496 var a = duration.match(/\d+/g); 1497 1498 if (duration.indexOf('M') >= 0 && duration.indexOf('H') == -1 && duration.indexOf('S') == -1) { 1499 a = [0, a[0], 0]; 1500 } 1501 1502 if (duration.indexOf('H') >= 0 && duration.indexOf('M') == -1) { 1503 a = [a[0], 0, a[1]];
1504 } 1505 if (duration.indexOf('H') >= 0 && duration.indexOf('M') == -1 && duration.indexOf('S') == -1) { 1506 a = [a[0], 0, 0]; 1507 } 1508 1509 duration = 0; 1510 1511 if (a.length == 3) { 1512 duration = duration + parseInt(a[0]) * 3600; 1513 duration = duration + parseInt(a[1]) * 60; 1514 duration = duration + parseInt(a[2]); 1515 } 1516 1517 if (a.length == 2) { 1518 duration = duration + parseInt(a[0]) * 60; 1519 duration = duration + parseInt(a[1]); 1520 } 1521 1522 if (a.length == 1) { 1523 duration = duration + parseInt(a[0]); 1524 } 1525 var h = Math.floor(duration / 3600); 1526 var m = Math.floor(duration % 3600 / 60); 1527 var s = Math.floor(duration % 3600 % 60); 1528 return ((h > 0 ? h + ":" + (m < 10 ? "0" : "") : "") + m + ":" + (s < 10 ? "0" : "") + s); 1529 } 1530 1531 function corpkit_scroll_animation(){ 1532 setTimeout( function() { 1533 var anim_time = 300; 1534 $('.corpkit-animate:not(.run-animate)').each( function() { 1535 1536 var elem = $(this); 1537 var bottom_of_object = elem.offset().top; 1538 var bottom_of_window = $(window).scrollTop() + $(window).height(); 1539 1540 if( bottom_of_window > bottom_of_object ){ 1541 setTimeout( function() { 1542 elem.addClass("run-animate"); 1543 }, anim_time ); 1544 } 1545 anim_time += 300; 1546 1547 }); 1548 }, 200 ); 1549 } 1550 1551 function initCorpkitGmap() { 1552 1553 1554 if( corpkit_ajax_var.gmap_stat == '0' ){ 1555 return; 1556 } 1557 1558 var map_styles = '{ "Aubergine" : [ {"elementType":"geometry","stylers":[{"color":"#1d2c4d"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#8ec3b9"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#1a3646"}]},{"featureType":"administrative.country","elementType":"geometry.stroke","stylers":[{"color":"#4b6878"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#64779e"}]},{"featureType":"administrative.province","elementType":"geometry.stroke","stylers":[{"color":"#4b6878"}]},{"featureType":"landscape.man_made","elementType":"geometry.stroke","stylers":[{"color":"#334e87"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"color":"#023e58"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#283d6a"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#6f9ba5"}]},{"featureType":"poi","elementType":"labels.text.stroke","stylers":[{"color":"#1d2c4d"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#023e58"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#3C7680"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#304a7d"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#98a5be"}]},{"featureType":"road","elementType":"labels.text.stroke","stylers":[{"color":"#1d2c4d"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#2c6675"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#255763"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#b0d5ce"}]},{"featureType":"road.highway","elementType":"labels.text.stroke","stylers":[{"color":"#023e58"}]},{"featureType":"transit","elementType":"labels.text.fill","stylers":[{"color":"#98a5be"}]},{"featureType":"transit","elementType":"labels.text.stroke","stylers":[{"color":"#1d2c4d"}]},{"featureType":"transit.line","elementType":"geometry.fill","stylers":[{"color":"#283d6a"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#3a4762"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#0e1626"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#4e6d70"}]}], "Silver" : [{"elementType":"geometry","stylers":[{"color":"#f5f5f5"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f5f5"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#ffffff"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#dadada"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#c9c9c9"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]}], "Retro" : [{"elementType":"geometry","stylers":[{"color":"#ebe3cd"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#523735"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f1e6"}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#c9b2a6"}]},{"featureType":"administrative.land_parcel","elementType":"geometry.stroke","stylers":[{"color":"#dcd2be"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#ae9e90"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#93817c"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#a5b076"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#447530"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#f5f1e6"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#fdfcf8"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#f8c967"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#e9bc62"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry","stylers":[{"color":"#e98d58"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry.stroke","stylers":[{"color":"#db8555"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#806b63"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"transit.line","elementType":"labels.text.fill","stylers":[{"color":"#8f7d77"}]},{"featureType":"transit.line","elementType":"labels.text.stroke","stylers":[{"color":"#ebe3cd"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#b9d3c2"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#92998d"}]}], "Dark" : [{"elementType":"geometry","stylers":[{"color":"#212121"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#212121"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"color":"#757575"}]},{"featureType":"administrative.country","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.locality","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#181818"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"poi.park","elementType":"labels.text.stroke","stylers":[{"color":"#1b1b1b"}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"color":"#2c2c2c"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#8a8a8a"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#373737"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#3c3c3c"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry","stylers":[{"color":"#4e4e4e"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"transit","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#000000"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#3d3d3d"}]}], "Night" : [{"elementType":"geometry","stylers":[{"color":"#242f3e"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#746855"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#242f3e"}]},{"featureType":"administrative.locality","elementType":"labels.text.fill","stylers":[{"color":"#d59563"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#d59563"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#263c3f"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#6b9a76"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#38414e"}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"color":"#212a37"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#9ca5b3"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#746855"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#1f2835"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#f3d19c"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#2f3948"}]},{"featureType":"transit.station","elementType":"labels.text.fill","stylers":[{"color":"#d59563"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#17263c"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#515c6d"}]},{"featureType":"water","elementType":"labels.text.stroke","stylers":[{"color":"#17263c"}]}] }'; 1559 1560 var map_style_obj = JSON.parse(map_styles); 1561 1562 var map_style_mode = []; 1563 var map_mode = ''; 1564 var map_lang = ''; 1565 var map_lat = ''; 1566 var map_marker = ''; 1567 var map_options = ''; 1568 1569 $( ".corpkitgmap" ).each(function( index ) { 1570 1571 var gmap = this; 1572 1573 if( $( gmap ).attr( "data-map-style" ) ){ 1574 map_mode = $( gmap ).data("map-style"); 1575 map_lang = $( gmap ).data("map-lang"); 1576 map_lat = $( gmap ).data("map-lat"); 1577 map_marker = $( gmap ).data("map-marker"); 1578 if( map_mode === 'aubergine' ) 1579 map_style_mode = map_style_obj.Aubergine; 1580 else if( map_mode === 'silver' ) 1581 map_style_mode = map_style_obj.Silver; 1582 else if( map_mode === 'retro' ) 1583 map_style_mode = map_style_obj.Retro; 1584 else if( map_mode === 'dark' ) 1585 map_style_mode = map_style_obj.Dark; 1586 else if( map_mode === 'night' ) 1587 map_style_mode = map_style_obj.Night; 1588 else if( map_mode === 'custom' ){ 1589 var c_style = $( gmap ).attr( "data-custom-style" ) && $( gmap ).attr( "data-custom-style" ) != '' ? JSON.parse( $( gmap ).attr( "data-custom-style" ) ) : '[]'; 1590 map_style_mode = c_style; 1591 }else{ 1592 map_style_mode = "[]"; 1593 } 1594 } 1595 1596 if( $( gmap ).attr( "data-multi-map" ) && $( gmap ).attr( "data-multi-map" ) == 'true' ){ 1597 1598 var map_values = JSON.parse( $( gmap ).attr( "data-maps" ) ); 1599 var map_wheel = $( gmap ).attr( "data-wheel" ) && $( gmap ).attr( "data-wheel" ) == 'true' ? true : false; 1600 var map_zoom = $( gmap ).attr( "data-zoom" ) && $( gmap ).attr( "data-zoom" ) != '' ? parseInt( $( gmap ).attr( "data-zoom" ) ) : 14; 1601 var map; 1602 1603 var map_stat = 1; 1604
1605 map_values.forEach( function( map_value ) { 1606 map_lat = map_value.map_latitude; 1607 map_lang = map_value.map_longitude; 1608 var LatLng = new google.maps.LatLng( map_lat, map_lang ); 1609 var mapProp= { 1610 center: LatLng, 1611 scrollwheel: map_wheel, 1612 zoom: map_zoom, 1613 styles: map_style_mode 1614 }; 1615 1616 //Create Map 1617 if( map_stat ){ 1618 var t_gmap = $( gmap ); 1619 map = new google.maps.Map( t_gmap[0], mapProp ); 1620 1621 google.maps.event.addDomListener( window, 'resize', function() { 1622 var center = map.getCenter(); 1623 google.maps.event.trigger( map, "resize" ); 1624 map.setCenter( LatLng ); 1625 }); 1626 1627 map_stat = 0; 1628 } 1629 1630 //Map Marker 1631 var marker = new google.maps.Marker({ 1632 position: LatLng, 1633 icon: map_value.map_marker, 1634 map: map 1635 }); 1636 1637 //Info Window 1638 if( map_value.map_info_opt == 'on' ) { 1639 var info_title = map_value.map_info_title; 1640 var info_addr = map_value.map_info_address; 1641 var contentString = '<div class="gmap-info-wrap"><h3>'+ info_title +'</h3><p>'+ info_addr +'</p></div>'; 1642 var infowindow = new google.maps.InfoWindow({ 1643 content: contentString 1644 }); 1645 marker.addListener( 'click', function() { 1646 infowindow.open( map, marker ); 1647 }); 1648 } 1649 }); 1650 1651 }else{ 1652 1653 var LatLng = {lat: parseFloat(map_lat), lng: parseFloat(map_lang)}; 1654 1655 var map_wheel = $( gmap ).attr( "data-wheel" ) && $( gmap ).attr( "data-wheel" ) == 'true' ? true : false; 1656 var map_zoom = $( gmap ).attr( "data-zoom" ) && $( gmap ).attr( "data-zoom" ) != '' ? parseInt( $( gmap ).attr( "data-zoom" ) ) : 14; 1657 1658 var mapProp= { 1659 center: LatLng, 1660 scrollwheel: map_wheel, 1661 zoom: map_zoom, 1662 styles: map_style_mode 1663 }; 1664 var t_gmap = $( gmap ); 1665 var map = new google.maps.Map( t_gmap[0], mapProp ); //document.getElementById("corpkitgmap") 1666 1667 var marker = new google.maps.Marker({ 1668 position: LatLng, 1669 icon: map_marker, 1670 map: map 1671 }); 1672 1673 if( $( gmap ).attr( "data-info" ) == 1 ){ 1674 var info_title = $( gmap ).attr( "data-info-title" ) ? $( gmap ).attr( "data-info-title" ) : ''; 1675 var info_addr = $( gmap ).attr( "data-info-addr" ) ? $( gmap ).attr( "data-info-addr" ) : ''; 1676 var contentString = '<div class="gmap-info-wrap"><h3>'+ info_title +'</h3><p>'+ info_addr +'</p></div>'; 1677 var infowindow = new google.maps.InfoWindow({ 1678 content: contentString 1679 }); 1680 marker.addListener( 'click', function() { 1681 infowindow.open( map, marker ); 1682 }); 1683 } 1684 1685 google.maps.event.addDomListener( window, 'resize', function() { 1686 var center = map.getCenter(); 1687 google.maps.event.trigger(map, "resize"); 1688 map.setCenter(LatLng); 1689 }); 1690 1691 }// data multi map false part end 1692 1693 }); // end map each 1694 1695 } 1696 1697})( 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.