1/* 2 * Zegen Theme Js 3 */ 4 5(function( $ ) { 6 7 "use strict"; 8 9 var zegen_body_atts = zegen_ajax_var.body_atts; 10 var responsive_width = zegen_body_atts && zegen_body_atts.res_width ? zegen_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 $( ".zegen-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="zegen-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 .zegen-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 .zegen-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 .zegen-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 .zegen-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 Header Space Menu to Modern Toggle Menu Convert */ 107 if( $('.sticky-header-space').length ){ 108 109 //Add toggle dropdown icon 110 $( ".sticky-header-space .zegen-main-menu" ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle ti-plus"></span>' ); 111 $( ".sticky-header-space .zegen-main-menu" ).find('.sub-menu').slideToggle(); 112 113 //zmm dropdown toggle 114 $( ".sticky-header-space .zmm-dropdown-toggle" ).on( "click", function() { 115 var parent = $( this ).parent('li').children('.sub-menu'); 116 $( this ).parent('li').children('.sub-menu').slideToggle(); 117 $( this ).toggleClass('ti-minus'); 118 if( $( parent ).find('.sub-menu').length ){ 119 $( parent ).find('.sub-menu').slideUp(); 120 $( parent ).find('.zmm-dropdown-toggle').removeClass('ti-minus'); 121 } 122 }); 123 124 } 125 126 //Custom Responsive Width 127 var win_width = $(window).width(); 128 if( responsive_width ){ 129 zegen_set_custom_hidden_elements( win_width, responsive_width ); 130 } 131 132 /* Full Search Toggle */ 133 $( document ).on( "click", ".full-search-toggle", function() { 134 $('.full-search-wrapper').toggleClass("search-wrapper-opened"); 135 $('.full-search-wrapper').fadeToggle(500); 136 var search_in = $('.search-wrapper-opened').find("input.form-control"); 137 search_in.focus(); 138 return false; 139 }); 140 141 /* Mobile Bar Animate Toggle */ 142 $( document ).on( "click", ".mobile-bar-toggle", function() { 143 $( ".mobile-bar" ).toggleClass('active'); 144 $( "body" ).toggleClass('mobile-bar-active'); 145 if( $( ".mobile-bar" ).hasClass('animate-from-left') ){ 146 if( $( ".mobile-bar" ).hasClass('active') ) 147 $( ".mobile-bar" ).animate( { left : 0 }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } ); 148 else 149 $( ".mobile-bar" ).animate( { left : "-100%" }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } ); 150 } 151 if( $( ".mobile-bar" ).hasClass('animate-from-right') ){ 152 if( $( ".mobile-bar" ).hasClass('active') ) 153 $( ".mobile-bar" ).animate( { right : 0 }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } ); 154 else 155 $( ".mobile-bar" ).animate( { right : "-100%" }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } ); 156 } 157 if( $( ".mobile-bar" ).hasClass('animate-from-top') ){ 158 if( $( ".mobile-bar" ).hasClass('active') ) 159 $( ".mobile-bar" ).animate( { top : 0 }, { duration: 500, specialEasing: { top: "easeInOutExpo" } } ); 160 else 161 $( ".mobile-bar" ).animate( { top : "-100%" }, { duration: 500, specialEasing: { top: "easeInOutExpo" } } ); 162 } 163 if( $( ".mobile-bar" ).hasClass('animate-from-bottom') ){ 164 if( $( ".mobile-bar" ).hasClass('active') ) 165 $( ".mobile-bar" ).animate( { bottom : 0 }, { duration: 500, specialEasing: { bottom: "easeInOutExpo" } } ); 166 else 167 $( ".mobile-bar" ).animate( { bottom : "-100%" }, { duration: 500, specialEasing: { bottom: "easeInOutExpo" } } ); 168 } 169 return false; 170 }); 171 172 /* Mobile Bar Menu to Modern Toggle Menu Convert */ 173 if( $('.mobile-bar').length ){ 174 175 if( $( ".zegen-main-menu" ).length || $( ".secondary-menu-area-inner ul.menu" ).length ){ 176 177 var main_menu = ".zegen-main-menu"; 178 if( !$( ".zegen-main-menu" ).length ){ 179 $( ".secondary-menu-area-inner ul.menu" ).addClass( "zegen-main-menu" ); 180 } 181 182 var mobile_menu = ".mobile-bar .zegen-mobile-main-menu"; 183 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"; 184 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"; 185 186 //Mobile menu copy from main menu 187 if( $(mobile_menu).html() == '' ) $(main_menu).clone().appendTo( mobile_menu ); 188 189 //Add main class name 190 $( mobile_menu + " " + main_menu ).addClass( "flex-column" ); 191 192 //Remove unwanted item from mobile menu 193 $( mobile_menu + " .mega-child-widget" ).parent( "li.menu-item" ).remove(); 194 $( mobile_menu + " .mega-child-divider" ).remove(); 195 $( mobile_menu + " .menu-item-logo" ).remove(); 196 $( mobile_menu + " li.menu-item" ).removeClass (function (index, css) { 197 return ( css.match (/\bcol-\S+/g) || [] ).join(' '); 198 199 }); 200 $( mobile_menu + " li.menu-item" ).removeClass (function (index, css) { 201 return ( css.match (/\bmax-col-\S+/g) || [] ).join(' '); 202 }); 203 204 //Change class name 205 $( mobile_menu ).find( ".dropdown-menu, .mega-child-dropdown-menu, .mega-sub-child-inner" ).toggleClass( "sub-menu" ); 206 207 //Content reform 208 $( mobile_menu + " .mega-child-item-disabled" ).replaceWith( "<a class='nav-link' href='#'>" + $( mobile_menu + " .mega-child-item-disabled" ).html() + "</a>" ); 209 210 //Remove unwanted classes 211 $( mobile_menu ).find( find_classes ).removeClass( removable_classes ); 212
213 //Remove Background 214 $( mobile_menu + " .sub-menu" ).css('background','none'); 215 216 //Add toggle dropdown icon 217 //$( ".mobile-bar " + main_menu ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle ti-plus"></span>' ); 218 219 $( ".mobile-bar " + main_menu ).find('li.menu-item > ul.sub-menu').each(function() { 220 $(this).parent("li").append( '<span class="zmm-dropdown-toggle ti-plus"></span>' ); 221 222 }); 223 224 $( ".mobile-bar " + main_menu ).find('.sub-menu').slideToggle(); 225 226 $( ".mobile-bar " + main_menu ).removeClass('zegen-main-menu').addClass('zegen-mobile-menu'); 227 228 //dropdown toggle 229 $( ".mobile-bar .zmm-dropdown-toggle" ).on( "click", function() { 230 var parent = $( this ).parent('li').children('.sub-menu'); 231 $( this ).parent('li').children('.sub-menu').slideToggle(); 232 $( this ).toggleClass('ti-minus'); 233 if( $( parent ).find('.sub-menu').length ){ 234 $( parent ).find('.sub-menu').slideUp(); 235 $( parent ).find('.zmm-dropdown-toggle').removeClass('ti-minus'); 236 } 237 }); 238 }// check page have main menu or not 239 240 } 241 242 /* Mobile Bar Menu to Modern Toggle Menu Convert */ 243 if( $('.secondary-menu-area-inner ul.menu').length ){ 244 245 var sec_menu = ".secondary-menu-area-inner ul.menu"; 246 //Add main class name 247 $( sec_menu ).addClass( "flex-column" ); 248 249 //Add toggle dropdown icon 250 $( sec_menu ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle ti-plus"></span>' ); 251 $( sec_menu ).find('.sub-menu').slideToggle(); 252 253 //dropdown toggle 254 $( sec_menu + " .zmm-dropdown-toggle" ).on( "click", function() { 255 var parent = $( this ).parent('li').children('.sub-menu'); 256 $( this ).parent('li').children('.sub-menu').slideToggle(); 257 $( this ).toggleClass('ti-minus'); 258 if( $( parent ).find('.sub-menu').length ){ 259 $( parent ).find('.sub-menu').slideUp(); 260 $( parent ).find('.zmm-dropdown-toggle').removeClass('ti-minus'); 261 } 262 }); 263 264 } 265 266 /* Twitter Widget Slider(newsticker) */ 267 if( $( ".twitter-slider" ).length ){ 268 $( ".twitter-slider" ).each(function() { 269 var twit_slider = $(this); 270 var slide = twit_slider.attr( "data-show" ); 271 twit_slider.easyTicker({ 272 direction: 'up', 273 visible: parseInt(slide), 274 easing: 'swing', 275 interval: 4000 276 }); 277 }); 278 } 279 280 /* Menu Scroll */ 281 var cur_offset = 0; 282 283 var o_stat = 0; // One Page Menu Status 284 $( '.zegen-main-menu li.menu-item, .zegen-mobile-menu li.menu-item' ).each(function( index ) { 285 var cur_item = this; 286 var target = $(cur_item).children("a").attr("href"); 287 if( target && target.indexOf("#section-") != -1 ){ 288 o_stat = 1; 289 var res = target.split("#"); 290 if( res.length == 2 ){ 291 $(cur_item).children("a").attr("data-target", res[0]); 292 $(cur_item).children("a").attr("href", "#"+res[1]); 293 } 294 } 295 }); 296 297 if( o_stat ){ 298 299 if( $('.zegen-main-menu .menu-item').find('a[href="#section-top"]').length ){ 300 $("body").attr("id","section-top"); 301 } 302 303 $( '.zegen-main-menu li.menu-item, .zegen-mobile-menu li.menu-item' ).removeClass("current-menu-item"); 304 305 $(window).on('scroll', function () { 306 var minus_height = $("#wpadminbar").length ? $("#wpadminbar").outerHeight() : 0; 307 minus_height += win_width >= zegen_body_atts.res_width ? parseInt( zegen_body_atts.menu_offset ) + 1 : parseInt( zegen_body_atts.mobile_menu_offset ); 308 $('section.elementor-section[id*="section-"], body').each(function () { 309 var anchored = $(this).attr("id"), 310 targetOffset = $(this).offset().top - minus_height; 311 312 if ($(window).scrollTop() > targetOffset) { 313 $('.zegen-main-menu .menu-item').find("a").removeClass("active"); 314 $('.zegen-main-menu .menu-item').find('a[href="#'+ anchored +'"]').addClass("active"); 315 316 //Mobile menu scroll spy active 317 $('.zegen-mobile-menu .menu-item').find("a").removeClass("active"); 318 $('.zegen-mobile-menu .menu-item').find('a[href="#'+ anchored +'"]').addClass("active"); 319 } 320 }); 321 }); 322 323 $( '.zegen-main-menu .menu-item > a[href^="#section-"], .zegen-mobile-main-menu .menu-item > a[href^="#section-"]' ).on('click',function (e) { 324 325 var cur_item = this; 326 var target = $(cur_item).attr("href"); 327 328 if( $(cur_item).parents(".zegen-mobile-main-menu").length ) { 329 $(".mobile-bar-toggle.close").trigger( "click" ); 330 } 331 if( $( ".secondary-menu-area" ) ){ 332 $( ".secondary-menu-area .secondary-space-toggle.active" ).trigger( "click" ); 333 } 334 335 var target_id = target.slice( target.indexOf("#"), ( target.length ) ); 336 var cur_url = location.protocol + '//' + location.host + location.pathname; //window.location.href; 337 var data_targ = $(cur_item).attr("data-target"); 338 var another_page = false; 339 if( target_id == '#section-top' && data_targ != '' ){ 340 if( cur_url != data_targ ){ 341 another_page = true; 342 } 343 } 344 345 if( $( target_id ).length && !another_page ){ 346 347 var minus_height = $("#wpadminbar").length ? $("#wpadminbar").outerHeight() : 0; 348 minus_height += win_width >= zegen_body_atts.res_width ? parseInt( zegen_body_atts.menu_offset ) : parseInt( zegen_body_atts.mobile_menu_offset );
349 var offs = $(target_id).offset().top - minus_height; 350 var sec_ani_call = 1; 351 if( target_id == '#section-top' ){ 352 sec_ani_call = 1; 353 offs = 0; 354 } 355 $('html,body').animate({ 'scrollTop': offs }, 0, 'easeInOutExpo' ); 356 357 return false; 358 }else{ 359 360 if( target_id == '#section-top' && cur_url == data_targ ){ 361 $('html,body').animate({ 'scrollTop': 0 }, 0, 'easeInOutExpo' ); 362 return false; 363 }else{ 364 if( cur_url != data_targ && target_id != '#' ){ 365 window.location.href = data_targ + target; 366 }else{ 367 window.location.href = target; 368 } 369 } 370 371 } 372 373 }); 374 375 } 376 377 /*Back to top*/ 378 if( $( ".back-to-top" ).length ){ 379 $( document ).on('click', '#back-to-top', function(){ 380 $('html,body').animate({ 'scrollTop': 0 }, 0, 'easeInOutExpo' ); 381 return false; 382 }); 383 $( document ).scroll(function() { 384 var y = $( this ).scrollTop(); 385 if ( y > 300 ) 386 $( '#back-to-top' ).fadeIn(); 387 else 388 $( '#back-to-top' ).fadeOut(); 389 }); 390 } 391 392 /* Top Sliding Bar */ 393 if( $( ".top-sliding-bar" ).length ){ 394 $( document ).on('click', '.top-sliding-toggle', function(){ 395 $( ".top-sliding-bar-inner" ).slideToggle(); 396 $( ".top-sliding-toggle" ).toggleClass( "ti-minus" ); 397 return false; 398 }); 399 } 400 401 /* Sticky Header Space */ 402 if( $('.sticky-header-space').length ){ 403 var elem_pos = $('.sticky-header-space').hasClass('left-sticky') ? 'left' : 'right'; 404 var elem_width = $('.sticky-header-space').outerWidth(); 405 406 zegen_sticky_header_adjust(elem_pos, elem_width); 407 $( window ).resize(function() { 408 zegen_sticky_header_adjust(elem_pos, elem_width); 409 }); 410 } 411 412 /* Toggle Search Modal Triggers */ 413 if( $( ".textbox-search-toggle" ).length ){ 414 $( document ).on('click', '.textbox-search-toggle', function(){ 415 $(this).parents('.search-toggle-wrap').toggleClass('active'); 416 setTimeout(function(){ $('.search-toggle-wrap').find("input.form-control").focus(); }, 500 ); 417 return false; 418 }); 419 }else if( $( ".full-bar-search-toggle" ).length ){ 420 $( document ).on('click', '.full-bar-search-toggle', function(){ 421 $('.full-bar-search-wrap').toggleClass('active'); 422 setTimeout(function(){ $('.full-bar-search-wrap').find("input.form-control").focus(); }, 500 ); 423 return false; 424 }); 425 }else if( $( ".bottom-search-toggle" ).length ){ 426 $( document ).on('click', '.bottom-search-toggle', function(){ 427 $(this).parents('.search-toggle-wrap').toggleClass('active'); 428 setTimeout(function(){ $('.search-toggle-wrap').find("input.form-control").focus(); }, 500 ); 429 return false; 430 }); 431 } 432 433 /* Sticky Footer */ 434 if( $( ".footer-fixed" ).length ){ 435 if( $( window ).width() > 1023 ){ 436 $( ".zegen-wrapper" ).css({ 'margin-bottom' : $( ".footer-fixed" ).outerHeight() + 'px' }); 437 }else{ 438 $( ".zegen-wrapper" ).css({ 'margin-bottom' : '0' }); 439 } 440 }else if( $( ".footer-bottom-fixed" ).length ){ 441 if( $( window ).width() > 1023 ){ 442 $( ".zegen-wrapper" ).css({ 'margin-bottom' : $( ".footer-bottom-fixed" ).outerHeight() + 'px' }); 443 }else{ 444 $( ".zegen-wrapper" ).css({ 'margin-bottom' : '0' }); 445 } 446 } 447 $( window ).resize(function() { 448 if( $( ".footer-fixed" ).length ){ 449 if( $( window ).width() > 1023 ){ 450 $( ".zegen-wrapper" ).css({ 'margin-bottom' : $( ".footer-fixed" ).outerHeight() + 'px' }); 451 }else{ 452 $( ".zegen-wrapper" ).css({ 'margin-bottom' : '0' }); 453 } 454 }else if( $( ".footer-bottom-fixed" ).length ){ 455 if( $( window ).width() > 1023 ){ 456 $( ".zegen-wrapper" ).css({ 'margin-bottom' : $( ".footer-bottom-fixed" ).outerHeight() + 'px' }); 457 }else{ 458 $( ".zegen-wrapper" ).css({ 'margin-bottom' : '0' }); 459 } 460 } 461 }); 462 463 /* Stellar Parallax */ 464 if( $(".parallax-item").length ){ 465 $.stellar({ 466 horizontalScrolling: false, 467 verticalOffset: 40 468 }); 469 } 470 471 /* Magnific Zoom Gallery Code */ 472 if( $('.zoom-gallery').length ){ 473 $('.zoom-gallery').magnificPopup({ 474 delegate: 'a', 475 type: 'image', 476 closeOnContentClick: false, 477 closeBtnInside: false, 478 mainClass: 'mfp-with-zoom mfp-img-mobile', 479 gallery: { 480 enabled: true 481 }, 482 zoom: { 483 enabled: true, 484 duration: 300, // don't foget to change the duration also in CSS 485 opener: function(element) { 486 return element.find('img'); 487 } 488 } 489 }); 490 } 491 492 if( $('.image-gallery .image-gallery-link').length ){ 493 $('.image-gallery').magnificPopup({ 494 delegate: '.image-gallery-link', 495 type: 'image', 496 closeOnContentClick: false, 497 closeBtnInside: false, 498 mainClass: 'mfp-with-zoom mfp-img-mobile', 499 gallery: { 500 enabled: true 501 }, 502 }); 503 } 504 505 if( $('.popup-video-post, .popup-audio-post, .zegen-popup-gmaps').length ){ 506 /* Magnific Popup Code */ 507 $('.popup-video-post, .popup-audio-post, .zegen-popup-gmaps').magnificPopup({ 508 disableOn: 700, 509 type: 'iframe', 510 mainClass: 'mfp-fade', 511 removalDelay: 160, 512 preloader: false,
513 fixedContentPos: false 514 }); 515 } 516 517 if( $('.popup-with-zoom-anim').length ){ 518 $('.popup-with-zoom-anim').magnificPopup({ 519 disableOn: 700, 520 type: 'inline', 521 mainClass: 'mfp-fade', 522 removalDelay: 160, 523 preloader: false, 524 fixedContentPos: false, 525 callbacks: { 526 open: function() { 527 // Play video on open: 528 if( !$( this.content ).find('video').length ){ 529 var parent = $( this.content ).parent( "post-video-wrap" ); 530 var url = $( this.content ).find('span').data( "url" ); 531 var video = '<video width="100%" height="450" preload="true" style="max-width:100%;" autoplay="true"><source src="'+ url +'" type="video/mp4"></video>'; 532 $( this.content ).find('span').replaceWith( video ); 533 }else{ 534 $(this.content).find('video')[0].load(); 535 } 536 }, 537 close: function() { 538 // Reset video on close: 539 $(this.content).find('video')[0].pause(); 540 541 } 542 } 543 }); 544 } 545 546 //Modal popup 547 if( $('.modal-popup-content').length ){ 548 /* Magnific Popup Code */ 549 $('.modal-box-trigger').magnificPopup({ 550 type: 'inline', 551 preloader: false, 552 focus: '#username', 553 modal: true, 554 mainClass: 'mfp-fade', 555 removalDelay: 300 556 }); 557 $(document).on('click', '.popup-modal-dismiss', function (e) { 558 e.preventDefault(); 559 $.magnificPopup.close(); 560 }); 561 } 562 563 /* Set Blockquote Background */ 564 if( $( ".post-quote-wrap, .post-link-wrap" ).length ){ 565 $( ".post-quote-wrap, .post-link-wrap" ).each(function() { 566 var img_url = $(this).data('url'); 567 if( img_url ){ 568 $(this).css( 'background-image','url('+ img_url +')' ); 569 } 570 }); 571 } 572 573 /* Set Background Image */ 574 if( $( ".set-bg-img" ).length ){ 575 $( ".set-bg-img" ).each(function() { 576 var img_url = $(this).data('src'); 577 if( img_url ){ 578 $(this).css( 'background-image','url('+ img_url +')' ); 579 } 580 }); 581 } 582 583 /* Sticky Element */ 584 if( $( ".zegen-sticky-wrapper" ).length ){ 585 $("a.zegen-sticky-trigger").on( "click", function(e){ 586 $(this).parent(".zegen-sticky-wrapper").toggleClass("active"); 587 return false; 588 }); 589 } 590 591 if( $('a.onclick-video-post').length ){ 592 $(document).on( "click", "a.onclick-video-post", function(){ 593 594 var parent = $(this).parent('.post-video-wrap'); 595 var frame = '<iframe src="'+ $(this).attr("href") +'?autoplay=1" width="100%" height="'+ parent.height() +'" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'; 596 $(this).fadeOut(300); 597 $(this).replaceWith( frame ); 598 return false; 599 }); 600 } 601 602 if( $('a.onclick-custom-video').length ){ 603 $(document).on( "click", ".onclick-custom-video", function(){ 604 605 var parent = $(this).parent('.post-video-wrap'); 606 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>'; 607 $(this).fadeOut(300); 608 $(this).replaceWith( video ); 609 return false; 610 }); 611 } 612 613 /* Page Title Background Video */ 614 if( $( "#page-title-bg .page-title-wrap-inner" ).length ){ 615 $( "#page-title-bg .page-title-wrap-inner" ).YTPlayer(); 616 } 617 618 /* Comments Like/Dislike */ 619 if( $(".comment-like-wrapper").length ){ 620 $( document ).on( 'click', ".comment-like", function( event) { 621 622 var cmt_cur = $(this); 623 var cmt_meta = cmt_cur.data('id'); 624 var cmt_id = cmt_cur.data('cmt-id'); 625 var parent = cmt_cur.parents('.comment-like-wrapper'); 626 if( cmt_meta == '1' ){ 627 cmt_cur.parents('.list-inline').find('.comment-liked').removeClass('theme-color comment-liked').addClass('comment-like'); 628 cmt_cur.removeClass('comment-like').addClass('theme-color comment-liked'); 629 }else{ 630 cmt_cur.parents('.list-inline').find('.comment-liked').removeClass('theme-color comment-liked').addClass('comment-like'); 631 cmt_cur.removeClass('comment-like').addClass('theme-color comment-liked'); 632 } 633 634 if( cmt_id != '' && cmt_meta != '' ){ 635 // Ajax call 636 (jQuery).ajax({ 637 type: "post", 638 url: zegen_ajax_var.admin_ajax_url, 639 data: "action=comment_like&nonce="+zegen_ajax_var.cmt_nonce+"&cmt_id="+cmt_id+"&cmt_meta="+cmt_meta, 640 success: function(res){ 641 $( parent ).html(res); 642 }, 643 error: function (jqXHR, exception) { 644 console.log(jqXHR); 645 } 646 });
647 } 648 return false; 649 }); 650 } 651 652 /*Mailchimp Code*/ 653 if( $('.zozo-mc').length ){ 654 $('.zozo-mc').on( "click", function () { 655 656 var c_btn = $(this); 657 var mc_wrap = $( this ).parents('.mailchimp-wrapper'); 658 var mc_form = $( this ).parents('.zozo-mc-form'); 659 660 if( mc_form.find('input[name="zozo_mc_email"]').val() == '' ){ 661 mc_wrap.find('.mc-notice-msg').text( zegen_ajax_var.must_fill ); 662 }else{ 663 c_btn.attr( "disabled", "disabled" ); 664 $.ajax({ 665 type: "POST", 666 url: zegen_ajax_var.admin_ajax_url, 667 data: 'action=zozo-mc&nonce='+zegen_ajax_var.mc_nounce+'&'+mc_form.serialize(), 668 success: function (data) { 669 //Success 670 c_btn.removeAttr( "disabled" ); 671 mc_wrap.find('.mc-notice-msg').removeClass("mc-success mc-failed"); 672 if( data == 'success' ){ 673 mc_wrap.find('.mc-notice-msg').addClass("mc-success"); 674 mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-success') ); 675 }else{ 676 mc_wrap.find('.mc-notice-msg').addClass("mc-failed"); 677 mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-fail') ); 678 } 679 },error: function(xhr, status, error) { 680 c_btn.removeAttr( "disabled" ); 681 mc_wrap.find('.mc-notice-msg').removeClass("mc-success mc-failed"); 682 mc_wrap.find('.mc-notice-msg').addClass("mc-failed"); 683 mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-fail') ); 684 } 685 }); 686 } 687 }); 688 } // if mailchimp exists 689 690 /* Facbook Comment Width Resize */ 691 if( $( '.fb-comments-wrapper' ).length ){ 692 $( window ).resize(function() { 693 setTimeout(function(){ 694 if($( window ).width() <= 768 ){ 695 $( ".fb-comments-wrapper iframe" ).width( $( ".content-area" ).width() ); 696 }else{ 697 $( ".fb-comments-wrapper iframe" ).width( $( ".content-area .fb-comments" ).data('width') ); 698 } 699 }, 200); 700 }); 701 } 702 703 if( $('.popover-wrapper .popover-trigger').length ){ 704 $(".popover-trigger").each(function( index ) { 705 var evnt_name = $(this).attr("data-event") ? $(this).attr("data-event") : 'hover'; 706 $(this).on( evnt_name, function ( e ) { 707 e.preventDefault(); 708 $(this).parents(".popover-wrapper").toggleClass("popover-active"); 709 }); 710 }); 711 } 712 713 if( $(".sermon-download-all").length ){ 714 $(".sermon-download-all").on( "click", function(e) { 715 var cur_parent = $(this).parents("ul.sermon-tool-list"); 716 if( $(cur_parent).find('.sermon-video-link').length ) $(cur_parent).find('.sermon-video-link').get(0).click(); 717 if( $(cur_parent).find('.sermon-audio-link').length ) $(cur_parent).find('.sermon-audio-link').get(0).click(); 718 if( $(cur_parent).find('.sermon-pdf-link').length ) $(cur_parent).find('.sermon-pdf-link').get(0).click(); 719 return false; 720 }); 721 } 722 723 $(window).scroll(function(){ 724 zegen_scroll_animation(); 725 }); 726 727 }); // doc ready end 728 729 730 $( window ).load(function() { 731 732 // Header Bar Center Item Margin Fun 733 setTimeout( zegen_center_menu_margin, 300 ); 734 735 // Set Sticky Height for Menu Bars 736 zegen_set_sticky_outer_height(); 737 738 /* Sticky Menu */ 739 if($('.header-inner .sticky-head').length){ 740 zegen_sticky_part( '.header-inner' ); 741 } 742 743 /* Scroll Sticky */ 744 if($('.header-inner .sticky-scroll').length){ 745 zegen_sticky_scroll_up_part( '.header-inner', 'header' ); 746 } 747 748 /* Mobile Header Sticky Menu */ 749 if($('.mobile-header-inner .sticky-head').length){ 750 zegen_sticky_part( '.mobile-header-inner' ); 751 } 752 753 /* Mobile Header Scroll Sticky */ 754 if($('.mobile-header-inner .sticky-scroll').length){ 755 zegen_sticky_scroll_up_part( '.mobile-header-inner', '.mobile-header' ); 756 } 757 758 //Page loader 759 if( $(".page-loader").length ){ 760 $(".page-loader").fadeOut("slow"); 761 }else if( $("body.opacity-zero").length ){ 762 $("body").removeClass("opacity-zero"); 763 $("body").addClass("opacity-one"); 764 }else if( zegen_body_atts.core_stat == true ){ 765 $("body").addClass("opacity-one"); 766 } 767 768 //Header slider height 769 if( $( ".header-slider-wrapper" ).length ){ 770 $( ".header-slider-wrapper" ).css({ 'height' : 'auto' });
771 } 772 773 // Grid Layout Set Width for Owl and Isotope 774 if( $( ".grid-layout.grid-normal" ).length ){ 775 776 $( ".grid-layout.grid-normal" ).each(function() { 777 778 var c_elem = $( this ); 779 var parent_width = c_elem.width(); 780 var gutter_size = c_elem.data( "gutter" ); 781 var grid_cols = c_elem.data( "cols" ); 782 783 var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 784 var gn_ele = 1; // grid normal element variable 785 c_elem.children("article").each(function() { 786 if( gn_ele % grid_cols == 0 ){ 787 $( this ).css({'width':net_width+'px', 'margin-right': '0', 'margin-bottom': gutter_size+'px'}); 788 }else{ 789 $( this ).css({'width':net_width+'px', 'margin-right': gutter_size+'px', 'margin-bottom': gutter_size+'px'}); 790 } 791 gn_ele++; 792 }); 793 794 c_elem.children("article").addClass("grid-dyno-visible"); 795 796 $( window ).resize(function() { 797 setTimeout(function(){ 798 parent_width = c_elem.width(); 799 var mgrid_cols = 1; 800 if( $(window).width() < 768 ){ 801 mgrid_cols = 1; 802 }else{ 803 mgrid_cols = grid_cols; 804 } 805 var net_width = Math.floor( ( parent_width - ( gutter_size * ( mgrid_cols - 1 ) ) ) / mgrid_cols ); 806 var gn_ele = 1; // grid normal element variable 807 c_elem.children("article").each(function() { 808 if( gn_ele % mgrid_cols == 0 ){ 809 $( this ).css({'width':net_width+'px', 'margin-right': '0', 'margin-bottom': gutter_size+'px'}); 810 }else{ 811 $( this ).css({'width':net_width+'px', 'margin-right': gutter_size+'px', 'margin-bottom': gutter_size+'px'}); 812 } 813 gn_ele++; 814 }); 815 }, 200); 816 }); 817 818 c_elem.find( ".top-standard-post article" ).css({'width':'auto'}); 819 820 }); // each end 821 } // .grid-layout 822 823 /// Theme Owl Carousel Code 824 $( ".owl-carousel" ).each(function() { 825 if( !$( this ).parents( ".isotope" ).length ){ 826 zegen_owl_settings( $( this ) ); 827 } 828 }); 829 830 // Isotope Grid Layout 831 if( $( ".grid-layout > .isotope" ).length ){ 832 $( ".grid-layout > .isotope" ).each(function() { 833 834 var c_elem = $( this ); 835 var parent_width = c_elem.width(); 836 var gutter_size = c_elem.data( "gutter" ); 837 var grid_cols = c_elem.data( "cols" ); 838 839 var layoutmode = c_elem.is('[data-layout]') ? c_elem.data( "layout" ) : ''; 840 841 layoutmode = layoutmode ? layoutmode : 'masonry'; 842 843 if( $(window).width() < 768 ) grid_cols = 1; 844 845 var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 846 c_elem.find( "article" ).css({'width':net_width+'px', 'margin-bottom':gutter_size+'px'}); 847 if( $( ".top-standard-post" ).length ){ 848 $( ".top-standard-post article" ).css({'margin-bottom':gutter_size+'px'}); 849 } 850 851 c_elem.find( ".owl-carousel" ).each(function() { 852 zegen_owl_settings( $( this ) ); 853 }); 854 855 c_elem.find( "video" ).each(function( index ) { 856 $( this ).attr( "src", $( this ).find( "source" ).attr( "src" ) ); 857 $( this ).css({ 'height':'200px' }); 858 }); 859 860 var filter = "*"; 861 var isot_parent = c_elem.parent(".grid-layout"); 862 if( $( isot_parent ).attr("data-filter-stat") == 0 ){ 863 filter = $( isot_parent ).attr("data-first-cat") ? "." + $( isot_parent ).attr("data-first-cat") : '*'; 864 } 865 866 c_elem.imagesLoaded( function(){ 867 c_elem.isotope({ 868 itemSelector: 'article', 869 layoutMode: layoutmode, 870 filter: filter, 871 masonry: { 872 gutter: gutter_size 873 }, 874 fitRows: { 875 gutter: gutter_size 876 } 877 }); 878 }); 879 880 c_elem.children("article").addClass("grid-dyno-visible"); 881 882 /* Portfolio Filter Item */ 883 if( $(".portfolio-filter").length ){ 884 $( ".portfolio-filter-item" ).on( 'click', function() { 885 $( this ).parents("ul.nav").find("li").removeClass("active"); 886 $( this ).parent("li").addClass("active"); 887 var filterValue = $( this ).attr( "data-filter" ); 888 c_elem = $( this ).parents( ".portfolio-wrapper" ).find( ".grid-layout .isotope" ); 889 c_elem.isotope({ 890 filter: filterValue 891 });
892 return false; 893 }); 894 } 895 896 $( window ).resize(function() { 897 898 setTimeout(function(){ 899 grid_cols = c_elem.data( "cols" ); 900 if( $(window).width() < 768 ) grid_cols = 1; 901 902 var parent_width = c_elem.width(); 903 net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 904 c_elem.find( "article" ).css({'width':net_width+'px'}); 905 c_elem.imagesLoaded( function(){ 906 var $isot = c_elem.isotope({ 907 itemSelector: 'article', 908 masonry: { 909 gutter: gutter_size 910 } 911 }); 912 $isot.on( 'arrangeComplete', isotopeArrange ); 913 }); 914 915 }, 200); 916 917 }); 918 919 // Isotope Grid Infinite 920 if( c_elem.data( "infinite" ) == 1 && $(".post-pagination").length ){ 921 922 c_elem.infinitescroll({ 923 navSelector : '.post-pagination',//'#page_nav', // selector for the paged navigation 924 nextSelector : 'a.next-page',//'#page_nav a', // selector for the NEXT link (to page 2) 925 itemSelector : 'article', // selector for all items you'll retrieve 926 loading: { 927 msgText : zegen_ajax_var.load_posts, 928 finishedMsg: zegen_ajax_var.no_posts, 929 img: zegen_ajax_var.infinite_loader 930 } 931 }, 932 // call Isotope as a callback 933 function( newElements ) { 934 935 var elems = $(newElements); 936 937 var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 938 c_elem.find( "article" ).css({'width':net_width+'px', 'margin-bottom':gutter_size+'px'}); 939 if( $( ".top-standard-post" ).length ){ 940 $( ".top-standard-post article" ).css({'margin-bottom':gutter_size+'px'}); 941 } 942 943 c_elem.find( ".owl-carousel" ).each(function() { 944 zegen_owl_settings( $( this ) ); 945 }); 946 947 elems.find( "video" ).each(function( index ) { 948 $( this ).attr( "src", $( this ).find( "source" ).attr( "src" ) ); 949 $( this ).css({ 'height':'200px' }); 950 }); 951 952 elems.imagesLoaded( function(){ 953 c_elem.isotope( 'appended', elems ); 954 elems.addClass("grid-dyno-visible"); 955 }); 956 957 if( c_elem.find( "article" ).hasClass( "zegen-animate" ) ){ 958 zegen_scroll_animation(); 959 } 960 961 }); 962 } 963 }); // each end 964 } 965 966 // Related Slider Empty Post Image Height Set 967 if( $( ".related-slider .empty-post-image" ).length ){ 968 if( $( ".related-slider .item .wp-post-image" ).length ){ 969 $( ".related-slider .item .empty-post-image" ).height( $( ".related-slider .item .wp-post-image" ).height() ); 970 } 971 } 972 973 // Featured Slider Empty Post Image Height Set 974 if( $( ".featured-slider .empty-post-image" ).length ){ 975 if( $( ".featured-slider .item .wp-post-image" ).length ){ 976 $( ".featured-slider .item .empty-post-image" ).height( $( ".featured-slider .item .wp-post-image" ).height() ); 977 } 978 } 979 980 // Sticky Sidebar 981 if( $( ".zegen-sticky-obj" ).length ){ 982 var $sticky_sidebars = $( ".zegen-sticky-obj" ); 983 if( $( window ).width() > 767 ) { 984 $sticky_sidebars.stick_in_parent(); 985 } 986 $( window ).resize(function() { 987 if( $( window ).width() > 767 ) { 988 $sticky_sidebars.trigger( "sticky_kit:detach" ); 989 $sticky_sidebars.stick_in_parent(); 990 $sticky_sidebars.trigger( "sticky_kit:recalc" ); 991 }else{ 992 $sticky_sidebars.trigger( "sticky_kit:detach" ); 993 } 994 }); 995 } 996 997 // Circle Counter Shortcode Script 998 if( $( '.circle-progress-circle' ).length ){ 999 var circle = $( '.circle-progress-circle' ); 1000 circle.appear(function() { 1001 1002 var c_circle = $( this ); 1003 var c_value = c_circle.attr( "data-value" ); 1004 var c_size = c_circle.attr( "data-size" ); 1005 var c_thickness = c_circle.attr( "data-thickness" ); 1006 var c_duration = c_circle.attr( "data-duration" ); 1007 var c_empty = c_circle.attr( "data-empty" ) != '' ? c_circle.attr( "data-empty" ) : 'transparent'; 1008 var c_scolor = c_circle.attr( "data-scolor" ); 1009 var c_ecolor = c_circle.attr( "data-ecolor" ) != '' ? c_circle.attr( "data-ecolor" ) : c_scolor; 1010 1011 c_circle.circleProgress({ 1012 value: Math.floor( c_value ) / 100, 1013 size: Math.floor( c_size ), 1014 thickness: Math.floor( c_thickness ), 1015 emptyFill: c_empty, 1016 animation: { 1017 duration: Math.floor( c_duration ) 1018 }, 1019 lineCap: 'round', 1020 fill: { 1021 gradient: [c_scolor, c_ecolor] 1022 } 1023 }).on( 'circle-animation-progress', function( event, progress ) { 1024 $( this ).find( '.progress-value' ).html( Math.round( c_value * progress ) + '%' ); 1025 }); 1026 }); 1027 } 1028 1029 // Day Counter Shortcode Script 1030 if( $( '.day-counter' ).length ){ 1031 $( '.day-counter' ).each(function() { 1032 var day_counter = $( this ); 1033 var dprogress = $(day_counter).hasClass("day-counter-progress") ? true : false; 1034 var c_date = day_counter.attr('data-date'); 1035 day_counter.countdown( c_date, function(event) { 1036 if( day_counter.find('.counter-day').length ){ 1037 day_counter.find('.counter-day h3').text( event.strftime('%D') ); 1038 if( dprogress ){ 1039 var yr = parseInt( event.strftime('%D') ); 1040 yr = yr ? parseInt( yr / 365 * 100 ) : 100; 1041 zegen_day_circle( day_counter.find('.counter-day'), yr ); 1042 } 1043 } 1044 if( day_counter.find('.counter-hour').length ){ 1045 day_counter.find('.counter-hour h3').text( event.strftime('%H') ); 1046 if( dprogress ){ 1047 var hur = parseInt( event.strftime('%H') ); 1048 hur = hur ? parseInt( hur / 24 * 100 ) : 100; 1049 zegen_day_circle( day_counter.find('.counter-hour'), hur ); 1050 } 1051 } 1052 if( day_counter.find('.counter-min').length ){ 1053 day_counter.find('.counter-min h3').text( event.strftime('%M') ); 1054 if( dprogress ){ 1055 var mnth = parseInt( event.strftime('%M') ); 1056 mnth = mnth ? parseInt( mnth / 60 * 100 ) : 100; 1057 zegen_day_circle( day_counter.find('.counter-min'), mnth ); 1058 } 1059 } 1060 if( day_counter.find('.counter-sec').length ){ 1061 day_counter.find('.counter-sec h3').text( event.strftime('%S') ); 1062 if( dprogress ){ 1063 var tme = parseInt( event.strftime('%S') ); 1064 tme = tme ? parseInt( tme / 60 * 100 ) : 100; 1065 zegen_day_circle( day_counter.find('.counter-sec'), tme ); 1066 } 1067 } 1068 if( day_counter.find('.counter-week').length ){ 1069 day_counter.find('.counter-week h3').text( event.strftime('%w') ); 1070 if( dprogress ){ 1071 var wk = parseInt( event.strftime('%S') ); 1072 wk = wk ? parseInt( wk / 60 * 100 ) : 100; 1073 zegen_day_circle( day_counter.find('.counter-week'), wk ); 1074 } 1075 } 1076 }); 1077 }); 1078 } 1079 1080 // Canvas Shapes 1081 if( $(".canvas_agon").length ){ 1082 $( '.canvas_agon' ).each(function() { 1083 zegen_agon( $(this) ); 1084 }); 1085 } 1086 1087 // Google map 1088 if( $( ".zegengmap" ).length ){ 1089 initZegenGmap(); 1090 } 1091 1092 //Elementor RTL issue 1093 if( $("body.rtl").length && $("section.elementor-section-stretched").length ){ 1094 zegen_for_elementor_row(); 1095 } 1096 1097 // Scroll animation 1098 zegen_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 zegen_for_elementor_row(); 1108 } 1109 1110 /* Custom Responsive Width */ 1111 var win_width = $(window).width(); 1112 if( responsive_width ){ 1113 zegen_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( zegen_center_menu_margin, 300 ); 1121 1122 /* Sticky Menu */ 1123 setTimeout( zegen_set_sticky_outer_height, 100 ); 1124 1125 /* Sticky Menu */ 1126 if($('.header-inner .sticky-head').length){ 1127 setTimeout( zegen_sticky_part( '.header-inner' ), 100 ); 1128 } 1129 1130 /* Scroll Sticky */ 1131 if($('.header-inner .sticky-scroll').length){ 1132 setTimeout( zegen_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( zegen_sticky_part( '.mobile-header-inner' ), 100 ); 1138 } 1139 1140 /* Mobile Header Scroll Sticky */ 1141 if($('.mobile-header-inner .sticky-scroll').length){ 1142 setTimeout( zegen_sticky_scroll_up_part( '.mobile-header-inner', '.mobile-header' ), 100 ); 1143 } 1144 1145 zegen_scroll_animation(); 1146 1147 }); 1148 1149 //Day Counter Progress 1150 function zegen_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 zegen_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 zegen_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 zegen_sticky_header_adjust(elem_pos, elem_width){ 1202 var win_width = $(window).width(); 1203 var compare_wdth; 1204 if( $('.zegen-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 zegen_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 zegen_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 zegen_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 zegen_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 zegen_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 zegentesipagecallback(event){ 1442 var current = event.item.index; 1443 $( event.target ).find(".owl-item.active").eq(0).addClass("current"); 1444 } 1445 1446 function zegen_owl_settings(c_owlCarousel){ 1447 1448 var page_slide = false; 1449 var pagi_slide = false; 1450 if( c_owlCarousel.hasClass("zegen-page-carousel") ){ page_slide = true; } 1451 if( c_owlCarousel.hasClass("zegen-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 ? zegentesipagecallback : '' 1493 }); 1494 1495 if( pagi_slide ){ 1496 var cur_testi_slide = $( c_owlCarousel ).parent("div").children(".zegen-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(".zegen-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 zegen_scroll_animation(){ 1558 setTimeout( function() { 1559 var anim_time = 300; 1560 $('.zegen-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 initZegenGmap() { 1578 1579 1580 if( zegen_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 $( ".zegengmap" ).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("zegengmap") 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.