1/* 2 * Klenster Theme Js 3 */ 4 5(function( $ ) { 6 7 "use strict"; 8 9 var klenster_body_atts = klenster_ajax_var.body_atts; 10 var responsive_width = klenster_body_atts && klenster_body_atts.res_width ? klenster_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 $( ".klenster-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="klenster-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 .klenster-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 .klenster-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 .klenster-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 .klenster-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 .klenster-main-menu" ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle ti-plus"></span>' ); 113 $( ".sticky-header-space .klenster-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 klenster_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( $( ".klenster-main-menu" ).length || $( ".secondary-menu-area-inner ul.menu" ).length ){ 178 179 var main_menu = ".klenster-main-menu"; 180 if( !$( ".klenster-main-menu" ).length ){ 181 $( ".secondary-menu-area-inner ul.menu" ).addClass( "klenster-main-menu" ); 182 } 183 184 var mobile_menu = ".mobile-bar .klenster-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('klenster-main-menu').addClass('klenster-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 $( '.klenster-main-menu li.menu-item, .klenster-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( $('.klenster-main-menu .menu-item').find('a[href="#section-top"]').length ){ 288 $("body").attr("id","section-top"); 289 } 290 291 $( '.klenster-main-menu li.menu-item, .klenster-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 >= klenster_body_atts.res_width ? parseInt( klenster_body_atts.menu_offset ) + 1 : parseInt( klenster_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 $('.klenster-main-menu .menu-item').find("a").removeClass("active"); 302 $('.klenster-main-menu .menu-item').find('a[href="#'+ anchored +'"]').addClass("active"); 303 304 //Mobile menu scroll spy active 305 $('.klenster-mobile-menu .menu-item').find("a").removeClass("active"); 306 $('.klenster-mobile-menu .menu-item').find('a[href="#'+ anchored +'"]').addClass("active"); 307 } 308 }); 309 }); 310 311 $( '.klenster-main-menu .menu-item > a[href^="#section-"], .klenster-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(".klenster-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 >= klenster_body_atts.res_width ? parseInt( klenster_body_atts.menu_offset ) : parseInt( klenster_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 klenster_sticky_header_adjust(elem_pos, elem_width); 395 $( window ).resize(function() { 396 klenster_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 return false; 410 }); 411 }else if( $( ".bottom-search-toggle" ).length ){ 412 $( document ).on('click', '.bottom-search-toggle', function(){ 413 $(this).parents('.search-toggle-wrap').toggleClass('active'); 414 return false; 415 }); 416 } 417 418 /* Sticky Footer */ 419 if( $( ".footer-fixed" ).length ){ 420 if( $( window ).width() > 1023 ){ 421 $( ".klenster-wrapper" ).css({ 'margin-bottom' : $( ".footer-fixed" ).outerHeight() + 'px' }); 422 }else{ 423 $( ".klenster-wrapper" ).css({ 'margin-bottom' : '0' }); 424 } 425 }else if( $( ".footer-bottom-fixed" ).length ){ 426 if( $( window ).width() > 1023 ){ 427 $( ".klenster-wrapper" ).css({ 'margin-bottom' : $( ".footer-bottom-fixed" ).outerHeight() + 'px' }); 428 }else{ 429 $( ".klenster-wrapper" ).css({ 'margin-bottom' : '0' }); 430 } 431 } 432 $( window ).resize(function() { 433 if( $( ".footer-fixed" ).length ){ 434 if( $( window ).width() > 1023 ){ 435 $( ".klenster-wrapper" ).css({ 'margin-bottom' : $( ".footer-fixed" ).outerHeight() + 'px' }); 436 }else{ 437 $( ".klenster-wrapper" ).css({ 'margin-bottom' : '0' }); 438 } 439 }else if( $( ".footer-bottom-fixed" ).length ){ 440 if( $( window ).width() > 1023 ){ 441 $( ".klenster-wrapper" ).css({ 'margin-bottom' : $( ".footer-bottom-fixed" ).outerHeight() + 'px' }); 442 }else{ 443 $( ".klenster-wrapper" ).css({ 'margin-bottom' : '0' }); 444 } 445 } 446 }); 447 448 /* Stellar Parallax */ 449 if( $(".parallax-item").length ){ 450 $.stellar({ 451 horizontalScrolling: false, 452 verticalOffset: 40 453 }); 454 } 455 456 /* Magnific Zoom Gallery Code */ 457 if( $('.zoom-gallery').length ){ 458 $('.zoom-gallery').magnificPopup({ 459 delegate: 'a', 460 type: 'image', 461 closeOnContentClick: false, 462 closeBtnInside: false, 463 mainClass: 'mfp-with-zoom mfp-img-mobile', 464 gallery: { 465 enabled: true 466 }, 467 zoom: { 468 enabled: true, 469 duration: 300, // don't foget to change the duration also in CSS 470 opener: function(element) { 471 return element.find('img'); 472 } 473 } 474 }); 475 } 476 477 if( $('.image-gallery .image-gallery-link').length ){ 478 $('.image-gallery').magnificPopup({ 479 delegate: '.image-gallery-link', 480 type: 'image', 481 closeOnContentClick: false, 482 closeBtnInside: false, 483 mainClass: 'mfp-with-zoom mfp-img-mobile', 484 gallery: { 485 enabled: true 486 }, 487 }); 488 } 489 490 if( $('.popup-video-post, .popup-audio-post, .klenster-popup-gmaps').length ){ 491 /* Magnific Popup Code */ 492 $('.popup-video-post, .popup-audio-post, .klenster-popup-gmaps').magnificPopup({ 493 disableOn:700, 494 type:'iframe', 495 mainClass:'mfp-fade', 496 removalDelay:160, 497 preloader:!1, 498 fixedContentPos:!1 499 }); 500 } 501 502 if( $('.popup-with-zoom-anim').length ){ 503 $('.popup-with-zoom-anim').magnificPopup({ 504 disableOn: 700, 505 type: 'inline', 506 mainClass: 'mfp-fade', 507 removalDelay: 160, 508 preloader: false,
509 fixedContentPos: false, 510 callbacks: { 511 open: function() { 512 // Play video on open: 513 if( !$( this.content ).find('video').length ){ 514 var parent = $( this.content ).parent( "post-video-wrap" ); 515 var url = $( this.content ).find('span').data( "url" ); 516 var video = '<video width="100%" height="450" preload="true" style="max-width:100%;" autoplay="true"><source src="'+ url +'" type="video/mp4"></video>'; 517 $( this.content ).find('span').replaceWith( video ); 518 }else{ 519 $(this.content).find('video')[0].load(); 520 } 521 }, 522 close: function() { 523 // Reset video on close: 524 $(this.content).find('video')[0].pause(); 525 526 } 527 } 528 }); 529 } 530 531 //Modal popup 532 if( $('.modal-popup-content').length ){ 533 /* Magnific Popup Code */ 534 $('.modal-box-trigger').magnificPopup({ 535 type: 'inline', 536 preloader: false, 537 focus: '#username', 538 modal: true, 539 mainClass: 'mfp-fade', 540 removalDelay: 300 541 }); 542 $(document).on('click', '.popup-modal-dismiss', function (e) { 543 e.preventDefault(); 544 $.magnificPopup.close(); 545 }); 546 } 547 548 //klenster Popup 549 if( $('.klenster-popup-wrapper').length ){ 550 $('.klenster-popup-trigger').magnificPopup({ 551 type: 'inline', 552 preloader: false, 553 //focus: '#username', 554 modal: true, 555 mainClass: 'mfp-fade', 556 removalDelay: 300 557 }); 558 $(document).on('click', '.klenster-popup-dismiss', function (e) { 559 e.preventDefault(); 560 $.magnificPopup.close(); 561 }); 562 } 563 564 /* Set Blockquote Background */ 565 if( $( ".post-quote-wrap, .post-link-wrap" ).length ){ 566 $( ".post-quote-wrap, .post-link-wrap" ).each(function() { 567 var img_url = $(this).data('url'); 568 if( img_url ){ 569 $(this).css( 'background-image','url('+ img_url +')' ); 570 } 571 }); 572 } 573 574 /* Set Background Image */ 575 if( $( ".set-bg-img" ).length ){ 576 $( ".set-bg-img" ).each(function() { 577 var img_url = $(this).data('src'); 578 if( img_url ){ 579 $(this).css( 'background-image','url('+ img_url +')' ); 580 } 581 }); 582 } 583 584 /* Sticky Element */ 585 if( $( ".klenster-sticky-wrapper" ).length ){ 586 $("a.klenster-sticky-trigger").on( "click", function(e){ 587 $(this).parent(".klenster-sticky-wrapper").toggleClass("active"); 588 return false; 589 }); 590 } 591 592 if( $('a.onclick-video-post').length ){ 593 $(document).on( "click", "a.onclick-video-post", function(){ 594 595 var parent = $(this).parent('.post-video-wrap'); 596 var frame = '<iframe src="'+ $(this).attr("href") +'?autoplay=1" width="100%" height="'+ parent.height() +'" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'; 597 $(this).fadeOut(300); 598 $(this).replaceWith( frame ); 599 return false; 600 }); 601 } 602 603 if( $('a.onclick-custom-video').length ){ 604 $(document).on( "click", ".onclick-custom-video", function(){ 605 606 var parent = $(this).parent('.post-video-wrap'); 607 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>'; 608 $(this).fadeOut(300); 609 $(this).replaceWith( video ); 610 return false; 611 }); 612 } 613 614 /* Page Title Background Video */ 615 if( $( "#page-title-bg .page-title-wrap-inner" ).length ){ 616 $( "#page-title-bg .page-title-wrap-inner" ).YTPlayer(); 617 } 618 619 /* Comments Like/Dislike */ 620 if( $(".comment-like-wrapper").length ){ 621 $( document ).on( 'click', ".comment-like", function( event) { 622 623 var cmt_cur = $(this); 624 var cmt_meta = cmt_cur.data('id'); 625 var cmt_id = cmt_cur.data('cmt-id'); 626 var parent = cmt_cur.parents('.comment-like-wrapper'); 627 if( cmt_meta == '1' ){ 628 cmt_cur.parents('.list-inline').find('.comment-liked').removeClass('theme-color comment-liked').addClass('comment-like'); 629 cmt_cur.removeClass('comment-like').addClass('theme-color comment-liked'); 630 }else{ 631 cmt_cur.parents('.list-inline').find('.comment-liked').removeClass('theme-color comment-liked').addClass('comment-like'); 632 cmt_cur.removeClass('comment-like').addClass('theme-color comment-liked'); 633 } 634 635 if( cmt_id != '' && cmt_meta != '' ){ 636 // Ajax call 637 (jQuery).ajax({ 638 type: "post", 639 url: klenster_ajax_var.admin_ajax_url, 640 data: "action=comment_like&nonce="+klenster_ajax_var.cmt_nonce+"&cmt_id="+cmt_id+"&cmt_meta="+cmt_meta, 641 success: function(res){ 642 $( parent ).html(res); 643 }, 644 error: function (jqXHR, exception) { 645 console.log(jqXHR); 646 } 647 });
648 } 649 return false; 650 }); 651 } 652 653 /*Mailchimp Code*/ 654 if( $('.zozo-mc').length ){ 655 $('.zozo-mc').on( "click", function () { 656 657 var c_btn = $(this); 658 var mc_wrap = $( this ).parents('.mailchimp-wrapper'); 659 var mc_form = $( this ).parents('.zozo-mc-form'); 660 661 if( mc_form.find('input[name="zozo_mc_email"]').val() == '' ){ 662 mc_wrap.find('.mc-notice-msg').text( klenster_ajax_var.must_fill ); 663 }else{ 664 c_btn.attr( "disabled", "disabled" ); 665 $.ajax({ 666 type: "POST", 667 url: klenster_ajax_var.admin_ajax_url, 668 data: 'action=zozo-mc&nonce='+klenster_ajax_var.mc_nounce+'&'+mc_form.serialize(), 669 success: function (data) { 670 //Success 671 c_btn.removeAttr( "disabled" ); 672 mc_wrap.find('.mc-notice-msg').removeClass("mc-success mc-failed"); 673 if( data == 'success' ){ 674 mc_wrap.find('.mc-notice-msg').addClass("mc-success"); 675 mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-success') ); 676 }else{ 677 mc_wrap.find('.mc-notice-msg').addClass("mc-failed"); 678 mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-fail') ); 679 } 680 },error: function(xhr, status, error) { 681 c_btn.removeAttr( "disabled" ); 682 mc_wrap.find('.mc-notice-msg').removeClass("mc-success mc-failed"); 683 mc_wrap.find('.mc-notice-msg').addClass("mc-failed"); 684 mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-fail') ); 685 } 686 }); 687 } 688 }); 689 } // if mailchimp exists 690 691 /* Facbook Comment Width Resize */ 692 if( $( '.fb-comments-wrapper' ).length ){ 693 $( window ).resize(function() { 694 setTimeout(function(){ 695 if($( window ).width() <= 768 ){ 696 $( ".fb-comments-wrapper iframe" ).width( $( ".content-area" ).width() ); 697 }else{ 698 $( ".fb-comments-wrapper iframe" ).width( $( ".content-area .fb-comments" ).data('width') ); 699 } 700 }, 200); 701 }); 702 } 703 704 if( $('.popover-wrapper .popover-trigger').length ){ 705 $(".popover-trigger").each(function( index ) { 706 var _evnt_name = $(this).attr("data-event") ? $(this).attr("data-event") : 'hover'; 707 if( _evnt_name == 'hover' ){ 708 $(this).on( "mouseenter mouseleave", function ( e ) { 709 e.preventDefault(); 710 $(this).parent(".popover-wrapper").toggleClass("popover-active"); 711 }); 712 }else{ 713 $(this).on( "click", function ( e ) { 714 e.preventDefault(); 715 $(this).parent(".popover-wrapper").toggleClass("popover-active"); 716 }); 717 } 718 }); 719 } 720 721 $(window).scroll(function(){ 722 klenster_scroll_animation(); 723 }); 724 725 }); // doc ready end 726 727 728 $( window ).load(function() { 729 730 731 // Set Sticky Height for Menu Bars 732 klenster_set_sticky_outer_height(); 733 734 /* Sticky Menu */ 735 if($('.header-inner .sticky-head').length){ 736 klenster_sticky_part( '.header-inner' ); 737 } 738 739 /* Scroll Sticky */ 740 if($('.header-inner .sticky-scroll').length){ 741 klenster_sticky_scroll_up_part( '.header-inner', 'header' ); 742 } 743 744 /* Mobile Header Sticky Menu */ 745 if($('.mobile-header-inner .sticky-head').length){ 746 klenster_sticky_part( '.mobile-header-inner' ); 747 } 748 749 /* Mobile Header Scroll Sticky */ 750 if($('.mobile-header-inner .sticky-scroll').length){ 751 klenster_sticky_scroll_up_part( '.mobile-header-inner', '.mobile-header' ); 752 } 753 754 //Page loader 755 if( $(".page-loader").length ){ 756 $(".page-loader").fadeOut("slow"); 757 }else if( $("body.opacity-zero").length ){ 758 $("body").removeClass("opacity-zero"); 759 $("body").addClass("opacity-one"); 760 }else if( $('body[data-corestat="1"]').length ){ 761 $("body").removeAttr("data-corestat"); 762 $("body").addClass("opacity-one"); 763 } 764 765 //Header slider height 766 if( $( ".header-slider-wrapper" ).length ){ 767 $( ".header-slider-wrapper" ).css({ 'height' : 'auto' }); 768 } 769 770 // Grid Layout Set Width for Owl and Isotope 771 if( $( ".grid-layout.grid-normal" ).length ){ 772 773 $( ".grid-layout.grid-normal" ).each(function() { 774 775 var c_elem = $( this ); 776 var parent_width = c_elem.width(); 777 var gutter_size = c_elem.data( "gutter" ); 778 var grid_cols = c_elem.data( "cols" ); 779 780 var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 781 var gn_ele = 1; // grid normal element variable 782 c_elem.children("article").each(function() { 783 if( gn_ele % grid_cols == 0 ){ 784 $( this ).css({'width':net_width+'px', 'margin-right': '0', 'margin-bottom': gutter_size+'px'}); 785 }else{ 786 $( this ).css({'width':net_width+'px', 'margin-right': gutter_size+'px', 'margin-bottom': gutter_size+'px'}); 787 } 788 gn_ele++; 789 }); 790 791 c_elem.children("article").addClass("grid-dyno-visible"); 792 793 $( window ).resize(function() { 794 setTimeout(function(){ 795 parent_width = c_elem.width(); 796 var mgrid_cols = 1; 797 if( $(window).width() < 768 ){ 798 mgrid_cols = 1; 799 }else{ 800 mgrid_cols = grid_cols; 801 } 802 var net_width = Math.floor( ( parent_width - ( gutter_size * ( mgrid_cols - 1 ) ) ) / mgrid_cols ); 803 var gn_ele = 1; // grid normal element variable 804 c_elem.children("article").each(function() { 805 if( gn_ele % mgrid_cols == 0 ){ 806 $( this ).css({'width':net_width+'px', 'margin-right': '0', 'margin-bottom': gutter_size+'px'}); 807 }else{ 808 $( this ).css({'width':net_width+'px', 'margin-right': gutter_size+'px', 'margin-bottom': gutter_size+'px'}); 809 } 810 gn_ele++; 811 }); 812 }, 200); 813 }); 814 815 c_elem.find( ".top-standard-post article" ).css({'width':'auto'}); 816 817 }); // each end 818 } // .grid-layout 819 820 /// Theme Owl Carousel Code 821 $( ".owl-carousel" ).each(function() { 822 if( !$( this ).parents( ".isotope" ).length ){ 823 klenster_owl_settings( $( this ) ); 824 } 825 }); 826 827 // Isotope Grid Layout 828 if( $( ".grid-layout > .isotope" ).length ){ 829 $( ".grid-layout > .isotope" ).each(function() { 830 831 var c_elem = $( this ); 832 var parent_width = c_elem.width(); 833 var gutter_size = c_elem.data( "gutter" ); 834 var grid_cols = c_elem.data( "cols" ); 835 836 var layoutmode = c_elem.is('[data-layout]') ? c_elem.data( "layout" ) : ''; 837 838 layoutmode = layoutmode ? layoutmode : 'masonry'; 839 840 if( $(window).width() < 768 ) grid_cols = 1; 841 842 var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 843 c_elem.find( "article" ).css({'width':net_width+'px', 'margin-bottom':gutter_size+'px'}); 844 if( $( ".top-standard-post" ).length ){ 845 $( ".top-standard-post article" ).css({'margin-bottom':gutter_size+'px'}); 846 } 847 848 c_elem.find( ".owl-carousel" ).each(function() { 849 klenster_owl_settings( $( this ) ); 850 }); 851 852 c_elem.find( "video" ).each(function( index ) { 853 $( this ).attr( "src", $( this ).find( "source" ).attr( "src" ) ); 854 $( this ).css({ 'height':'200px' }); 855 }); 856 857 var filter = "*"; 858 var isot_parent = c_elem.parent(".grid-layout"); 859 if( $( isot_parent ).attr("data-filter-stat") == 0 ){ 860 filter = $( isot_parent ).attr("data-first-cat") ? "." + $( isot_parent ).attr("data-first-cat") : '*'; 861 } 862 863 c_elem.imagesLoaded( function(){ 864 c_elem.isotope({ 865 itemSelector: 'article', 866 layoutMode: layoutmode, 867 filter: filter, 868 masonry: { 869 gutter: gutter_size 870 }, 871 fitRows: { 872 gutter: gutter_size 873 } 874 });
875 }); 876 877 c_elem.children("article").addClass("grid-dyno-visible"); 878 879 /* Portfolio Filter Item */ 880 if( $(".portfolio-filter").length ){ 881 $( ".portfolio-filter-item" ).on( 'click', function() { 882 $( this ).parents("ul.nav").find("li").removeClass("active"); 883 $( this ).parent("li").addClass("active"); 884 var filterValue = $( this ).attr( "data-filter" ); 885 c_elem = $( this ).parents( ".portfolio-wrapper" ).find( ".grid-layout .isotope" ); 886 c_elem.isotope({ 887 filter: filterValue 888 }); 889 return false; 890 }); 891 } 892 893 $( window ).resize(function() { 894 895 setTimeout(function(){ 896 grid_cols = c_elem.data( "cols" ); 897 if( $(window).width() < 768 ) grid_cols = 1; 898 899 var parent_width = c_elem.width(); 900 net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 901 c_elem.find( "article" ).css({'width':net_width+'px'}); 902 c_elem.imagesLoaded( function(){ 903 var $isot = c_elem.isotope({ 904 itemSelector: 'article', 905 masonry: { 906 gutter: gutter_size 907 } 908 }); 909 $isot.on( 'arrangeComplete', isotopeArrange ); 910 }); 911 912 }, 200); 913 914 }); 915 916 // Isotope Grid Infinite 917 if( c_elem.data( "infinite" ) == 1 && $(".post-pagination").length ){ 918 919 c_elem.infinitescroll({ 920 navSelector : '.post-pagination',//'#page_nav', // selector for the paged navigation 921 nextSelector : 'a.next-page',//'#page_nav a', // selector for the NEXT link (to page 2) 922 itemSelector : 'article', // selector for all items you'll retrieve 923 loading: { 924 msgText : klenster_ajax_var.load_posts, 925 finishedMsg: klenster_ajax_var.no_posts, 926 img: klenster_ajax_var.infinite_loader 927 } 928 }, 929 // call Isotope as a callback 930 function( newElements ) { 931 932 var elems = $(newElements); 933 934 var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 935 c_elem.find( "article" ).css({'width':net_width+'px', 'margin-bottom':gutter_size+'px'}); 936 if( $( ".top-standard-post" ).length ){ 937 $( ".top-standard-post article" ).css({'margin-bottom':gutter_size+'px'}); 938 } 939 940 c_elem.find( ".owl-carousel" ).each(function() { 941 klenster_owl_settings( $( this ) ); 942 }); 943 944 elems.find( "video" ).each(function( index ) { 945 $( this ).attr( "src", $( this ).find( "source" ).attr( "src" ) ); 946 $( this ).css({ 'height':'200px' }); 947 }); 948 949 elems.imagesLoaded( function(){ 950 c_elem.isotope( 'appended', elems ); 951 elems.addClass("grid-dyno-visible"); 952 }); 953 954 if( c_elem.find( "article" ).hasClass( "klenster-animate" ) ){ 955 klenster_scroll_animation(); 956 } 957 958 }); 959 } 960 }); // each end 961 } 962 963 // Related Slider Empty Post Image Height Set 964 if( $( ".related-slider .empty-post-image" ).length ){ 965 if( $( ".related-slider .item .wp-post-image" ).length ){ 966 $( ".related-slider .item .empty-post-image" ).height( $( ".related-slider .item .wp-post-image" ).height() ); 967 } 968 } 969 970 // Featured Slider Empty Post Image Height Set 971 if( $( ".featured-slider .empty-post-image" ).length ){ 972 if( $( ".featured-slider .item .wp-post-image" ).length ){ 973 $( ".featured-slider .item .empty-post-image" ).height( $( ".featured-slider .item .wp-post-image" ).height() ); 974 } 975 } 976 977 // Sticky Sidebar 978 if( $( ".klenster-sticky-obj" ).length ){ 979 var $sticky_sidebars = $( ".klenster-sticky-obj" ); 980 if( $( window ).width() > 767 ) { 981 $sticky_sidebars.stick_in_parent(); 982 } 983 $( window ).resize(function() { 984 if( $( window ).width() > 767 ) { 985 $sticky_sidebars.trigger( "sticky_kit:detach" ); 986 $sticky_sidebars.stick_in_parent(); 987 $sticky_sidebars.trigger( "sticky_kit:recalc" ); 988 }else{ 989 $sticky_sidebars.trigger( "sticky_kit:detach" ); 990 } 991 }); 992 } 993 994 // Circle Counter Shortcode Script 995 if( $( '.circle-progress-circle' ).length ){ 996 var circle = $( '.circle-progress-circle' ); 997 circle.appear(function() { 998 999 var c_circle = $( this ); 1000 var c_value = c_circle.attr( "data-value" ); 1001 var c_size = c_circle.attr( "data-size" ); 1002 var c_thickness = c_circle.attr( "data-thickness" ); 1003 var c_duration = c_circle.attr( "data-duration" ); 1004 var c_empty = c_circle.attr( "data-empty" ) != '' ? c_circle.attr( "data-empty" ) : 'transparent'; 1005 var c_scolor = c_circle.attr( "data-scolor" ); 1006 var c_ecolor = c_circle.attr( "data-ecolor" ) != '' ? c_circle.attr( "data-ecolor" ) : c_scolor; 1007 1008 c_circle.circleProgress({ 1009 value: Math.floor( c_value ) / 100, 1010 size: Math.floor( c_size ), 1011 thickness: Math.floor( c_thickness ), 1012 emptyFill: c_empty, 1013 animation: { 1014 duration: Math.floor( c_duration ) 1015 }, 1016 lineCap: 'round', 1017 fill: { 1018 gradient: [c_scolor, c_ecolor] 1019 } 1020 }).on( 'circle-animation-progress', function( event, progress ) { 1021 $( this ).find( '.progress-value' ).html( Math.round( c_value * progress ) + '%' ); 1022 }); 1023 }); 1024 } 1025 1026 // Day Counter Shortcode Script 1027 if( $( '.day-counter' ).length ){ 1028 $( '.day-counter' ).each(function() { 1029 var day_counter = $( this ); 1030 var dprogress = $(day_counter).hasClass("day-counter-progress") ? true : false; 1031 var c_date = day_counter.attr('data-date'); 1032 day_counter.countdown( c_date, function(event) { 1033 if( day_counter.find('.counter-day').length ){ 1034 day_counter.find('.counter-day h3').text( event.strftime('%D') ); 1035 if( dprogress ){ 1036 var yr = parseInt( event.strftime('%D') ); 1037 yr = yr ? parseInt( yr / 365 * 100 ) : 100; 1038 klenster_day_circle( day_counter.find('.counter-day'), yr ); 1039 } 1040 } 1041 if( day_counter.find('.counter-hour').length ){ 1042 day_counter.find('.counter-hour h3').text( event.strftime('%H') ); 1043 if( dprogress ){ 1044 var hur = parseInt( event.strftime('%H') ); 1045 hur = hur ? parseInt( hur / 24 * 100 ) : 100; 1046 klenster_day_circle( day_counter.find('.counter-hour'), hur ); 1047 } 1048 } 1049 if( day_counter.find('.counter-min').length ){ 1050 day_counter.find('.counter-min h3').text( event.strftime('%M') ); 1051 if( dprogress ){ 1052 var mnth = parseInt( event.strftime('%M') ); 1053 mnth = mnth ? parseInt( mnth / 60 * 100 ) : 100; 1054 klenster_day_circle( day_counter.find('.counter-min'), mnth ); 1055 } 1056 } 1057 if( day_counter.find('.counter-sec').length ){ 1058 day_counter.find('.counter-sec h3').text( event.strftime('%S') ); 1059 if( dprogress ){ 1060 var tme = parseInt( event.strftime('%S') ); 1061 tme = tme ? parseInt( tme / 60 * 100 ) : 100; 1062 klenster_day_circle( day_counter.find('.counter-sec'), tme ); 1063 } 1064 } 1065 if( day_counter.find('.counter-week').length ){ 1066 day_counter.find('.counter-week h3').text( event.strftime('%w') ); 1067 if( dprogress ){ 1068 var wk = parseInt( event.strftime('%S') ); 1069 wk = wk ? parseInt( wk / 60 * 100 ) : 100; 1070 klenster_day_circle( day_counter.find('.counter-week'), wk ); 1071 } 1072 } 1073 }); 1074 }); 1075 } 1076 1077 // Canvas Shapes 1078 if( $(".canvas_agon").length ){ 1079 $( '.canvas_agon' ).each(function() { 1080 klenster_agon( $(this) ); 1081 }); 1082 } 1083 1084 // Header Bar Center Item Margin Fun 1085 setTimeout( klenster_center_menu_margin, 300 ); 1086 1087 // Google map 1088 if( $( ".klenstergmap" ).length ){ 1089 initKlensterGmap(); 1090 } 1091 1092 //Elementor RTL issue 1093 if( $("body.rtl").length && $("section.elementor-section-stretched").length ){ 1094 klenster_for_elementor_row(); 1095 } 1096 1097 // Scroll animation 1098 klenster_scroll_animation(); 1099 1100 }); 1101 1102 // Using window smartresize instead of resize function 1103 $( window ).smartresize(function() { 1104 1105 //Elementor RTL issue 1106 if( $("body.rtl").length && $("section.elementor-section-stretched").length ){ 1107 klenster_for_elementor_row(); 1108 } 1109 1110 /* Custom Responsive Width */ 1111 var win_width = $(window).width(); 1112 if( responsive_width ){ 1113 klenster_set_custom_hidden_elements( win_width, responsive_width ); 1114 } 1115 1116 /* Mobile Bar Toggle */ 1117 setTimeout( function(){ $(".mobile-bar.active").length ? $( ".mobile-header .mobile-bar-toggle" ).trigger( "click" ) : ''; }, 100 ); 1118 1119 /* Pull Center Reset */ 1120 setTimeout( klenster_center_menu_margin, 300 ); 1121 1122 /* Sticky Menu */ 1123 setTimeout( klenster_set_sticky_outer_height, 100 ); 1124 1125 /* Sticky Menu */ 1126 if($('.header-inner .sticky-head').length){ 1127 setTimeout( klenster_sticky_part( '.header-inner' ), 100 ); 1128 } 1129 1130 /* Scroll Sticky */ 1131 if($('.header-inner .sticky-scroll').length){ 1132 setTimeout( klenster_sticky_scroll_up_part( '.header-inner', 'header' ), 100 ); 1133 } 1134 1135 /* Mobile Header Sticky Menu */ 1136 if($('.mobile-header-inner .sticky-head').length){ 1137 setTimeout( klenster_sticky_part( '.mobile-header-inner' ), 100 ); 1138 } 1139 1140 /* Mobile Header Scroll Sticky */ 1141 if($('.mobile-header-inner .sticky-scroll').length){ 1142 setTimeout( klenster_sticky_scroll_up_part( '.mobile-header-inner', '.mobile-header' ), 100 ); 1143 } 1144 1145 klenster_scroll_animation(); 1146 1147 }); 1148 1149 //Day Counter Progress 1150 function klenster_day_circle( ele, value ){ 1151 var c_circle = $( ele ); 1152 var parent_ele = $( ele ).parent( ".day-counter-progress" ); 1153 var c_value = value; 1154 var c_size = $( parent_ele ).attr("data-size") ? $( parent_ele ).attr("data-size") : 100; 1155 var c_thickness = $( parent_ele ).attr("data-thick") ? $( parent_ele ).attr("data-thick") : 10; 1156 var c_duration = 0; 1157 var c_empty = $( parent_ele ).attr("data-empty-color") ? $( parent_ele ).attr("data-empty-color") : '#eee'; 1158 var c_scolor = $( parent_ele ).attr("data-fill-color") ? $( parent_ele ).attr("data-fill-color") : '#333'; 1159 var c_ecolor = c_scolor; 1160
1161 c_circle.circleProgress({ 1162 value: Math.floor( c_value ) / 100, 1163 size: Math.floor( c_size ), 1164 thickness: Math.floor( c_thickness ), 1165 emptyFill: c_empty, 1166 animation: { 1167 duration: Math.floor( c_duration ) 1168 }, 1169 lineCap: 'round', 1170 fill: { 1171 gradient: [c_scolor, c_ecolor] 1172 } 1173 }); 1174 } 1175 1176 function isotopeArrange() { 1177 $( ".grid-layout > .isotope" ).find( "audio, video" ).each(function( index ) { 1178 $( this )[0].play(); 1179 $( this )[0].pause(); 1180 }); 1181 } 1182 1183 function klenster_for_elementor_row(){ 1184 $("body.rtl section.elementor-section-stretched").each(function() { 1185 var left_pos = $(this).css( "left" ); 1186 left_pos = Math.abs( parseFloat(left_pos) ); 1187 if( left_pos ) $(this).css( "left", left_pos ); 1188 }); 1189 } 1190 1191 function klenster_set_custom_hidden_elements( win_width, responsive_width ){ 1192 if( win_width > responsive_width ){ 1193 $(".header-inner").show(); 1194 $(".mobile-header-inner, .mobile-topbar-wrap").hide(); 1195 }else{ 1196 $(".header-inner").hide(); 1197 $(".mobile-header-inner, .mobile-topbar-wrap").show(); 1198 } 1199 } 1200 1201 function klenster_sticky_header_adjust(elem_pos, elem_width){ 1202 var win_width = $(window).width(); 1203 var compare_wdth; 1204 if( $('.klenster-header .header-inner.hidden-md-land-down' ).length ){ 1205 compare_wdth = 1024; 1206 }else{ 1207 compare_wdth = 991; 1208 } 1209 if( win_width <= compare_wdth ){ 1210 if( elem_pos == 'left' ){ 1211 $('.sticky-header-space').css( 'left', '-'+ elem_width +'px' ); 1212 $('body, .top-sliding-bar').css( 'padding-left', '0' ); 1213 }else{ 1214 $('.sticky-header-space').css( 'right', '-'+ elem_width +'px' ); 1215 $('body, .top-sliding-bar').css( 'padding-right', '0' ); 1216 } 1217 }else{ 1218 if( elem_pos == 'left' ){ 1219 $('.sticky-header-space').css( 'left', 0 ); 1220 $('body, .top-sliding-bar').css( 'padding-left', elem_width +'px' ); 1221 }else{ 1222 $('.sticky-header-space').css( 'right', 0 ); 1223 $('body, .top-sliding-bar').css( 'padding-right', elem_width +'px' ); 1224 } 1225 } 1226 } 1227 1228 function klenster_center_menu_margin(){ 1229 //Center item margin fixing 1230 $.each([ 'topbar', 'logobar', 'navbar', 'mobile-header', 'footer-bottom' ], function( index, margin_key ) { 1231 1232 var left_width = 0, 1233 right_width = 0, 1234 center_width = 0, 1235 margin_left = 0, 1236 parent_width = 0; 1237 1238 if( $('.'+ margin_key +' .'+ margin_key +'-inner .pull-center').length ){ 1239 1240 if( margin_key == 'mobile-header' ) 1241 parent_width = $('.'+ margin_key +' .'+ margin_key +'-inner .container').width(); 1242 else 1243 parent_width = $('.'+ margin_key +' .'+ margin_key +'-inner').width(); 1244 1245 if( $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-left').length ){ 1246 left_width = $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-left').width(); 1247 } 1248 if( $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-right').length ){ 1249 right_width = $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-right').width(); 1250 } 1251 if( $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').length ){ 1252 center_width = $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').width(); 1253 } 1254 1255 if( left_width + center_width + right_width ){ 1256 1257 if( margin_key == 'mobile-header' ){ 1258 parent_width -= ( left_width + center_width + right_width ); 1259 margin_left = parent_width / 2; 1260 }else{ 1261 var midd_point = parent_width / 2; 1262 var left_point = midd_point - ( center_width / 2 ); 1263 margin_left = Math.floor( left_point - left_width ); 1264 } 1265 1266 if( !$( "body.rtl" ).length ){ 1267 $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').css( 'margin-left', margin_left+'px' ); 1268 }else{ 1269 $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').css( 'margin-right', margin_left+'px' ); 1270 } 1271 1272 $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').addClass("show-opacity"); 1273 1274 } 1275 } 1276 }); 1277 } 1278 1279 function klenster_sticky_part( main_class ){ 1280 1281 var outer_class = '.sticky-outer'; 1282 var lastScrollTop = 0; 1283 var header_top = 0; 1284 1285 var t_header_h = $(main_class + ' ' + outer_class).data( "height" ); 1286 $(main_class + ' ' + outer_class).css( 'height', t_header_h ); 1287 header_top = $(main_class + ' ' + outer_class).offset().top; 1288 header_top += t_header_h; 1289 1290 $(window).scroll(function(event){ 1291 1292 var st = $(this).scrollTop(); 1293 if( st > header_top ){ 1294 $(main_class + ' .sticky-head').addClass('header-sticky'); 1295 }else{ 1296 $(main_class + ' .sticky-head').removeClass('header-sticky'); 1297 } 1298 1299 if( st == 0 ){ 1300 $(main_class + ' .sticky-head').removeClass('header-sticky'); 1301 } 1302 1303 lastScrollTop = st; 1304 }); 1305 } 1306 1307 function klenster_sticky_scroll_up_part( main_class, sticky_div ){ 1308 1309 var outer_class = '.sticky-outer'; 1310 var out_height = ''; 1311 var lastScrollTop = 0; 1312 var header_top = 0; 1313 1314 $(main_class + ' ' + outer_class).css( 'height', $(main_class + ' ' + outer_class).data( "height" ) ); 1315 out_height = '-' + $(main_class + ' ' + outer_class).outerHeight() + 'px'; 1316 header_top = $(main_class + ' ' + outer_class).offset().top; 1317 sticky_div = $(sticky_div).height(); 1318 1319 $(window).scroll(function(event){ 1320 1321 var st = $(this).scrollTop(); 1322 1323 if( st < lastScrollTop && header_top < lastScrollTop ){ 1324 // upscroll code 1325 $(main_class + ' .sticky-scroll').addClass('show-menu'); 1326 $(main_class + ' .sticky-scroll.show-menu').css({'transform': 'translate3d(0px, 0px, 0px)'}); 1327 }else{ 1328 // downscroll code 1329 if( st < sticky_div ){ 1330 $(main_class + ' .sticky-scroll').css({'transform': ''}); 1331 $(main_class + ' .sticky-scroll.show-menu').removeClass('show-menu'); 1332 }else{ 1333 $(main_class + ' .sticky-scroll').css({'transform': 'translate3d(0px, '+ out_height +', 0px)'}); 1334 } 1335 } 1336 1337 if( st == 0 ){ 1338 $(main_class + ' .sticky-scroll').css({'transform': ''}); 1339 $(main_class + ' .sticky-scroll.show-menu').removeClass('show-menu'); 1340 } 1341 1342 lastScrollTop = st; 1343 }); 1344 1345 } 1346 1347 function klenster_set_sticky_outer_height(){ 1348 $( ".sticky-outer" ).each(function() { 1349 1350 var class_name = ''; 1351 var sticky_parent = $( this ).parent( "div" ); 1352 1353 if( $( sticky_parent ).is('[class*=hidden-]') ){ 1354 class_name = $( sticky_parent ).attr("class"); 1355 var t_stat = ''; 1356 if( $( sticky_parent ).hasClass( "mobile-header-inner" ) ){
1357 class_name = class_name.replace( "mobile-header-inner", "" ); 1358 t_stat = 'm'; 1359 } 1360 if( $( sticky_parent ).hasClass( "header-inner" ) ){ 1361 class_name = class_name.replace( "header-inner", "" ); 1362 t_stat = 'd'; 1363 } 1364 $( sticky_parent ).attr("class", ""); 1365 if( t_stat == 'm' ){ 1366 $( sticky_parent ).attr("class", "mobile-header-inner"); 1367 } 1368 if( t_stat == 'd' ){ 1369 $( sticky_parent ).attr("class", "header-inner"); 1370 } 1371 } 1372 1373 $( this ).css({ 'position':'relative', 'visibility':'hidden', 'display':'block', 'height':'auto' }); 1374 var hght = $( this ).outerHeight(); 1375 $( this ).attr( "data-height", hght ); 1376 1377 if( class_name != '' ){ 1378 $( sticky_parent ).addClass(class_name); 1379 } 1380 1381 $( this ).css({ 'position':'', 'visibility':'', 'display':'', 'height': hght }); 1382 1383 }); 1384 } 1385 1386 function klenster_agon( canvas_ele ){ 1387 var canvas = document.getElementById("canvas_agon"); 1388 var cxt = canvas.getContext("2d"); 1389 var agon_size = canvas_ele.attr( "data-size" ); 1390 var agon_side = canvas_ele.attr( "data-side" ); 1391 var agon_color = canvas_ele.attr( "data-color" ); 1392 var div_val = 1; 1393 1394 switch( parseInt( agon_side ) ){ 1395 case 3: 1396 div_val = 6; 1397 break; 1398 case 4: 1399 div_val = 4; 1400 break; 1401 case 5: 1402 div_val = 3.3; 1403 break; 1404 case 6: 1405 div_val = 3; 1406 break; 1407 case 7: 1408 div_val = 2.8; 1409 break; 1410 case 8: 1411 div_val = 2.7; 1412 break; 1413 case 9: 1414 div_val = 2.6; 1415 break; 1416 case 10: 1417 div_val = 2.5; 1418 break; 1419 } 1420 1421 // hexagon 1422 var numberOfSides = parseInt( agon_side ), 1423 size = parseInt( agon_size ), 1424 Xcenter = parseInt( agon_size ), 1425 Ycenter = parseInt( agon_size ), 1426 step = 2 * Math.PI / numberOfSides,//Precalculate step value 1427 shift = (Math.PI / div_val);//(Math.PI / 180.0);// * 44;//Quick fix ;) 1428 1429 cxt.beginPath(); 1430 1431 for (var i = 0; i <= numberOfSides;i++) { 1432 var curStep = i * step + shift; 1433 cxt.lineTo (Xcenter + size * Math.cos(curStep), Ycenter + size * Math.sin(curStep)); 1434 } 1435 1436 /* Direct Output */ 1437 cxt.fillStyle = agon_color; 1438 cxt.fill(); 1439 } 1440 1441 function klenstertesipagecallback(event){ 1442 var current = event.item.index; 1443 $( event.target ).find(".owl-item.active").eq(0).addClass("current"); 1444 } 1445 1446 function klenster_owl_settings(c_owlCarousel){ 1447 1448 var page_slide = false; 1449 var pagi_slide = false; 1450 if( c_owlCarousel.hasClass("klenster-page-carousel") ){ page_slide = true; } 1451 if( c_owlCarousel.hasClass("klenster-pagination-carousel") ){ pagi_slide = true; } 1452 1453 // Data Properties 1454 var loop = c_owlCarousel.data( "loop" ); 1455 var margin = c_owlCarousel.data( "margin" ); 1456 var center = c_owlCarousel.data( "center" ); 1457 var nav = c_owlCarousel.data( "nav" ); 1458 var dots_ = c_owlCarousel.data( "dots" ); 1459 var items = c_owlCarousel.data( "items" ); 1460 var items_tab = c_owlCarousel.data( "items-tab" ); 1461 var items_mob = c_owlCarousel.data( "items-mob" ); 1462 var duration = c_owlCarousel.data( "duration" ); 1463 var smartspeed = c_owlCarousel.data( "smartspeed" ); 1464 var scrollby = c_owlCarousel.data( "scrollby" ); 1465 var autoheight = c_owlCarousel.data( "autoheight" ); 1466 var autoplay = c_owlCarousel.data( "autoplay" ); 1467 var rtl = $( "body.rtl" ).length ? true : false; 1468 1469 $( c_owlCarousel ).owlCarousel({ 1470 rtl : rtl, 1471 loop : loop, 1472 autoplayTimeout : duration, 1473 smartSpeed : smartspeed, 1474 center: center, 1475 margin : margin, 1476 nav : nav, 1477 dots : dots_, 1478 autoplay : autoplay, 1479 autoheight : autoheight, 1480 slideBy : scrollby, 1481 responsive:{ 1482 0:{ 1483 items: items_mob 1484 }, 1485 544:{ 1486 items: items_tab 1487 }, 1488 992:{ 1489 items: items 1490 } 1491 }, 1492 onInitialized: pagi_slide ? klenstertesipagecallback : '' 1493 }); 1494 1495 if( pagi_slide ){ 1496 var cur_testi_slide = $( c_owlCarousel ).parent("div").children(".klenster-page-carousel"); 1497 var cur_pagination_slide = $( c_owlCarousel ); 1498 $( c_owlCarousel ).on('click', '.owl-item', function(event) { 1499 var current = $(this).index(); 1500 $(cur_testi_slide).trigger("to.owl.carousel", [current, 500]); 1501 }); 1502 $( c_owlCarousel ).on('dragged.owl.carousel', function(event) { 1503 var current = event.item.index; 1504 $(cur_testi_slide).trigger("to.owl.carousel", [current, 500]); 1505 cur_pagination_slide.find(".owl-item.current").removeClass("current"); 1506 cur_pagination_slide.find(".owl-item").eq(current).addClass("current"); 1507 }); 1508 } 1509 if( page_slide ){ 1510 var cur_pagination_slide = $( c_owlCarousel ).parent("div").children(".klenster-pagination-carousel"); 1511 $( c_owlCarousel ).on('changed.owl.carousel', function(event) { 1512 var current = event.item.index; 1513 $(cur_pagination_slide).trigger("to.owl.carousel", [current, 500]); 1514 $(cur_pagination_slide).find(".owl-item.current").removeClass("current"); 1515 $(cur_pagination_slide).find(".owl-item").eq(current).addClass("current"); 1516 }); 1517 } 1518 1519 } 1520 1521 function convert_time(duration) { 1522 var a = duration.match(/\d+/g); 1523 1524 if (duration.indexOf('M') >= 0 && duration.indexOf('H') == -1 && duration.indexOf('S') == -1) { 1525 a = [0, a[0], 0]; 1526 } 1527 1528 if (duration.indexOf('H') >= 0 && duration.indexOf('M') == -1) { 1529 a = [a[0], 0, a[1]];
1530 } 1531 if (duration.indexOf('H') >= 0 && duration.indexOf('M') == -1 && duration.indexOf('S') == -1) { 1532 a = [a[0], 0, 0]; 1533 } 1534 1535 duration = 0; 1536 1537 if (a.length == 3) { 1538 duration = duration + parseInt(a[0]) * 3600; 1539 duration = duration + parseInt(a[1]) * 60; 1540 duration = duration + parseInt(a[2]); 1541 } 1542 1543 if (a.length == 2) { 1544 duration = duration + parseInt(a[0]) * 60; 1545 duration = duration + parseInt(a[1]); 1546 } 1547 1548 if (a.length == 1) { 1549 duration = duration + parseInt(a[0]); 1550 } 1551 var h = Math.floor(duration / 3600); 1552 var m = Math.floor(duration % 3600 / 60); 1553 var s = Math.floor(duration % 3600 % 60); 1554 return ((h > 0 ? h + ":" + (m < 10 ? "0" : "") : "") + m + ":" + (s < 10 ? "0" : "") + s); 1555 } 1556 1557 function klenster_scroll_animation(){ 1558 setTimeout( function() { 1559 var anim_time = 300; 1560 $('.klenster-animate:not(.run-animate)').each( function() { 1561 1562 var elem = $(this); 1563 var bottom_of_object = elem.offset().top; 1564 var bottom_of_window = $(window).scrollTop() + $(window).height(); 1565 1566 if( bottom_of_window > bottom_of_object ){ 1567 setTimeout( function() { 1568 elem.addClass("run-animate"); 1569 }, anim_time ); 1570 } 1571 anim_time += 300; 1572 1573 }); 1574 }, 200 ); 1575 } 1576 1577 function initKlensterGmap() { 1578 1579 1580 if( klenster_ajax_var.gmap_stat == '0' ){ 1581 return; 1582 } 1583 1584 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"}]}] }'; 1585 1586 var map_style_obj = JSON.parse(map_styles); 1587 1588 var map_style_mode = []; 1589 var map_mode = ''; 1590 var map_lang = ''; 1591 var map_lat = ''; 1592 var map_marker = ''; 1593 var map_options = ''; 1594 1595 $( ".klenstergmap" ).each(function( index ) { 1596 1597 var gmap = this; 1598 1599 if( $( gmap ).attr( "data-map-style" ) ){ 1600 map_mode = $( gmap ).data("map-style"); 1601 map_lang = $( gmap ).data("map-lang"); 1602 map_lat = $( gmap ).data("map-lat"); 1603 map_marker = $( gmap ).data("map-marker"); 1604 if( map_mode === 'aubergine' ) 1605 map_style_mode = map_style_obj.Aubergine; 1606 else if( map_mode === 'silver' ) 1607 map_style_mode = map_style_obj.Silver; 1608 else if( map_mode === 'retro' ) 1609 map_style_mode = map_style_obj.Retro; 1610 else if( map_mode === 'dark' ) 1611 map_style_mode = map_style_obj.Dark; 1612 else if( map_mode === 'night' ) 1613 map_style_mode = map_style_obj.Night; 1614 else if( map_mode === 'custom' ){ 1615 var c_style = $( gmap ).attr( "data-custom-style" ) && $( gmap ).attr( "data-custom-style" ) != '' ? JSON.parse( $( gmap ).attr( "data-custom-style" ) ) : '[]'; 1616 map_style_mode = c_style; 1617 }else{ 1618 map_style_mode = "[]"; 1619 } 1620 } 1621 1622 if( $( gmap ).attr( "data-multi-map" ) && $( gmap ).attr( "data-multi-map" ) == 'true' ){ 1623 1624 var map_values = JSON.parse( $( gmap ).attr( "data-maps" ) ); 1625 var map_wheel = $( gmap ).attr( "data-wheel" ) && $( gmap ).attr( "data-wheel" ) == 'true' ? true : false; 1626 var map_zoom = $( gmap ).attr( "data-zoom" ) && $( gmap ).attr( "data-zoom" ) != '' ? parseInt( $( gmap ).attr( "data-zoom" ) ) : 14; 1627 var map; 1628 1629 var map_stat = 1; 1630
1631 map_values.forEach( function( map_value ) { 1632 map_lat = map_value.map_latitude; 1633 map_lang = map_value.map_longitude; 1634 var LatLng = new google.maps.LatLng( map_lat, map_lang ); 1635 var mapProp= { 1636 center: LatLng, 1637 scrollwheel: map_wheel, 1638 zoom: map_zoom, 1639 styles: map_style_mode 1640 }; 1641 1642 //Create Map 1643 if( map_stat ){ 1644 var t_gmap = $( gmap ); 1645 map = new google.maps.Map( t_gmap[0], mapProp ); 1646 1647 google.maps.event.addDomListener( window, 'resize', function() { 1648 var center = map.getCenter(); 1649 google.maps.event.trigger( map, "resize" ); 1650 map.setCenter( LatLng ); 1651 }); 1652 1653 map_stat = 0; 1654 } 1655 1656 //Map Marker 1657 var marker = new google.maps.Marker({ 1658 position: LatLng, 1659 icon: map_value.map_marker, 1660 map: map 1661 }); 1662 1663 //Info Window 1664 if( map_value.map_info_opt == 'on' ) { 1665 var info_title = map_value.map_info_title; 1666 var info_addr = map_value.map_info_address; 1667 var contentString = '<div class="gmap-info-wrap"><h3>'+ info_title +'</h3><p>'+ info_addr +'</p></div>'; 1668 var infowindow = new google.maps.InfoWindow({ 1669 content: contentString 1670 }); 1671 marker.addListener( 'click', function() { 1672 infowindow.open( map, marker ); 1673 }); 1674 } 1675 }); 1676 1677 }else{ 1678 1679 var LatLng = {lat: parseFloat(map_lat), lng: parseFloat(map_lang)}; 1680 1681 var map_wheel = $( gmap ).attr( "data-wheel" ) && $( gmap ).attr( "data-wheel" ) == 'true' ? true : false; 1682 var map_zoom = $( gmap ).attr( "data-zoom" ) && $( gmap ).attr( "data-zoom" ) != '' ? parseInt( $( gmap ).attr( "data-zoom" ) ) : 14; 1683 1684 var mapProp= { 1685 center: LatLng, 1686 scrollwheel: map_wheel, 1687 zoom: map_zoom, 1688 styles: map_style_mode 1689 }; 1690 var t_gmap = $( gmap ); 1691 var map = new google.maps.Map( t_gmap[0], mapProp ); //document.getElementById("klenstergmap") 1692 1693 var marker = new google.maps.Marker({ 1694 position: LatLng, 1695 icon: map_marker, 1696 map: map 1697 }); 1698 1699 if( $( gmap ).attr( "data-info" ) == 1 ){ 1700 var info_title = $( gmap ).attr( "data-info-title" ) ? $( gmap ).attr( "data-info-title" ) : ''; 1701 var info_addr = $( gmap ).attr( "data-info-addr" ) ? $( gmap ).attr( "data-info-addr" ) : ''; 1702 var contentString = '<div class="gmap-info-wrap"><h3>'+ info_title +'</h3><p>'+ info_addr +'</p></div>'; 1703 var infowindow = new google.maps.InfoWindow({ 1704 content: contentString 1705 }); 1706 marker.addListener( 'click', function() { 1707 infowindow.open( map, marker ); 1708 }); 1709 } 1710 1711 google.maps.event.addDomListener( window, 'resize', function() { 1712 var center = map.getCenter(); 1713 google.maps.event.trigger(map, "resize"); 1714 map.setCenter(LatLng); 1715 }); 1716 1717 }// data multi map false part end 1718 1719 }); // end map each 1720 1721 } 1722 1723})( 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.