1/* ---------------------------------------------------------- 2 * Uncode App 3 * ---------------------------------------------------------- */ 4 5(function($) { 6 "use strict"; 7 var UNCODE = window.UNCODE || {}; 8 window.UNCODE = UNCODE; 9 10 window.requestAnimFrame = (function() { 11 return window.requestAnimationFrame || 12 window.webkitRequestAnimationFrame || 13 window.mozRequestAnimationFrame || 14 window.oRequestAnimationFrame || 15 window.msRequestAnimationFrame || 16 function(/* function */ callback, /* DOMElement */ element){ 17 window.setTimeout(callback, 1000 / 60); 18 }; 19})(); 20 21window.requestTimeout = function(fn, delay) { 22 if( !window.requestAnimationFrame && 23 !window.webkitRequestAnimationFrame && 24 !(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support 25 !window.oRequestAnimationFrame && 26 !window.msRequestAnimationFrame) 27 return window.setTimeout(fn, delay); 28 29 var start = new Date().getTime(), 30 handle = new Object(); 31 32 function loop(){ 33 var current = new Date().getTime(), 34 delta = current - start; 35 36 delta >= delay ? fn.call() : handle.value = requestAnimFrame(loop); 37 }; 38 39 handle.value = requestAnimFrame(loop); 40 return handle; 41}; 42 43window.clearRequestTimeout = function(handle) { 44 if ( typeof handle !== 'undefined' ) { 45 window.cancelAnimationFrame ? window.cancelAnimationFrame(handle.value) : 46 window.webkitCancelAnimationFrame ? window.webkitCancelAnimationFrame(handle.value) : 47 window.webkitCancelRequestAnimationFrame ? window.webkitCancelRequestAnimationFrame(handle.value) : /* Support for legacy API */ 48 window.mozCancelRequestAnimationFrame ? window.mozCancelRequestAnimationFrame(handle.value) : 49 window.oCancelRequestAnimationFrame ? window.oCancelRequestAnimationFrame(handle.value) : 50 window.msCancelRequestAnimationFrame ? window.msCancelRequestAnimationFrame(handle.value) : 51 clearTimeout(handle); 52 } 53}; 54 55UNCODE.utils = function() { 56 $('.btn-tooltip').tooltip(); 57 $(document).on('mouseover', 'a', function() { 58 $(this).attr('data-title', $(this).attr('title')); 59 $(this).removeAttr('title'); 60 }); 61 $(document).on('mouseout', 'a', function() { 62 $(this).attr('title', $(this).attr('data-title')); 63 $(this).removeAttr('data-title'); 64 }); 65 var $counters = $('.counter:not(.counter-init)'); 66 $counters.each(function(){ 67 var $counter = $(this).addClass('counter-init'); 68 if ( $counter.closest( '.owl-carousel' ).length ) { 69 return; 70 } 71 $counter.addClass('started').counterUp({ 72 delay: 10, 73 time: 1500 74 }); 75 }); 76 var $countdowns = $('[data-countdown]:not(.counter-init)'); 77 $countdowns.each(function() { 78 var $this = $(this).addClass('counter-init'), 79 finalDate = $(this).data('countdown'); 80 $this.countdown(finalDate, function(event) { 81 $this.html(event.strftime('%D <small>' + SiteParameters.days + '</small> %H <small>' + SiteParameters.hours + '</small> %M <small>' + SiteParameters.minutes + '</small> %S <small>' + SiteParameters.seconds + '</small>')); 82 }); 83 }); 84 85 var share_button_element = $('.share-button'); 86 var share_button_url = share_button_element.data('url'); 87 88 var share_button_config = { 89 ui: { 90 flyout: "top center", 91 button_font: false, 92 button_text: '', 93 icon_font: false 94 } 95 }; 96 97 if (share_button_url) { 98 share_button_config.url = share_button_url.replace("&", "%26"); 99 } 100 101 var share_button_top = new Share('.share-button', share_button_config); 102 103 this.get_scroll_offset = function(e) { 104 105 var scroll_offset = 0, 106 is_first_link = false, 107 target, 108 trigger; 109 110 if ( typeof e !== 'undefined' ) { 111 target = e.target; 112 trigger = e.currentTarget; 113 } 114 115 if ($('.menu-hide').length || $('.menu-hide-vertical').length) { 116 if (UNCODE.bodyTop > UNCODE.wheight / 2) { 117 UNCODE.hideMenu(100); 118 } 119 } 120 121 if ( $('.menu-sticky .menu-container:not(.menu-hide)').length && ! $('.menu-shrink').length ) { 122 scroll_offset += $('.menu-sticky .menu-container').outerHeight(); 123 } else { 124 if (($('.menu-sticky').length && !$('.menu-hide').length) || ($('.menu-sticky-vertical').length && !$('.menu-hide-vertical').length)) { 125 scroll_offset += UNCODE.menuMobileHeight; 126 } else { 127 if (UNCODE.wwidth < UNCODE.mediaQuery) { 128 scroll_offset += $('.main-menu-container.open-items').height(); 129 } else { 130 if ( $(trigger).length && typeof $(trigger).offset() !== 'undefined' && window.scrollY > ($(trigger).offset().top + UNCODE.menuMobileHeight) ) { 131 scroll_offset += UNCODE.menuMobileHeight; 132 } 133 } 134 } 135 } 136 137 scroll_offset += UNCODE.bodyBorder; 138 139 return scroll_offset; 140 } 141 142 if ( !UNCODE.isFullPage ) { 143 $(document).on('click', 'a[href*="#"]:not(.woocommerce-review-link)', function(e) { 144 145 var hash = (e.currentTarget).hash, 146 is_scrolltop = $(e.currentTarget).hasClass('scroll-top') ? true : false, 147 anchor = ''; 148 if ($(e.currentTarget).data('toggle') == 'tab' || $(e.currentTarget).data('toggle') == 'collapse') return; 149 if ($(e.currentTarget).hasClass('woocommerce-review-link') && $('.wootabs .tab-content').length) { 150 e.preventDefault(); 151 if (!$('#tab-reviews').is(':visible')) { 152 $('a[href="#tab-reviews"]').trigger('click'); 153 } 154 var calc_scroll = $('.wootabs .tab-content').offset().top; 155 calc_scroll -= UNCODE.get_scroll_offset(e); 156 157 var shrink = typeof $('.navbar-brand').data('padding-shrink') !== 'undefined' ? $('.navbar-brand').data('padding-shrink')*2 : 36; 158 159 if ( $('.menu-sticky .menu-container:not(.menu-hide)').length && $('.menu-shrink').length ) { 160 scrollTo += UNCODE.menuHeight - ( $('.navbar-brand').data('minheight') + shrink ); 161 } 162 163 var bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'], 164 delta = bodyTop - calc_scroll, 165 scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(delta) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed; 166 if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000; 167 168 requestTimeout(function(){ 169 if (scrollSpeed == 0) { 170 $('html, body').scrollTop(calc_scroll); 171 UNCODE.scrolling = false;
172 } else { 173 $('html, body').animate({ 174 scrollTop: calc_scroll 175 }, scrollSpeed, 'easeInOutCubic', function() { 176 UNCODE.scrolling = false; 177 } 178 ); 179 } 180 }, 200); 181 return; 182 } 183 if (hash != undefined) { 184 var specialFormat = /[ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/; 185 var anchor = this.hash.slice(1); 186 if ( !specialFormat.test(hash) && location.pathname.replace(/^\//g,'') == this.pathname.replace(/^\//g,'') && location.hostname == this.hostname) { 187 if ( !specialFormat.test(hash) ) { 188 if ( $(hash).length ) 189 anchor = $(hash); 190 } 191 } 192 } 193 194 if (is_scrolltop || anchor != '') { 195 if (is_scrolltop) { 196 e.preventDefault(); 197 var bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'], 198 scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(bodyTop) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed; 199 if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000; 200 201 if (scrollSpeed == 0) { 202 $('html, body').scrollTop(0); 203 UNCODE.scrolling = false; 204 } else { 205 $('html, body').animate({ 206 scrollTop: 0 207 }, scrollSpeed, 'easeInOutCubic', function() { 208 UNCODE.scrolling = false; 209 }); 210 } 211 } else { 212 var scrollSection = (typeof anchor === 'string') ? $('[data-name=' + anchor + ']') : anchor; 213 $.each($('.menu-container .menu-item > a, .widget_nav_menu .menu-smart .menu-item > a'), function(index, val) { 214 var get_href = $(val).attr('href'); 215 if (get_href != undefined) { 216 if (get_href.substring(get_href.indexOf('#')+1) == anchor) $(val).parent().addClass('active'); 217 else $(val).parent().removeClass('active'); 218 } 219 }); 220 if (scrollSection.length) { 221 if ( $('body').hasClass('uncode-scroll-no-history') ) { 222 e.preventDefault(); 223 } 224 225 if (UNCODE.menuOpened) { 226 if (UNCODE.wwidth < UNCODE.mediaQuery) { 227 window.dispatchEvent(UNCODE.menuMobileTriggerEvent); 228 } else { 229 $('.mmb-container-overlay .overlay-close').trigger('click'); 230 } 231 } 232 233 var calc_scroll = scrollSection.offset().top, 234 getOffset = UNCODE.get_scroll_offset(e), 235 $logo = $('#logo-container-mobile'), 236 logoH, 237 $menu = $('#masthead .menu-container'), 238 menuH; 239 240 calc_scroll -= getOffset; 241 242 var bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'], 243 delta = bodyTop - calc_scroll, 244 scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(delta) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed; 245 if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000; 246 247 if ( $('.menu-sticky .menu-container:not(.menu-hide)').length && ! $('.menu-shrink').length ) { 248 logoH = $logo.outerHeight(), 249 menuH = $menu.outerHeight(); 250 if ( calc_scroll < ( logoH + menuH ) ) { 251 calc_scroll = 0; 252 } 253 } 254 255 if (scrollSpeed == 0) { 256 $('html, body').scrollTop(calc_scroll); 257 UNCODE.scrolling = false; 258 } else { 259 $('html, body').animate({ 260 scrollTop: (delta > 0) ? calc_scroll - 0.1 : calc_scroll 261 }, scrollSpeed, 'easeInOutCubic', function() { 262 UNCODE.scrolling = false; 263 if (getOffset != UNCODE.get_scroll_offset(e)) { 264 calc_scroll = scrollSection.offset().top; 265 getOffset = UNCODE.get_scroll_offset(e); 266 calc_scroll -= getOffset; 267 $('html, body').animate({ 268 scrollTop: (delta > 0) ? calc_scroll - 0.1 : calc_scroll 269 }, scrollSpeed, 'easeInOutCubic', function() { 270 UNCODE.scrolling = false; 271 } 272 ); 273 } 274 }); 275 } 276 } 277 } 278 } 279 }); 280 $('.header-scrolldown').on('click', function(event) { 281 282 event.preventDefault(); 283 284 var pageHeader = $(event.target).closest('#page-header'), 285 pageHeaderTop = pageHeader.offset().top, 286 pageHeaderHeight = pageHeader.outerHeight(), 287 scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(pageHeaderTop + pageHeaderHeight) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed; 288 if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000; 289 290 var calc_scroll = pageHeaderTop + pageHeaderHeight, 291 getOffset = UNCODE.get_scroll_offset(event); 292 calc_scroll -= getOffset; 293 294 var shrink = typeof $('.navbar-brand').data('padding-shrink') !== 'undefined' ? $('.navbar-brand').data('padding-shrink')*2 : 36; 295 296 if ( $('.menu-sticky .menu-container:not(.menu-hide)').length && $('.menu-shrink').length ) { 297 scrollTo += UNCODE.menuHeight - ( $('.navbar-brand').data('minheight') + shrink ); 298 } 299 300 if (scrollSpeed == 0) { 301 $('html, body').scrollTop(calc_scroll); 302 UNCODE.scrolling = false;
303 } else { 304 $('html, body').animate({ 305 scrollTop: calc_scroll 306 }, scrollSpeed, 'easeInOutCubic', function() { 307 UNCODE.scrolling = false; 308 if (getOffset != UNCODE.get_scroll_offset(event)) { 309 calc_scroll = pageHeaderTop + pageHeaderHeight; 310 getOffset = UNCODE.get_scroll_offset(event); 311 calc_scroll -= getOffset; 312 $('html, body').animate({ 313 scrollTop: calc_scroll 314 }, scrollSpeed, 'easeInOutCubic', function() { 315 UNCODE.scrolling = false; 316 } 317 ); 318 } 319 } 320 ); 321 } 322 }); 323 } 324 // TAB DATA-API 325 // ============ 326 $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function(e) { 327 e.preventDefault() 328 $(this).tab('show'); 329 requestTimeout(function() { 330 window.dispatchEvent(UNCODE.boxEvent); 331 }, 300); 332 }); 333 // COLLAPSE DATA-API 334 // ================= 335 $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function(e) { 336 var $this = $(this), 337 href 338 var target = $this.attr('data-target') || e.preventDefault() || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 339 var $target = $(target) 340 var data = $target.data('bs.collapse') 341 var option = data ? 'toggle' : $this.data() 342 var parent = $this.attr('data-parent') 343 var $parent = parent && $(parent) 344 var $title = $(this).parent() 345 if ($parent) { 346 $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed') 347 if ($title.hasClass('active')) { 348 $title.removeClass('active'); 349 } else { 350 $parent.find('.panel-title').removeClass('active') 351 $title[!$target.hasClass('in') ? 'addClass' : 'removeClass']('active') 352 } 353 } 354 $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') 355 }); 356 // FitText 357 // ================= 358 window.uncode_textfill = function(el, loaded) { 359 if (el == undefined) el = $('body'); 360 $.each($('.bigtext', el), function(index, val) { 361 $(val).bigtext({ 362 minfontsize: 24 363 }); 364 if (!$(val).parent().hasClass('blocks-animation') && !$(val).hasClass('animate_when_almost_visible')) $(val).css({ 365 opacity: 1 366 }); 367 requestTimeout(function() { 368 if ($(val).find('.animate_when_almost_visible').length != 0) { 369 $(val).css({opacity: 1}); 370 } 371 }, 400); 372 }); 373 } 374 window.uncode_textfill(); 375 376 // Colomun hover effect 377 // ================= 378 $(document).on('mouseenter', '.col-link', function(e) { 379 var uncol = $(e.target).prev('.uncol'), 380 el = uncol.find('.column-background'); 381 if (el) { 382 $('.btn-container .btn', uncol).toggleClass('active'); 383 var elOverlay = $(el[0]).find('.block-bg-overlay'); 384 if (elOverlay.length) { 385 var getOpacity = $(elOverlay).css('opacity'); 386 if (getOpacity != 1) { 387 getOpacity = Math.round(getOpacity * 100) / 100; 388 var newOpacity = getOpacity + .1; 389 $(elOverlay).data('data-opacity', getOpacity); 390 $(elOverlay).css('opacity', newOpacity); 391 } 392 } 393 } 394 }).on('mouseleave', '.col-link', function(e) { 395 var uncol = $(e.target).prev('.uncol'), 396 el = uncol.find('.column-background'); 397 $('.btn-container .btn', uncol).toggleClass('active'); 398 if (el) { 399 var elOverlay = $(el[0]).find('.block-bg-overlay'); 400 if (elOverlay.length) { 401 var getOpacity = $(elOverlay).data('data-opacity'); 402 $(elOverlay).css('opacity', getOpacity); 403 } 404 } 405 }); 406 407 // REVSLIDER API 408 // ============ 409 $(window).on("load", function() { 410 $('.rev_slider_wrapper, rs-module-wrap').each(function(){ 411 var $this = jQuery(this), 412 id_array = $this.attr("id").split("_"), 413 id = id_array[2]; 414 if (id != undefined && id != '') { 415 $.globalEval('revapi'+id+'.bind("revolution.slide.onloaded",function (e, data) { if (jQuery(e.currentTarget).closest(".header-revslider").length) { var style = jQuery(e.currentTarget).find("li, rs-slide").eq(0).attr("data-skin"), scrolltop = jQuery(document).scrollTop(); if (style != undefined) UNCODE.switchColorsMenu(scrolltop, style);}})'); 416 $.globalEval('revapi'+id+'.bind("revolution.slide.onchange",function (e,data) { if (jQuery(e.currentTarget).closest(".header-revslider").length) { var style = jQuery(e.currentTarget).find("li, rs-slide").eq(data.slideIndex - 1).attr("data-skin"), scrolltop = jQuery(document).scrollTop(); if (style != undefined) UNCODE.switchColorsMenu(scrolltop, style);}})'); 417 } 418 }); 419 }); 420 421 // LAYERSLIDE API 422 // ============ 423 $(window).on("load", function() { 424 425 $('.ls-wp-container').on('slideTimelineDidStart', function( event, slider ) { 426 427 var slideData = slider.slides.current.data, 428 scrolltop = $(document).scrollTop(); 429 if( slideData && slideData.skin ) { 430 431 UNCODE.switchColorsMenu(scrolltop, slideData.skin); 432 433 } 434 }); 435 436 }); 437 // Admin bar 438 // ============ 439 $(window).resize(function() { 440 if ($('html').hasClass('admin-mode') && !SiteParameters.is_frontend_editor ) { 441 var getAdminBar = $('#wpadminbar'); 442 if (getAdminBar.length) { 443 if (getAdminBar.css('position') !== 'hidden') { 444 var getAdminBarHeight = getAdminBar.height(); 445 if (getAdminBar.css('position') === 'fixed') { 446 $('html').css({'margin-top':getAdminBarHeight + 'px','padding-top': UNCODE.bodyBorder+'px'}); 447 $('.body-borders .top-border').css({'margin-top':getAdminBarHeight+'px'}); 448 } else { 449 $('html').css({'padding-top':UNCODE.bodyBorder + 'px','margin-top':'0px'}); 450 $('.body-borders .top-border').css({'margin-top':'0px'}); 451 } 452 } 453 } 454 } 455 }); 456 // Facebook 457 // =========== 458 this.fb_timeout = undefined; 459 $(window).resize(function() { 460 $('.facebook-object').each(function(index, el) { 461 var el = $(el), 462 parentWidth = el.closest('.tmb').width();
463 el.width(parentWidth); 464 }); 465 if (this.fb_timeout == undefined) { 466 if ($('.facebook-object').length) { 467 window.clearTimeout(this.fb_timeout); 468 this.fb_timeout = window.setTimeout(function(msg) { 469 window.dispatchEvent(UNCODE.boxEvent); 470 }, 1000); 471 } 472 } 473 }); 474 // Print 475 // =========== 476 var beforePrint = function() { 477 window.dispatchEvent(new CustomEvent('resize')); 478 window.dispatchEvent(UNCODE.boxEvent); 479 }; 480 481 if (window.matchMedia) { 482 var mediaQueryList = window.matchMedia('print'); 483 mediaQueryList.addListener(function(mql) { 484 if (mql.matches) { 485 beforePrint(); 486 } 487 }); 488 } 489 490 window.onbeforeprint = beforePrint; 491} 492 493UNCODE.lettering = function() { 494 495 var setCTA; 496 var highlightStill = function(){ 497 498 var $heading_texts = $('.heading-text:not(.animate_inner_when_almost_visible)'); 499 500 $.each($heading_texts, function(key, el) { 501 var $heading = $(el); 502 503 if ( ! $('.heading-text-highlight-inner[data-animated="yes"]', $heading).length ) { 504 return; 505 } 506 507 if (UNCODE.isUnmodalOpen && !el.closest('#unmodal-content')) { 508 return; 509 } 510 511 var waypoint = new Waypoint({ 512 context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, 513 element: el, 514 handler: function() { 515 var $anims = $('.heading-text-highlight-inner[data-animated="yes"]', this.element), 516 anims_l = $anims.length; 517 $anims.each(function(_key_, _el_){ 518 var $anim = $(_el_); 519 520 if ( ! $anim.hasClass('heading-text-highlight-animated') ) { 521 $anim.addClass('heading-text-highlight-animated'); 522 523 if ( $heading.data('animate') === true ) { 524 $anim.css({ 525 '-webkit-transition-duration': '0ms', 526 '-moz-transition-duration': '0ms', 527 '-o-transition-duration': '0ms', 528 'transition-duration': '0ms', 529 }); 530 } else { 531 $anim.css({ 532 '-webkit-transition-delay': ((_key_ + 2) * 200) + 'ms', 533 '-moz-transition-delay': ((_key_ + 2) * 200) + 'ms', 534 '-o-transition-delay': ((_key_ + 2) * 200) + 'ms', 535 'transition-delay': ((_key_ + 2) * 200) + 'ms', 536 }); 537 } 538 } 539 540 }); 541 $anims.last().one('webkitTransitionEnd oTransitionEnd mozTransitionEnd msTransitionEnd transitionEnd', function(e) { 542 $heading.data('animate', true); 543 }); 544 $anims.removeAttr('data-animated'); 545 }, 546 offset: '100%' 547 }); 548 549 }); 550 551 Waypoint.refreshAll(); 552 $( document.body ).trigger('uncode_waypoints'); 553 554 } 555 556 requestTimeout(function(){ 557 highlightStill(); 558 $(window).on( 'resize', function(){ 559 clearRequestTimeout(setCTA); 560 setCTA = requestTimeout( highlightStill, 100 ); 561 }); 562 }, 400); 563 564}; 565 566UNCODE.isUnmodalOpen = false; 567 568UNCODE.menuSystem = function() { 569 570 function menuMobile() { 571 var $body = $('body'), 572 $mobileToggleButton = $('.mobile-menu-button'), 573 $box, 574 $el, 575 $el_transp, 576 elHeight, 577 check, 578 animating = false, 579 stickyMobile = false, 580 menuClose = new CustomEvent('menuMobileClose'), 581 menuOpen = new CustomEvent('menuMobileOpen'); 582 UNCODE.menuOpened = false; 583 $mobileToggleButton.on('click', function(event) { 584 var btn = this; 585 if ($(btn).hasClass('overlay-close')) return; 586 event.preventDefault(); 587 if (UNCODE.wwidth <= UNCODE.mediaQuery) { 588 $box = $(this).closest('.box-container').find('.main-menu-container'); 589 $el = $(this).closest('.box-container').find('.menu-horizontal-inner:not(.row-brand), .menu-sidebar-inner'); 590 $el_transp = $('.menu-absolute.menu-transparent'); 591 if (UNCODE.isMobile) { 592 if ( $('.menu-wrapper.menu-sticky, .menu-wrapper.menu-hide-only, .main-header .menu-sticky-vertical, .main-header .menu-hide-only-vertical').length ) { 593 stickyMobile = true; 594 elHeight = window.innerHeight - UNCODE.menuMobileHeight - (UNCODE.bodyBorder * 2) - UNCODE.adminBarHeight + 1; 595 } else { 596 elHeight = 0; 597 $.each($box.find('> div'), function(index, val) { 598 elHeight += $(val).outerHeight(); 599 }); 600 } 601 } else { 602 elHeight = 0; 603 $.each($el, function(index, val) { 604 elHeight += $(val).outerHeight(); 605 }); 606 } 607 var open = function() { 608 if (!animating) { 609 $body.addClass('open-overlay-menu'); 610 window.dispatchEvent(menuOpen); 611 animating = true; 612 UNCODE.menuOpened = true; 613 if ($('body[class*="vmenu-"], body.hmenu-center').length && ($('.menu-hide, .menu-sticky, .menu-transparent').length)) { 614 $('.main-header > .vmenu-container').css({position:'fixed', top: ($('.menu-container').outerHeight() + UNCODE.bodyBorder + UNCODE.adminBarHeight) + 'px'}); 615 if ($('body.menu-offcanvas').length) { 616 $('.menu-container:not(.sticky-element):not(.isotope-filters)').css({position:'fixed'}); 617 $('.vmenu-container.menu-container:not(.sticky-element):not(.isotope-filters)').css({position:'fixed', top: (UNCODE.menuMobileHeight +
617UNCODE.bodyBorder + UNCODE.adminBarHeight) + 'px'}); 618 } else { 619 if ( $('.menu-hide, .menu-sticky').length ) { 620 $('.menu-container:not(.sticky-element):not(.isotope-filters)').css({position:'fixed'}); 621 } 622 } 623 } 624 if ($('body.hmenu-center').length && ($('.menu-hide, .menu-sticky').length)) { 625 $('.menu-container:not(.sticky-element):not(.isotope-filters)').css({position:'fixed', top: (UNCODE.menuMobileHeight + UNCODE.bodyBorder + UNCODE.adminBarHeight) + 'px'}); 626 } 627 btn.classList.add('close'); 628 $box.addClass('open-items'); 629 if ($el_transp.length && $('body.menu-mobile-transparent').length) { 630 $el_transp.addClass('is_mobile_open'); 631 } 632 $box.animate({ 633 height: elHeight 634 }, 600, "easeInOutCirc", function() { 635 animating = false; 636 if (!stickyMobile) $box.css('height', 'auto'); 637 }); 638 } 639 }; 640 641 var close = function() { 642 if (!animating) { 643 window.dispatchEvent(menuClose); 644 animating = true; 645 UNCODE.menuOpened = false; 646 btn.classList.remove('close'); 647 btn.classList.add('closing'); 648 $box.addClass('close'); 649 requestTimeout(function() { 650 $box.removeClass('close'); 651 $box.removeClass('open-items'); 652 btn.classList.remove('closing'); 653 if ($el_transp.length) { 654 $el_transp.removeClass('is_mobile_open'); 655 } 656 }, 500); 657 $box.animate({ 658 height: 0 659 }, { 660 duration: 600, 661 easing: "easeInOutCirc", 662 complete: function(elements) { 663 $(elements).css('height', ''); 664 animating = false; 665 if ($('body[class*="vmenu-"]').length && UNCODE.wwidth >= 960) { 666 $('.main-header > .vmenu-container').add('.menu-container:not(.sticky-element):not(.isotope-filters)').css('position','relative'); 667 } 668 $body.removeClass('open-overlay-menu'); 669 } 670 }); 671 } 672 }; 673 check = (!UNCODE.menuOpened) ? open() : close(); 674 } 675 }); 676 window.addEventListener('menuMobileTrigged', function(e) { 677 $('.mobile-menu-button.close').trigger('click'); 678 }); 679 window.addEventListener('orientationchange', function(e) { 680 $('#logo-container-mobile .mobile-menu-button.close').trigger('click'); 681 }); 682 window.addEventListener("resize", function() { 683 if ($(window).width() < UNCODE.mediaQuery) { 684 if (UNCODE.isMobile) { 685 var $box = $('.box-container .main-menu-container'), 686 $el = $('.box-container .menu-horizontal-inner, .box-container .menu-sidebar-inner'); 687 if ($($box).length && $($box).hasClass('open-items') && $($box).css('height') != 'auto') { 688 if ($('.menu-wrapper.menu-sticky, .menu-wrapper.menu-hide-only').length) { 689 elHeight = 0; 690 $.each($el, function(index, val) { 691 elHeight += $(val).outerHeight(); 692 }); 693 elHeight = window.innerHeight - $('.menu-wrapper.menu-sticky .menu-container .row-menu-inner, .menu-wrapper.menu-hide-only .menu-container .row-menu-inner').height() - (UNCODE.bodyBorder * 2) + 1; 694 $($box).css('height', elHeight + 'px'); 695 } 696 } 697 } 698 } else { 699 $('.menu-hide-vertical').removeAttr('style'); 700 $('.menu-container-mobile').removeAttr('style'); 701 $('.vmenu-container.menu-container').removeAttr('style'); 702 } 703 }); 704 }; 705 706 function menuOffCanvas() { 707 var menuClose = new CustomEvent('menuCanvasClose'), 708 menuOpen = new CustomEvent('menuCanvasOpen'); 709 $('.menu-primary .menu-button-offcanvas').click(function(event) { 710 if ($(window).width() > UNCODE.mediaQuery) { 711 if ($(event.currentTarget).hasClass('close')) { 712 $(event.currentTarget).removeClass('close'); 713 $(event.currentTarget).addClass('closing'); 714 requestTimeout(function() { 715 $(event.currentTarget).removeClass('closing'); 716 window.dispatchEvent(menuClose); 717 }, 500); 718 } else { 719 $(event.currentTarget).addClass('close'); 720 window.dispatchEvent(menuOpen); 721 } 722 723 } 724 $('body').toggleClass('off-opened'); 725 }); 726 }; 727 function menuSmart() { 728 var $menusmart = $('[class*="menu-smart"]'); 729 if ($menusmart.length > 0) { 730 $menusmart.smartmenus({ 731 subIndicators: false, 732 subIndicatorsPos: 'append', 733 subMenusMinWidth: '13em', 734 subIndicatorsText: '', 735 showTimeout: 50, 736 hideTimeout: 50, 737 showFunction: function($ul, complete) { 738 $ul.fadeIn(0, 'linear', complete); 739 $ul.addClass('open-animated'); 740 }, 741 hideFunction: function($ul, complete) { 742 var fixIE = $('html.ie').length; 743 if (fixIE) { 744 var $rowParent = $($ul).closest('.main-menu-container'); 745 $rowParent.height('auto'); 746 } 747 $ul.fadeOut(0, 'linear', complete); 748 $ul.removeClass('open-animated'); 749 }, 750 collapsibleShowFunction: function($ul, complete) { 751 $ul.slideDown(400, 'easeInOutCirc', function() { 752 12}); 753 }, 754 collapsibleHideFunction: function($ul, complete) { 755 $ul.slideUp(200, 'easeInOutCirc', complete); 756 }, 757 hideOnClick: true 758 }); 759 760 if ( $('body').hasClass('menu-accordion-active') ) { 761 requestTimeout(function(){ 762 $menusmart.smartmenus( 'itemActivate', $menusmart.find( '.current-menu-item > a' ).eq( -1 ) ); 763 $menusmart.addClass('menu-smart-init'); 764 }, 1000); 765 } 766 } 767 768 }; 769 function menuOverlay() { 770 if ( $('.overlay').length ) { 771 $('.overlay').removeClass('hidden'); 772 } 773 if ($('.overlay-sequential, .menu-mobile-animated').length > 0) { 774 $('.overlay-sequential .menu-smart > li, .menu-sticky .menu-container .menu-smart > li, .menu-hide.menu-container .menu-smart > li, .vmenu-container .menu-smart > li').each(function(index, el) { 775 var transDelay = (index / 20) + 0.1; 776 if ( $('body').hasClass('menu-mobile-centered') && $(window).width() < UNCODE.mediaQuery ) 777 transDelay = transDelay + 0.3; 778 $(this)[0].setAttribute('style', '-webkit-transition-delay:' + transDelay + 's; -moz-transition-delay:' + transDelay + 's; -ms-transition-delay:' + transDelay + 's; -o-transition-delay:' + transDelay + 's; transition-delay:' + transDelay + 's'); 779 }); 780 } 781 }; 782 function menuAppend() { 783 var $body = $('body'), 784 $menuCont = $('.menu-container'), 785 $cta = $('.navbar-cta'), 786 $socials = $('.navbar-social'), 787 $ul = $('.navbar-main ul.menu-primary-inner'), 788 $ulCta, 789 $ulSocials, 790 $firstMenu = $('.main-menu-container:first-child', $menuCont), 791 $secondMenu = $('.main-menu-container:last-child', $menuCont), 792 $firstNav = $('.navbar-nav:first-child', $firstMenu), 793 $secondNav = $('.navbar-nav:first-child', $secondMenu), 794 $ulFirst = $('> ul', $firstNav), 795 $ulSecond = $('> ul', $secondNav), 796 setCTA, 797 appendCTA = function(){ 798 return true; 799 }, 800 appendSocials = function(){ 801 return true; 802 }, 803 appendSplit = function(){ 804 return true; 805 }; 806 807 if ( $body.hasClass('cta-not-appended') ) 808 return false;
809 810 if ( ( $body.hasClass('menu-offcanvas') || $body.hasClass('menu-overlay') || $body.hasClass('hmenu-center-split') ) && $cta.length ) { 811 $ulCta = $('> ul', $cta); 812 813 appendCTA = function(){ 814 if (UNCODE.wwidth < UNCODE.mediaQuery) { 815 $ul.after($ulCta); 816 } else { 817 $cta.append($ulCta); 818 } 819 } 820 } 821 appendCTA(); 822 823 if ( ( $body.hasClass('hmenu-center-split') || $body.hasClass('menu-overlay-center') ) && $socials.length ) { 824 $ulSocials = $('> ul', $socials); 825 826 appendSocials = function(){ 827 if (UNCODE.wwidth < UNCODE.mediaQuery) { 828 $ul.after($ulSocials); 829 } else { 830 $socials.append($ulSocials); 831 } 832 } 833 } 834 appendSocials(); 835 836 if ( ( $body.hasClass('hmenu-center-double') ) ) { 837 appendSplit = function(){ 838 if (UNCODE.wwidth < UNCODE.mediaQuery) { 839 if ( $secondNav.length ) { 840 $secondNav.prepend($ulFirst); 841 } 842 $firstMenu.hide(); 843 } else { 844 $firstNav.append($ulFirst); 845 $firstMenu.css({ 846 'display': 'table-cell' 847 }); 848 } 849 } 850 } 851 appendSplit(); 852 853 $(window).on( 'resize', function(){ 854 clearRequestTimeout(setCTA); 855 setCTA = requestTimeout( function() { 856 appendCTA(); 857 appendSocials(); 858 appendSplit(); 859 }, 10 ); 860 }); 861 } 862 //menuMobileButton(); 863 menuMobile(); 864 menuOffCanvas(); 865 menuSmart(); 866 menuOverlay(); 867 menuAppend(); 868 var setMenuOverlay; 869 $(window).on( 'resize', function(){ 870 if ( $('.overlay').length && $(window).width() > 1024 ) { 871 $('.overlay').addClass('hidden'); 872 } 873 clearRequestTimeout(setMenuOverlay); 874 setMenuOverlay = requestTimeout( menuOverlay, 150 ); 875 }); 876}; 877 878UNCODE.okvideo = function() { 879 var BLANK_GIF = "data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D"; 880 $.okvideo = function(options) { 881 // if the option var was just a string, turn it into an object 882 if (typeof options !== 'object') options = { 883 'video': options 884 }; 885 var base = this; 886 // kick things off 887 base.init = function() { 888 base.options = $.extend({}, $.okvideo.options, options); 889 // support older versions of okvideo 890 if (base.options.video === null) base.options.video = base.options.source; 891 base.setOptions(); 892 var target = base.options.target || $('body'); 893 var position = target[0] == $('body')[0] ? 'fixed' : 'absolute'; 894 var zIndex = base.options.controls === 3 ? -999 : "auto"; 895 if ($('#okplayer-' + base.options.id).length == 0) { //base.options.id = String(Math.round(Math.random() * 100000)); 896 var mask = '<div id="okplayer-mask-' + base.options.id + '" style="position:' + position + ';left:0;top:0;overflow:hidden;z-index:-998;height:100%;width:100%;"></div>'; 897 if (OKEvents.utils.isMobile()) { 898 target.append('<div id="okplayer-' + base.options.id + '" style="position:' + position + ';left:0;top:0;overflow:hidden;z-index:' + zIndex + ';height:100%;width:100%;"></div>'); 899 } else { 900 if (base.options.controls === 3) { 901 target.append(mask) 902 } 903 if (base.options.adproof === 1) { 904 target.append('<div id="okplayer-' + base.options.id + '" style="position:' + position + ';left:-10%;top:-10%;overflow:hidden;z-index:' + zIndex + ';height:120%;width:120%;"></div>'); 905 } else { 906 target.append('<div id="okplayer-' + base.options.id + '" style="position:' + position + ';left:0;top:0;overflow:hidden;z-index:' + zIndex + ';height:100%;width:100%;"></div>'); 907 } 908 } 909 $("#okplayer-mask-" + base.options.id).css("background-image", "url(" + BLANK_GIF + ")"); 910 if (base.options.playlist.list === null) { 911 if (base.options.video.provider === 'youtube') { 912 base.loadYouTubeAPI(); 913 } else if (base.options.video.provider === 'vimeo') { 914 base.options.volume /= 100; 915 base.loadVimeoAPI(); 916 } 917 } else { 918 base.loadYouTubeAPI(); 919 } 920 } 921 }; 922 // clean the options 923 base.setOptions = function() { 924 // exchange 'true' for '1' and 'false' for 3 925 for (var key in this.options) { 926 if (this.options[key] === true) this.options[key] = 1; 927 if (this.options[key] === false) this.options[key] = 3; 928 } 929 if (base.options.playlist.list === null) { 930 base.options.video = base.determineProvider(); 931 } 932 // pass options to the window 933 $(window).data('okoptions-' + base.options.id, base.options); 934 };
935 // insert js into the head and exectue a callback function 936 base.insertJS = function(src, callback){ 937 var tag; 938 if (UNCODE.insertedSripts && UNCODE.insertedSripts[src]) { 939 tag = UNCODE.insertedSripts[src]; 940 if (callback){ 941 if (tag.readyState){ //IE 942 tag.onreadystatechange = function(){ 943 if (tag.readyState === "loaded" || 944 tag.readyState === "complete"){ 945 tag.onreadystatechange = null; 946 callback(); 947 } 948 }; 949 } else { 950 $(tag).load(callback); 951 } 952 } 953 return; 954 } 955 tag = document.createElement('script'); 956 if (callback){ 957 if (tag.readyState){ //IE 958 tag.onreadystatechange = function(){ 959 if (tag.readyState === "loaded" || tag.readyState === "complete"){ 960 tag.onreadystatechange = null; 961 callback(); 962 } 963 }; 964 } else { 965 tag.onload = function() { 966 callback(); 967 }; 968 } 969 } 970 tag.src = src; 971 var firstScriptTag = document.getElementsByTagName('script')[0]; 972 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 973 if ( ! UNCODE.insertedSripts ) { 974 UNCODE.insertedSripts = []; 975 } 976 UNCODE.insertedSripts[src] = tag; 977 }; 978 // load the youtube api 979 base.loadYouTubeAPI = function(callback) { 980 base.insertJS('https://www.youtube.com/player_api'); 981 }; 982 base.loadYouTubePlaylist = function() { 983 player.loadPlaylist(base.options.playlist.list, base.options.playlist.index, base.options.playlist.startSeconds, base.options.playlist.suggestedQuality); 984 }; 985 // load the vimeo api by replacing the div with an iframe and loading js 986 base.loadVimeoAPI = function() { 987 var source = '//player.vimeo.com/video/' + base.options.video.id + '?background=1&api=1&title=0&byline=0&portrait=0&playbar=0&loop=' + base.options.loop + '&autoplay=' + (base.options.autoplay === 1 ? 1 : 0) + '&player_id=okplayer-' + base.options.id, 988 jIframe = $('<iframe data-src="'+source+'" frameborder="0" id="okplayer-' + base.options.id +'" style="visibility: hidden;" class="vimeo-background" />'); 989 $(window).data('okoptions-' + base.options.id).jobject = jIframe; 990 $('#okplayer-' + base.options.id).replaceWith(jIframe[0]); 991 base.insertJS('//f.vimeocdn.com/js/froogaloop2.min.js', function() { 992 vimeoPlayerReady(base.options.id); 993 }); 994 }; 995 // is it from youtube or vimeo? 996 base.determineProvider = function() { 997 var a = document.createElement('a'); 998 a.href = base.options.video; 999 if (/youtube.com/.test(base.options.video) || /youtu.be/.test(base.options.video)) { 1000 var videoid = a.href.split('/')[3].toString(); 1001 var query = videoid.substring(videoid.indexOf('?') + 1); 1002 if (query != '') { 1003 var vars = query.split('&'); 1004 for (var i = 0; i < vars.length; i++) { 1005 var pair = vars[i].split('='); 1006 if (pair[0] == 'v') { 1007 videoid = pair[1]; 1008 } 1009 } 1010 } 1011 return { 1012 "provider": "youtube", 1013 "id": videoid 1014 }; 1015 } else if (/vimeo.com/.test(base.options.video)) { 1016 return { 1017 "provider": "vimeo", 1018 "id": (a.href.split('/')[3].toString()).split('#')[0], 1019 }; 1020 } else if (/[-A-Za-z0-9_]+/.test(base.options.video)) { 1021 var id = new String(base.options.video.match(/[-A-Za-z0-9_]+/)); 1022 if (id.length == 11) { 1023 return { 1024 "provider": "youtube", 1025 "id": id.toString() 1026 }; 1027 } else { 1028 for (var i = 0; i < base.options.video.length; i++) { 1029 if (typeof parseInt(base.options.video[i]) !== "number") { 1030 throw 'not vimeo but thought it was for a sec'; 1031 } 1032 } 1033 return { 1034 "provider": "vimeo", 1035 "id": base.options.video 1036 }; 1037 } 1038 } else { 1039 throw "OKVideo: Invalid video source"; 1040 } 1041 }; 1042 base.init(); 1043 }; 1044 $.okvideo.options = { 1045 id: null, 1046 source: null, // Deprecate dis l8r 1047 video: null, 1048 playlist: { // eat ur heart out @brokyo 1049 list: null, 1050 index: 0, 1051 startSeconds: 0, 1052 suggestedQuality: "default" // options: small, medium, large, hd720, hd1080, highres, default 1053 }, 1054 disableKeyControl: 1, 1055 captions: 0, 1056 loop: 1, 1057 hd: 1, 1058 volume: 0, 1059 adproof: false, 1060 unstarted: null, 1061 onFinished: null, 1062 onReady: null, 1063 onPlay: null, 1064 onPause: null, 1065 buffering: null, 1066 controls: false, 1067 autoplay: true, 1068 annotations: true, 1069 cued: null 1070 }; 1071 $.fn.okvideo = function(options) { 1072 options.target = this; 1073 return this.each(function() { 1074 (new $.okvideo(options)); 1075 }); 1076 }; 1077 1078 $(".no-touch .uncode-video-container.video").each(function(index, el) { 1079 var $this = $(this), 1080 url = $this.attr('data-video'), 1081 id = $this.attr('data-id'), 1082 cloned = $this.closest('.owl-item'); 1083 if (!cloned.hasClass('cloned') || cloned.length == 0) { 1084 $this.okvideo({ 1085 id: id, 1086 source: url.split('#')[0], 1087 time: ((url).indexOf("#") > -1) ? (url).substring((url).indexOf('#') + 1) : null, 1088 autoplay: 1, 1089 controls: 0, 1090 volume: 0, 1091 adproof: 0, 1092 caller: $this, 1093 hd: 1, 1094 onReady: function(player) { 1095 var getPlayer = player.c || player, 1096 getContainer = $(getPlayer).closest('.background-element'); 1097 if (getContainer.length) { 1098 UNCODE.initVideoComponent(getContainer[0], '.uncode-video-container.video'); 1099 } 1100 } 1101 }); 1102 } 1103 }); 1104 $(".background-video-shortcode").each(function(index, el) { 1105 if ( SiteParameters.block_mobile_videos === true ) { 1106 return false;
1107 } 1108 if ( $(this).closest('mediaelementwrapper').length ) { 1109 return true; 1110 } 1111 var $video_el = $(this), 1112 $parent_carousel = $video_el.parents('.uncode-slider').eq(0), 1113 video_id = $video_el.attr('id'); 1114 1115 if ( SiteParameters.is_frontend_editor ) { 1116 video_id = video_id + '_' + index; 1117 $video_el.attr('id', video_id); 1118 } 1119 1120 if (typeof MediaElement === "function") { 1121 var media = new MediaElement(video_id, { 1122 startVolume: 0, 1123 loop: true, 1124 success: function(mediaElement, domObject) { 1125 domObject.volume = 0; 1126 $(mediaElement).data('started', false); 1127 mediaElement.addEventListener('timeupdate', function(e) { 1128 if (!$(e.target).data('started')) { 1129 $(mediaElement).data('started', true); 1130 } 1131 }); 1132 mediaElement.addEventListener('loadedmetadata', function(e) { 1133 mediaElement.play(); 1134 }); 1135 if (!UNCODE.isMobile) { 1136 requestTimeout(function() { 1137 UNCODE.initVideoComponent(document.body, '.uncode-video-container.video, .uncode-video-container.self-video'); 1138 }, 100); 1139 } 1140 if ( ($('html.firefox').length) && !$parent_carousel.length ) { 1141 mediaElement.play(); 1142 } 1143 1144 mediaElement.addEventListener('play', function() { 1145 $(mediaElement).closest('.uncode-video-container').css('opacity', '1'); 1146 $(mediaElement).closest('#page-header').addClass('video-started'); 1147 $(mediaElement).closest('.background-wrapper').find('.block-bg-blend-mode.not-ie').css('opacity', '1'); 1148 }, true); 1149 1150 }, 1151 // fires when a problem is detected 1152 error: function() {} 1153 }); 1154 1155 } 1156 }); 1157 1158 var manageVideoSize = function(){ 1159 1160 var setVideoFit; 1161 $('.wp-block-embed').each(function(){ 1162 1163 var $this = $(this); 1164 1165 if ( $('iframe', $this).length ) { 1166 1167 var $iframe = $('> iframe, > a > iframe', $this), 1168 w = parseFloat($iframe.attr('width')), 1169 h = parseFloat($iframe.attr('height')), 1170 url = $iframe.attr('src'), 1171 ratio, frW; 1172 1173 if ( typeof url != 'undefined' && url.indexOf('soundcloud') == -1 && h !== 0 ) { 1174 1175 ratio = h / w; 1176 var resizeiFrame = function(){ 1177 frW = $iframe.width(); 1178 $iframe.css({ 1179 height: frW * ratio 1180 }); 1181 }; 1182 resizeiFrame(); 1183 $(window).on('resize load', resizeiFrame); 1184 1185 } 1186 1187 } 1188 1189 }); 1190 1191 }; 1192 1193 manageVideoSize(); 1194}; 1195 1196UNCODE.disableHoverScroll = function() { 1197 1198 if (!UNCODE.isMobile && !UNCODE.isFullPage) { 1199 var body = document.body, 1200 timer; 1201 1202 window.addEventListener('scroll', function() { 1203 clearRequestTimeout(timer); 1204 if (body.classList) { 1205 if (!body.classList.contains('disable-hover')) { 1206 body.classList.add('disable-hover') 1207 } 1208 1209 timer = requestTimeout(function() { 1210 body.classList.remove('disable-hover') 1211 }, 300); 1212 } 1213 }, false); 1214 } 1215}; 1216 1217UNCODE.isotopeLayout = function() { 1218 if ($('.isotope-layout').length > 0) { 1219 var isotopeContainersArray = [], 1220 typeGridArray = [], 1221 layoutGridArray = [], 1222 screenLgArray = [], 1223 screenMdArray = [], 1224 screenSmArray = [], 1225 transitionDuration = [], 1226 $filterItems = [], 1227 $filters = $('.isotope-system .isotope-filters'), 1228 $itemSelector = '.tmb-iso', 1229 $items, 1230 itemMargin, 1231 correctionFactor = 0, 1232 firstLoad = true, 1233 isOriginLeft = $('body').hasClass('rtl') ? false : true; 1234 $('[class*="isotope-container"]').each(function() { 1235 var isoData = $(this).data(), 1236 $data_lg, 1237 $data_md, 1238 $data_sm; 1239 $(this).children('.tmb').addClass('tmb-iso'); 1240 if (isoData.lg !== undefined) $data_lg = $(this).attr('data-lg'); 1241 else $data_lg = '1000'; 1242 if (isoData.md !== undefined) $data_md = $(this).attr('data-md'); 1243 else $data_md = '600'; 1244 if (isoData.sm !== undefined) $data_sm = $(this).attr('data-sm'); 1245 else $data_sm = '480'; 1246 screenLgArray.push($data_lg); 1247 screenMdArray.push($data_md); 1248 screenSmArray.push($data_sm); 1249 transitionDuration.push($('.t-inside.animate_when_almost_visible', this).length > 0 ? 0 : '0.5s'); 1250 if (isoData.type == 'metro') typeGridArray.push(true);
1251 else typeGridArray.push(false); 1252 if (isoData.layout !== undefined) layoutGridArray.push(isoData.layout); 1253 else layoutGridArray.push('masonry'); 1254 isotopeContainersArray.push($(this)); 1255 }); 1256 var colWidth = function(index) { 1257 $(isotopeContainersArray[index]).width(''); 1258 var isPx = $(isotopeContainersArray[index]).parent().hasClass('px-gutter'), 1259 widthAvailable = $(isotopeContainersArray[index]).width(), 1260 columnNum = 12, 1261 columnWidth = 0, 1262 data_vp_height = $(isotopeContainersArray[index]).attr('data-vp-height'), 1263 consider_menu = $(isotopeContainersArray[index]).attr('data-vp-menu'), 1264 winHeight = UNCODE.wheight - UNCODE.adminBarHeight, 1265 $rowContainer, 1266 paddingRow, 1267 $colContainer, 1268 paddingCol; 1269 1270 if ( consider_menu ) 1271 winHeight = winHeight - UNCODE.menuHeight; 1272 1273 if ( data_vp_height === '1' ) { 1274 $rowContainer = $(isotopeContainersArray[index]).parents('.row-parent').eq(0), 1275 paddingRow = parseInt($rowContainer.css('padding-top')) + parseInt($rowContainer.css('padding-bottom')), 1276 $colContainer = $(isotopeContainersArray[index]).parents('.uncell').eq(0), 1277 paddingCol = parseInt($colContainer.css('padding-top')) + parseInt($colContainer.css('padding-bottom')); 1278 winHeight = winHeight - ( paddingRow + paddingCol ); 1279 } 1280 1281 if (isPx) { 1282 columnWidth = Math.ceil(widthAvailable / columnNum); 1283 $(isotopeContainersArray[index]).width(columnNum * Math.ceil(columnWidth)); 1284 } else { 1285 columnWidth = ($('html.firefox').length) ? Math.floor(widthAvailable / columnNum) : widthAvailable / columnNum; 1286 } 1287 $items = $(isotopeContainersArray[index]).find('.tmb-iso:not(.tmb-carousel)'); 1288 itemMargin = parseInt($(isotopeContainersArray[index]).find('.t-inside').css("margin-top")); 1289 for (var i = 0, len = $items.length; i < len; i++) { 1290 var $item = $($items[i]), 1291 multiplier_w = $item.attr('class').match(/tmb-iso-w(\d{0,2})/), 1292 multiplier_h = $item.attr('class').match(/tmb-iso-h(\d{0,3})/), 1293 multiplier_fixed = multiplier_h !== null ? multiplier_h[1] : 1; 1294 1295 if (widthAvailable >= screenMdArray[index] && widthAvailable < screenLgArray[index]) { 1296 if (multiplier_w != null && multiplier_w[1] !== undefined) { 1297 switch (parseInt(multiplier_w[1])) { 1298 case (5): 1299 case (4): 1300 case (3): 1301 if (typeGridArray[index]) multiplier_h[1] = (6 * multiplier_h[1]) / multiplier_w[1]; 1302 multiplier_w[1] = 6; 1303 break; 1304 case (2): 1305 case (1): 1306 if (typeGridArray[index]) multiplier_h[1] = (3 * multiplier_h[1]) / multiplier_w[1]; 1307 multiplier_w[1] = 3; 1308 break; 1309 default: 1310 if (typeGridArray[index]) multiplier_h[1] = (12 * multiplier_h[1]) / multiplier_w[1]; 1311 multiplier_w[1] = 12; 1312 break; 1313 } 1314 } 1315 } else if (widthAvailable >= screenSmArray[index] && widthAvailable < screenMdArray[index]) { 1316 if (multiplier_w != null && multiplier_w[1] !== undefined) { 1317 switch (parseInt(multiplier_w[1])) { 1318 case (5): 1319 case (4): 1320 case (3): 1321 case (2): 1322 case (1): 1323 if (typeGridArray[index]) multiplier_h[1] = (6 * multiplier_h[1]) / multiplier_w[1]; 1324 multiplier_w[1] = 6; 1325 break; 1326 default: 1327 if (typeGridArray[index]) multiplier_h[1] = (12 * multiplier_h[1]) / multiplier_w[1]; 1328 multiplier_w[1] = 12; 1329 break; 1330 } 1331 } 1332 } else if (widthAvailable < screenSmArray[index]) { 1333 if (multiplier_w != null && multiplier_w[1] !== undefined) { 1334 //if (typeGridArray[index]) multiplier_h[1] = (12 * multiplier_h[1]) / multiplier_w[1]; 1335 multiplier_w[1] = 12; 1336 if (typeGridArray[index]) multiplier_h[1] = 12; 1337 } 1338 } 1339 var width = multiplier_w ? Math.floor(columnWidth * multiplier_w[1]) : columnWidth, 1340 height; 1341 1342 if ( data_vp_height === '1' && typeof multiplier_h[1] !== 'undefined' ) { 1343 height = multiplier_h ? Math['ceil'](winHeight / (100 / multiplier_fixed) ) - itemMargin : columnWidth; 1344 if ( widthAvailable < screenSmArray[index] ) { 1345 height = Math['ceil']((2 * Math.ceil(columnWidth / 2)) * 12) - itemMargin; 1346 } 1347 } else { 1348 height = multiplier_h ? Math['ceil']((2 * Math.ceil(columnWidth / 2)) * multiplier_h[1]) - itemMargin : columnWidth; 1349 } 1350 1351 if (width >= widthAvailable) { 1352 $item.css({ 1353 width: widthAvailable 1354 }); 1355 if (typeGridArray[index]) { 1356 $item.children().add($item.find('.backimg')).css({ 1357 height: height 1358 }); 1359 } 1360 } else { 1361 $item.css({ 1362 width: width 1363 }); 1364 if (typeGridArray[index]) { 1365 $item.children().add($item.find('.backimg')).css({ 1366 height: height 1367 }); 1368 } 1369 } 1370 } 1371 return columnWidth; 1372 }, 1373 init_isotope = function() { 1374 for (var i = 0, len = isotopeContainersArray.length; i < len; i++) { 1375 var isotopeSystem = $(isotopeContainersArray[i]).closest($('.isotope-system')), 1376 isotopeId = isotopeSystem.attr('id'), 1377 $layoutMode = layoutGridArray[i], 1378 setIsotopeFirstRowTimeOut, 1379 setIsotopeFirstRow = function(items){ 1380 var firstRow = true; 1381 $(items).each(function(index, val){ 1382 var el = items[index].element, 1383 el_top = items[index].position.y, 1384 $el = $(el); 1385 if ( index > 0 && el_top > 0 && firstRow ) { 1386 firstRow = false;
1387 } else if ( index == 0 && el_top == 0 ) { 1388 firstRow = true; 1389 } 1390 if ( firstRow ) { 1391 $el.removeClass('tmb-isotope-further-row'); 1392 } else { 1393 $el.addClass('tmb-isotope-further-row'); 1394 } 1395 }); 1396 }; 1397 $(isotopeContainersArray[i]).not('.un-isotope-init').addClass('un-isotope-init').isotope({ 1398 //resizable: true, 1399 itemSelector: $itemSelector, 1400 layoutMode: $layoutMode, 1401 transitionDuration: transitionDuration[i], 1402 masonry: { 1403 columnWidth: colWidth(i) 1404 }, 1405 vertical: { 1406 horizontalAlignment: 0.5, 1407 }, 1408 sortBy: 'original-order', 1409 isOriginLeft: isOriginLeft 1410 }) 1411 .on('layoutComplete', onLayout($(isotopeContainersArray[i]), 0)) 1412 .on('layoutComplete', function( event, items ){ 1413 if ( typeof items[0] !== 'undefined' ) { 1414 if ( $(items[0].element).closest('.off-grid-layout').length ) { 1415 setIsotopeFirstRow(items); 1416 } 1417 } 1418 }) 1419 .on('arrangeComplete', function( event, items ){ 1420 if ( typeof items[0] !== 'undefined' ) { 1421 if ( $(items[0].element).closest('.off-grid-layout').length ) { 1422 clearRequestTimeout(setIsotopeFirstRowTimeOut); 1423 setIsotopeFirstRowTimeOut = requestTimeout(function(){ 1424 setIsotopeFirstRow(items); 1425 }, 100); 1426 } 1427 } 1428 }); 1429 if ($(isotopeContainersArray[i]).hasClass('isotope-infinite')) { 1430 $(isotopeContainersArray[i]).infinitescroll({ 1431 navSelector: '#' + isotopeId + ' .loadmore-button', // selector for the pagination container 1432 nextSelector: '#' + isotopeId + ' .loadmore-button a', // selector for the NEXT link (to page 2) 1433 itemSelector: '#' + isotopeId + ' .isotope-layout .tmb, #' + isotopeId + ' .isotope-filters li', // selector for all items you'll retrieve 1434 animate: false, 1435 behavior: 'local', 1436 debug: false, 1437 loading: { 1438 selector: '#' + isotopeId + '.isotope-system .isotope-footer-inner', 1439 speed: 0, 1440 finished: undefined, 1441 msg: $('#' + isotopeId + ' .loadmore-button'), 1442 }, 1443 errorCallback: function() { 1444 var isotope_system = $(this).closest('.isotope-system'); 1445 $('.loading-button', isotope_system).hide(); 1446 $('.loadmore-button', isotope_system).attr('style', 'display:none !important'); 1447 } 1448 }, 1449 // append the new items to isotope on the infinitescroll callback function. 1450 function(newElements, opts) { 1451 var $isotope = $(this), 1452 isotopeId = $isotope.closest('.isotope-system').attr('id'), 1453 filters = new Array(), 1454 $loading_button = $isotope.closest('.isotope-system').find('.loading-button'), 1455 $infinite_button = $isotope.closest('.isotope-system').find('.loadmore-button'), 1456 $numPages = $('a', $infinite_button).data('pages'), 1457 delay = 300; 1458 $('a', $infinite_button).html($('a', $infinite_button).data('label')); 1459 $infinite_button.show(); 1460 $loading_button.hide(); 1461 if ( $numPages != undefined && opts.state.currPage == $numPages) $infinite_button.hide(); 1462 $('> li', $isotope).remove(); 1463 $.each($(newElements), function(index, val) { 1464 $(val).addClass('tmb-iso'); 1465 if ($(val).is("li")) { 1466 filters.push($(val)[0]); 1467 } 1468 }); 1469 newElements = newElements.filter(function(x) { 1470 return filters.indexOf(x) < 0 1471 }); 1472 $.each($(filters), function(index, val) { 1473 if ($('#' + isotopeId + ' a[data-filter="' + $('a', val).attr('data-filter') + '"]').length == 0) $('#' + isotopeId + ' .isotope-filters ul').append($(val)); 1474 }); 1475 $isotope.isotope('reloadItems', onLayout($isotope, newElements.length)); 1476 var getLightbox = UNCODE.lightboxArray['ilightbox_' + isotopeId]; 1477 if (typeof getLightbox === 'object') getLightbox.refresh(); 1478 if ( typeof twttr !== 'undefined' ) 1479 twttr.widgets.load(isotopeContainersArray[i]); 1480 1481 }); 1482 if ($(isotopeContainersArray[i]).hasClass('isotope-infinite-button')) { 1483 var $infinite_isotope = $(isotopeContainersArray[i]), 1484 $infinite_button = $infinite_isotope.closest('.isotope-system').find('.loadmore-button a'); 1485 $infinite_isotope.infinitescroll('pause'); 1486 $infinite_button.on('click', function(event) { 1487 event.preventDefault(); 1488 var $infinite_system = $(event.target).closest('.isotope-system'), 1489 $infinite_isotope = $infinite_system.find('.isotope-container'), 1490 isotopeId = $infinite_system.attr('id'); 1491 $(event.currentTarget).html(SiteParameters.loading); 1492 $infinite_isotope.infinitescroll('resume'); 1493 $infinite_isotope.infinitescroll('retrieve'); 1494 $infinite_isotope.infinitescroll('pause'); 1495 }); 1496 } 1497 } 1498 } 1499 }, 1500 onLayout = function(isotopeObj, startIndex) { 1501 window.uncode_textfill(); 1502 isotopeObj.css('opacity', 1); 1503 isotopeObj.closest('.isotope-system').find('.isotope-footer').css('opacity', 1); 1504 1505 requestTimeout(function() { 1506 window.dispatchEvent(UNCODE.boxEvent); 1507 UNCODE.adaptive(); 1508 $(isotopeObj).find('audio,video').each(function() { 1509 $(this).mediaelementplayer({ 1510 pauseOtherPlayers: false, 1511 }); 1512 }); 1513 if ($(isotopeObj).find('.nested-carousel').length) { 1514 UNCODE.carousel($(isotopeObj).find('.nested-carousel')); 1515 requestTimeout(function() { 1516 boxAnimation($('.tmb-iso', isotopeObj), startIndex, true, isotopeObj); 1517 }, 200); 1518 } else { 1519 boxAnimation($('.tmb-iso', isotopeObj), startIndex, true, isotopeObj); 1520 } 1521 }, 100); 1522 1523 }, 1524 boxAnimation = function(items, startIndex, sequential, container) { 1525 var $allItems = items.length - startIndex, 1526 showed = 0, 1527 index = 0; 1528 if (container.closest('.owl-item').length == 1) return false;
1529 $.each(items, function(index, val) { 1530 var elInner = $('> .t-inside', val); 1531 if (UNCODE.isUnmodalOpen && !val.closest('#unmodal-content')) { 1532 return; 1533 } 1534 if (val[0]) val = val[0]; 1535 if (elInner.hasClass('animate_when_almost_visible') && !elInner.hasClass('force-anim')) { 1536 new Waypoint({ 1537 context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, 1538 element: val, 1539 handler: function() { 1540 var element = $('> .t-inside', this.element), 1541 parent = $(this.element), 1542 currentIndex = parent.index(); 1543 var delay = (!sequential) ? index : ((startIndex !== 0) ? currentIndex - $allItems : currentIndex), 1544 delayAttr = parseInt(element.attr('data-delay')); 1545 if (isNaN(delayAttr)) delayAttr = 100; 1546 delay -= showed; 1547 var objTimeout = requestTimeout(function() { 1548 element.removeClass('zoom-reverse').addClass('start_animation'); 1549 showed = parent.index(); 1550 }, delay * delayAttr) 1551 parent.data('objTimeout', objTimeout); 1552 if (!UNCODE.isUnmodalOpen) { 1553 this.destroy(); 1554 } 1555 }, 1556 offset: '100%' 1557 }) 1558 } else { 1559 if (elInner.hasClass('force-anim')) { 1560 elInner.addClass('start_animation'); 1561 } else { 1562 elInner.css('opacity', 1); 1563 } 1564 } 1565 index++; 1566 }); 1567 }; 1568 if ($('.isotope-pagination').length > 0) { 1569 $('.isotope-system').on('click', '.pagination a', function(evt) { 1570 evt.preventDefault(); 1571 1572 var filterContainer = $(this).closest('.isotope-system').find('.isotope-filters'), 1573 container = $(this).closest('.isotope-system'), 1574 calc_scroll = container.closest('.uncol').offset().top, 1575 getFilterSpanPadding = (!filterContainer.hasClass('with-bg')) ? $('.filter-show-all span', filterContainer).css("padding-bottom") : 0, 1576 getFilterPadding = (!filterContainer.hasClass('with-bg')) ? $('.filter-show-all span a', filterContainer).css("padding-bottom") : 0, 1577 filterOffset = (getFilterSpanPadding != undefined && getFilterSpanPadding != 0) ? parseInt(getFilterSpanPadding.replace("px", "")) : 0; 1578 filterOffset += (getFilterPadding != undefined && getFilterPadding != 0) ? parseInt(getFilterPadding.replace("px", "")) : 0; 1579 1580 calc_scroll -= filterOffset - 1; 1581 calc_scroll -= UNCODE.get_scroll_offset(); 1582 1583 var bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'], 1584 delta = bodyTop - calc_scroll, 1585 scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(delta) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed; 1586 if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000; 1587 1588 if ( !UNCODE.isFullPage ) { 1589 if (scrollSpeed == 0) { 1590 $('html, body').scrollTop(calc_scroll); 1591 } else { 1592 $('html, body').animate({ 1593 scrollTop: calc_scroll 1594 },{ 1595 easing: 'easeInOutQuad', 1596 duration: scrollSpeed, 1597 complete: function(){ 1598 UNCODE.scrolling = false; 1599 } 1600 }); 1601 } 1602 } 1603 1604 loadIsotope($(this)); 1605 evt.preventDefault(); 1606 }); 1607 } 1608 $filters.on('click', 'a.isotope-nav-link', function(evt) { 1609 if ($(this).hasClass('no-isotope-filter')) { 1610 return; 1611 } 1612 var $filter = $(this), 1613 filterContainer = $filter.closest('.isotope-filters'), 1614 filterValue = $filter.attr('data-filter'), 1615 container = $filter.closest('.isotope-system').find($('.isotope-layout')), 1616 transitionDuration = container.data().isotope.options.transitionDuration, 1617 delay = 300, 1618 filterItems = []; 1619 if (!$filter.hasClass('active')) { 1620 /** Scroll top with filtering */ 1621 if (filterContainer.hasClass('filter-scroll')) { 1622 var calc_scroll = container.closest('.uncol').offset().top, 1623 getFilterSpanPadding = (!filterContainer.hasClass('with-bg')) ? $('.filter-show-all span', filterContainer).css("padding-bottom") : 0, 1624 getFilterPadding = (!filterContainer.hasClass('with-bg')) ? $('.filter-show-all span a', filterContainer).css("padding-bottom") : 0, 1625 filterOffset = (getFilterSpanPadding != undefined && getFilterSpanPadding != 0) ? parseInt(getFilterSpanPadding.replace("px", "")) : 0; 1626 filterOffset += (getFilterPadding != undefined && getFilterPadding != 0) ? parseInt(getFilterPadding.replace("px", "")) : 0; 1627 1628 calc_scroll -= filterOffset - 1; 1629 calc_scroll -= UNCODE.get_scroll_offset(); 1630 1631 var bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'], 1632 delta = bodyTop - calc_scroll, 1633 scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(delta) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed; 1634 if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000; 1635 1636 if ( !UNCODE.isFullPage ) { 1637 if (scrollSpeed == 0) { 1638 $('html, body').scrollTop(calc_scroll); 1639 UNCODE.scrolling = false;
1640 } else { 1641 $('html, body').animate({ 1642 scrollTop: calc_scroll 1643 },{ 1644 easing: 'easeInOutQuad', 1645 duration: scrollSpeed, 1646 complete: function(){ 1647 UNCODE.scrolling = false; 1648 } 1649 }); 1650 } 1651 } 1652 } 1653 if (filterValue !== undefined) { 1654 $.each($('> .tmb-iso > .t-inside', container), function(index, val) { 1655 var parent = $(val).parent(), 1656 objTimeout = parent.data('objTimeout'); 1657 if (objTimeout) { 1658 $(val).removeClass('zoom-reverse').removeClass('start_animation') 1659 clearRequestTimeout(objTimeout); 1660 } 1661 if (transitionDuration == 0) { 1662 if ($(val).hasClass('animate_when_almost_visible')) { 1663 $(val).addClass('zoom-reverse').removeClass('start_animation'); 1664 } else { 1665 $(val).addClass('animate_when_almost_visible zoom-reverse zoom-anim force-anim'); 1666 } 1667 } 1668 }); 1669 requestTimeout(function(){ 1670 if ( filterValue == '*' ) { 1671 container.removeClass('isotope-filtered'); 1672 } else { 1673 container.addClass('isotope-filtered'); 1674 } 1675 container.isotope({ 1676 filter: function() { 1677 var block = $(this), 1678 filterable = (filterValue == '*') || block.hasClass(filterValue), 1679 lightboxElements = $('[data-lbox^=ilightbox]', block); 1680 if (filterable) { 1681 if (lightboxElements.length) { 1682 lightboxElements.removeClass('lb-disabled'); 1683 container.data('lbox', $(lightboxElements[0]).data('lbox')); 1684 } 1685 filterItems.push(block); 1686 } else { 1687 if (lightboxElements.length) lightboxElements.addClass('lb-disabled'); 1688 } 1689 return filterable; 1690 } 1691 }); 1692 $('.t-inside.zoom-reverse', container).removeClass('zoom-reverse'); 1693 }, delay); 1694 1695 /** once filtered - start **/ 1696 container.isotope('once', 'arrangeComplete', function() { 1697 var getLightbox = UNCODE.lightboxArray[container.data('lbox')]; 1698 if (typeof getLightbox === 'object') getLightbox.refresh(); 1699 if (transitionDuration == 0) { 1700 requestTimeout(function() { 1701 boxAnimation(filterItems, 0, false, container); 1702 }, 100); 1703 } 1704 requestTimeout(function() { 1705 Waypoint.refreshAll(); 1706 }, 2000); 1707 }); 1708 /** once filtered - end **/ 1709 } else { 1710 $.each($('> .tmb-iso > .t-inside', container), function(index, val) { 1711 var parent = $(val).parent(), 1712 objTimeout = parent.data('objTimeout'); 1713 if (objTimeout) { 1714 $(val).removeClass('zoom-reverse').removeClass('start_animation') 1715 clearRequestTimeout(objTimeout); 1716 } 1717 if (transitionDuration == 0) { 1718 if ($(val).hasClass('animate_when_almost_visible')) { 1719 $(val).addClass('zoom-reverse').removeClass('start_animation'); 1720 } else { 1721 $(val).addClass('animate_when_almost_visible zoom-reverse zoom-anim force-anim'); 1722 } 1723 } 1724 }); 1725 container.parent().addClass('isotope-loading'); 1726 loadIsotope($filter); 1727 } 1728 } 1729 evt.preventDefault(); 1730 }); 1731 $(window).on("popstate", function(e) { 1732 if (e.originalEvent.state === null) return; 1733 var params = {}; 1734 if (location.search) { 1735 var parts = location.search.substring(1).split('&'); 1736 for (var i = 0; i < parts.length; i++) { 1737 var nv = parts[i].split('='); 1738 if (!nv[0]) continue; 1739 params[nv[0]] = nv[1] || true; 1740 } 1741 } 1742 if (params.id === undefined) { 1743 $.each($('.isotope-system'), function(index, val) { 1744 loadIsotope($(val)); 1745 }); 1746 } else loadIsotope($('#' + params.id)); 1747 }); 1748 1749 var loadIsotope = function($href) { 1750 var href = ($href.is("a") ? $href.attr('href') : location), 1751 isotopeSystem = ($href.is("a") ? $href.closest($('.isotope-system')) : $href), 1752 isotopeWrapper = isotopeSystem.find($('.isotope-wrapper')), 1753 isotopeFooter = isotopeSystem.find($('.isotope-footer-inner')), 1754 isotopeResultCount = isotopeSystem.find($('.woocommerce-result-count-wrapper')), 1755 isotopeContainer = isotopeSystem.find($('.isotope-layout')), 1756 isotopeId = isotopeSystem.attr('id'); 1757 if ( $href.is("a") && ! isotopeSystem.hasClass('un-no-history') ) { 1758 history.pushState({ 1759 myIsotope: true 1760 }, document.title, href); 1761 } 1762 $.ajax({ 1763 url: href 1764 }).done(function(data) { 1765 var $resultItems = $(data).find('#' + isotopeId + ' .isotope-layout').html(), 1766 $resultPagination = $(data).find('#' + isotopeId + ' .pagination'), 1767 $resultCount = $(data).find('#' + isotopeId + ' .woocommerce-result-count'); 1768 isotopeWrapper.addClass('isotope-reloaded'); 1769 requestTimeout(function() { 1770 isotopeWrapper.removeClass('isotope-loading'); 1771 isotopeWrapper.removeClass('isotope-reloaded'); 1772 }, 500); 1773 $.each($('> .tmb > .t-inside', isotopeContainer), function(index, val) { 1774 var parent = $(val).parent(), 1775 objTimeout = parent.data('objTimeout'); 1776 if (objTimeout) { 1777 $(val).removeClass('zoom-reverse').removeClass('start_animation') 1778 clearRequestTimeout(objTimeout); 1779 } 1780 if ($(val).hasClass('animate_when_almost_visible')) { 1781 $(val).addClass('zoom-reverse').removeClass('start_animation'); 1782 } else { 1783 $(val).addClass('animate_when_almost_visible zoom-reverse zoom-in force-anim'); 1784 } 1785 }); 1786 requestTimeout(function() { 1787 if (isotopeContainer.data('isotope')) { 1788 isotopeContainer.html($resultItems).children('.tmb').addClass('tmb-iso'); 1789 isotopeContainer.isotope('reloadItems', onLayout(isotopeContainer, 0)); 1790 UNCODE.adaptive(); 1791 var getLightbox = UNCODE.lightboxArray['ilightbox_' + isotopeContainer.closest('.isotope-system').attr('id')]; 1792 if (typeof getLightbox === 'object') getLightbox.refresh(); 1793 } 1794 }, 300); 1795 $('.pagination', isotopeFooter).remove(); 1796 isotopeFooter.append($resultPagination); 1797 1798 if (isotopeResultCount.length > 0) { 1799 $('.woocommerce-result-count', isotopeResultCount).remove(); 1800 isotopeResultCount.append($resultCount); 1801 } 1802 }); 1803 }; 1804 $filters.each(function(i, buttonGroup) { 1805 var $buttonGroup = $(buttonGroup); 1806 $buttonGroup.on('click', 'a:not(.no-isotope-filter)', function() { 1807 $buttonGroup.find('.active').removeClass('active'); 1808 $(this).addClass('active'); 1809 1810 }); 1811 1812 var $cats_mobile_trigger = $('.menu-smart--filter-cats_mobile-toggle-trigger', $buttonGroup), 1813 $cats_mobile_toggle = $('.menu-smart--filter-cats_mobile-toggle', $buttonGroup), 1814 $cats_filters = $('.menu-smart--filter-cats', $buttonGroup); 1815 $buttonGroup.on('click', 'a.menu-smart--filter-cats_mobile-toggle-trigger', function(e) { 1816 e.preventDefault(); 1817 $cats_filters.slideToggle(400, 'easeInOutCirc'); 1818 }); 1819 1820 }); 1821 window.addEventListener('boxResized', function(e) { 1822 $.each($('.isotope-layout'), function(index, val) { 1823 var $layoutMode = ($(this).data('layout')); 1824 if ($layoutMode === undefined) $layoutMode = 'masonry'; 1825 if ($(this).data('isotope')) { 1826 $(this).isotope({ 1827 itemSelector: $itemSelector, 1828 layoutMode: $layoutMode, 1829 transitionDuration: transitionDuration[index], 1830 masonry: { 1831 columnWidth: colWidth(index) 1832 }, 1833 vertical: { 1834 horizontalAlignment: 0.5, 1835 }, 1836 sortBy: 'original-order', 1837 isOriginLeft: isOriginLeft 1838 }); 1839 $(this).isotope('unbindResize'); 1840 } 1841 $(this).find('.mejs-video,.mejs-audio').each(function() { 1842 $(this).trigger('resize'); 1843 }); 1844 }); 1845 }, false); 1846 1847 init_isotope(); 1848 }; 1849} 1850 1851UNCODE.lightbox = function() { 1852 UNCODE.lightboxArray = {}; 1853 requestTimeout(function() { 1854 var groupsArr = {}; 1855 $('[data-lbox^=ilightbox]:not(.lb-disabled):not([data-lbox-init])').each(function() { 1856 var group = this.getAttribute("data-lbox"), 1857 values = $(this).data(); 1858 $(this).attr('data-lbox-init','true') 1859 groupsArr[group] = values; 1860 }); 1861 for (var i in groupsArr) { 1862 var skin = groupsArr[i].skin || 'black', 1863 path = groupsArr[i].dir || 'horizontal', 1864 thumbs = !groupsArr[i].notmb || false,
1865 arrows = !groupsArr[i].noarr || false, 1866 social = groupsArr[i].social || false, 1867 deeplink = groupsArr[i].deep || false, 1868 $els = $('[data-lbox="' + i + '"]:not(.lb-disabled)'), 1869 counter = $els.length, 1870 dataAlbum = $els.attr('data-album'); 1871 if (social) social = { 1872 facebook: true, 1873 twitter: true, 1874 reddit: true, 1875 digg: true, 1876 delicious: true 1877 }; 1878 UNCODE.lightboxArray[i] = $els.iLightBox({ 1879 skin: skin, 1880 path: path, 1881 linkId: deeplink, 1882 infinite: false, 1883 //fullViewPort: 'fit', 1884 smartRecognition: false, 1885 fullAlone: true, 1886 maxScale: 1, 1887 minScale: .02, 1888 //fullStretchTypes: 'flash, video', 1889 overlay: { 1890 opacity: .94 1891 }, 1892 controls: { 1893 arrows: (counter > 1 || ( typeof dataAlbum !== 'undefined' ) ? arrows : false), 1894 fullscreen: true, 1895 thumbnail: thumbs, 1896 slideshow: (counter > 1 || ( typeof dataAlbum !== 'undefined' ) ? true : false) 1897 }, 1898 show: { 1899 speed: 200 1900 }, 1901 hide: { 1902 speed: 200 1903 }, 1904 social: { 1905 start: false, 1906 buttons: social 1907 }, 1908 caption: { 1909 start: false 1910 }, 1911 styles: { 1912 nextOpacity: 1, 1913 nextScale: 1, 1914 prevOpacity: 1, 1915 prevScale: 1 1916 }, 1917 effects: { 1918 switchSpeed: 400 1919 }, 1920 slideshow: { 1921 pauseTime: 5000 1922 }, 1923 thumbnails: { 1924 maxWidth: 60, 1925 maxHeight: 60, 1926 activeOpacity: .2 1927 }, 1928 html5video: { 1929 preload: true 1930 }, 1931 callback: { 1932 onOpen: function(){ 1933 if ( $('body').hasClass('ilb-no-bounce') && typeof iNoBounce !== 'undefined' ) 1934 iNoBounce.enable(); 1935 }, 1936 onHide: function(){ 1937 if ( $('body').hasClass('ilb-no-bounce') && typeof iNoBounce !== 'undefined' ) 1938 iNoBounce.disable() 1939 }, 1940 } 1941 }); 1942 1943 $(document).on('infinite-loaded', function(){ 1944 UNCODE.lightboxArray[i].refresh(); 1945 }); 1946 }; 1947 }, 100); 1948 1949 $(document).on('click', '.lb-disabled', function(e){ 1950 e.preventDefault(); 1951 }); 1952}; 1953 1954/*UNCODE.backVideo = function() { 1955 $(function() { 1956 $.each($('.background-video-shortcode'), function() { 1957 var video_id = $(this).attr('id'); 1958 if (typeof MediaElement === "function") { 1959 new MediaElement(video_id, { 1960 startVolume: 0, 1961 loop: true, 1962 success: function(mediaElement, domObject) { 1963 mediaElement.play(); 1964 $(mediaElement).closest('.uncode-video-container').css('opacity','1'); 1965 domObject.volume = 0; 1966 }, 1967 // fires when a problem is detected 1968 error: function() {} 1969 }); 1970 } 1971 }); 1972 }); 1973};*/ 1974UNCODE.carousel = function(container) { 1975 var $owlContainer = $('.owl-carousel-container', container), 1976 $owlWrapper = $owlContainer.closest('.owl-carousel-wrapper'), 1977 $owlSelector = $('> [class*="owl-carousel"]', $owlContainer), 1978 values = {}, 1979 tempTimeStamp, 1980 currentIndex, 1981 $owlInsideEqual = []; 1982 $owlSelector.each(function() { 1983 var itemID = $(this).attr('id'), 1984 $elSelector = $(('#' + itemID).toString()); 1985 values['id'] = itemID; 1986 values['items'] = 1;
1987 values['columns'] = 3; 1988 values['fade'] = false; 1989 values['nav'] = false; 1990 values['navmobile'] = false; 1991 values['navskin'] = 'light'; 1992 values['navspeed'] = 400; 1993 values['dots'] = false; 1994 values['dotsmobile'] = false; 1995 values['loop'] = false; 1996 values['autoplay'] = false; 1997 values['timeout'] = 3000; 1998 values['autoheight'] = false; 1999 values['stagepadding'] = 0; 2000 values['margin'] = 0; 2001 values['lg'] = 1; 2002 values['md'] = 1; 2003 values['sm'] = 1; 2004 $.each($(this).data(), function(i, v) { 2005 values[i] = v; 2006 }); 2007 2008 if ($(this).closest('.uncode-slider').length) { 2009 values['navskin'] = ''; 2010 values['navmobile'] = false; 2011 //values['dotsmobile'] = true; 2012 } else { 2013 values['navskin'] = ' style-'+values['navskin']+' style-override'; 2014 } 2015 2016 var setIndexActive = function(event, init){ 2017 var init = typeof init === 'undefined' ? false : init; 2018 if (tempTimeStamp != event.timeStamp && ( init || ( !UNCODE.isFullPage || ( UNCODE.isFullPage && $(event.currentTarget).closest('.fp-section').hasClass('uncode-scroll-active') ) ) ) ) { 2019 var scrolltop = $(document).scrollTop(), 2020 size = event.page.size, 2021 i; 2022 var setIndex = requestTimeout(function() { 2023 for ( i = 0; i < size; i++ ) { 2024 var itemCont = event.item.index != null ? (event.item.index + i) : i; 2025 var currentItem = $(event.currentTarget).find("> .owl-stage-outer > .owl-stage > .owl-item")[itemCont]; 2026 if ($(event.currentTarget).closest('.row-slider').length) { 2027 if (currentItem == undefined) { 2028 currentItem = $(event.currentTarget).children()[i]; 2029 } 2030 if ($(currentItem).closest('#page-header').length) { 2031 if ($('.row-container > .row > .row-inner > div > .style-dark', currentItem).closest('.uncode-slider').length) { 2032 UNCODE.switchColorsMenu(scrolltop, 'dark'); 2033 } else if ($('.row-container > .row > .row-inner > div > .style-light', currentItem).closest('.uncode-slider').length) { 2034 UNCODE.switchColorsMenu(scrolltop, 'light'); 2035 } 2036 } 2037 } 2038 var itendIndex = $(currentItem).attr('data-index'); 2039 if ( isNaN(itendIndex) ) { 2040 itendIndex = 1; 2041 } 2042 $elSelector.find('.owl-item:not(.new-indexed)').removeClass('index-active'); 2043 $elSelector.find('.owl-item[data-index="' + itendIndex + '"]').addClass('index-active').addClass('new-indexed'); 2044 $elSelector.find('.owl-item[data-index="' + itendIndex + '"] .counter').each(function(){ 2045 var $counter = $(this); 2046 $counter.addClass('started').counterUp({ 2047 delay: 10, 2048 time: 1500 2049 }); 2050 }); 2051 } 2052 $elSelector.find('.owl-item.new-indexed').removeClass('new-indexed'); 2053 }, 200); 2054 } 2055 tempTimeStamp = event.timeStamp; 2056 } 2057 2058 /** Initialized */ 2059 $elSelector.on('initialized.owl.carousel', function(event) { 2060 2061 $('.owl-dot.active', $elSelector).on('click', function(){ 2062 return false; 2063 }); 2064 2065 var thiis = $(event.currentTarget), 2066 // get the time from the data method 2067 time = thiis.data("timer-id"), 2068 rowParent = thiis.closest('.row-parent'); 2069 2070 if ( typeof rowParent[0] !== 'undefined' ) { 2071 rowParent[0].dispatchEvent(new CustomEvent('owl-carousel-initialized')); 2072 } 2073 2074 if (time) { 2075 clearRequestTimeout(time); 2076 } 2077 2078 thiis.addClass('showControls'); 2079 var new_time = requestTimeout(function() { 2080 thiis.closest('.owl-carousel-container').removeClass('owl-carousel-loading'); 2081 if (thiis.hasClass('owl-height-viewport')) 2082 setItemsRelHeight(event.currentTarget); 2083 if (thiis.hasClass('owl-height-equal')) 2084 setItemsHeight(event.currentTarget); 2085 if (!UNCODE.isMobile && !$elSelector.closest('.header-wrapper').length) navHover($elSelector.parent()); 2086 if (thiis.closest('.unequal, .unexpand').length) { 2087 UNCODE.setRowHeight(rowParent[0], true); 2088 } 2089 }, 350); 2090 // save the new time 2091 thiis.data("timer-id", new_time); 2092 2093 var scrolltop = $(document).scrollTop(); 2094 $(event.currentTarget).closest('.uncode-slider').find('video').removeAttr('poster'); 2095 2096 //if (!UNCODE.isMobile) { 2097 /** fix autoplay when visible **/ 2098 $(window).on('load', function(){ 2099 if ($(event.currentTarget).data('autoplay')) { 2100 $(event.currentTarget).trigger('stop.autoplay.owl'); 2101 } 2102 if (UNCODE.isUnmodalOpen && !$(event.currentTarget).closest('#unmodal-content')) { 2103 return; 2104 } 2105 var carouselInView = new Waypoint.Inview({ 2106 context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, 2107 element: $(event.currentTarget)[0], 2108 exited: function() { 2109 var el = $(this.element); 2110 if (el.data('autoplay')) { 2111 el.trigger('stop.owl.autoplay'); 2112 el.data('stopped','true'); 2113 } 2114 }, 2115 enter: function(direction) { 2116 var el = $(this.element); 2117 requestTimeout(function() { 2118 if (el.data('autoplay')) { 2119 el.trigger('play.owl.autoplay'); 2120 el.data('stopped','false'); 2121 } 2122 }, 100); 2123 } 2124 }); 2125 }); 2126 //} 2127 2128 // $(window).on('frontend:carousel_updated', function(){ 2129 // Waypoint.refreshAll(); 2130 // }); 2131 2132 if (!$(event.currentTarget).closest('.isotope-system').length) { 2133 requestTimeout(function() { 2134 animate_thumb($('.t-inside', el), event); 2135 }, 400); 2136 } 2137 2138 var currentItem = $(event.currentTarget).find("> .owl-stage-outer > .owl-stage > .owl-item")[event.item.index], 2139 currentIndex = $(currentItem).attr('data-index'); 2140 2141 $.each($('.owl-item:not(.active) .start_animation', $(event.target)), function(index, val) { 2142 if ($(val).closest('.uncode-slider').length) { 2143 $(val).removeClass('start_animation'); 2144 } 2145 }); 2146 $.each($('.owl-item:not(.active) .already-animated', $(event.target)), function(index, val) { 2147 if ($(val).closest('.uncode-slider').length) { 2148 $(val).removeClass('already-animated'); 2149 } 2150 }); 2151 2152 $.each($('.owl-item:not(.active) [data-animated="yes"]', $(event.target)), function(index, val) { 2153 if ($(val).closest('.uncode-slider').length) { 2154 $(val).removeAttr('data-animated'); 2155 } 2156 }); 2157 2158 $.each($('.owl-item.cloned', event.currentTarget), function(index, val) {
2159 $('.t-entry-visual-cont > a', $(val)).attr('data-lbox-clone', true); 2160 }); 2161 2162 $.each($('.owl-item:not(.active)', event.currentTarget), function(index, val) { 2163 if ($(val).attr('data-index') != currentIndex) { 2164 $('.start_animation:not(.t-inside)', val).removeClass('start_animation'); 2165 $('.already-animated:not(.t-inside)', val).removeClass('already-animated'); 2166 } 2167 if ($(val).attr('data-index') != currentIndex) { 2168 $('[data-animated="yes"]:not(.t-inside)', val).removeAttr('data-animated'); 2169 } 2170 if ($(val).attr('data-index') == currentIndex) { 2171 $('.animate_when_almost_visible:not(.t-inside), .animate_inner_when_almost_visible:not(.t-inside)', val).addClass('start_animation'); 2172 } 2173 }); 2174 2175 if ($(event.currentTarget).closest('.uncode-slider').length) { 2176 var el = $(event.currentTarget).closest('.row-parent')[0]; 2177 if ($(el).data('imgready')) { 2178 firstLoaded(el, event); 2179 } else { 2180 el.addEventListener("imgLoaded", function(el) { 2181 firstLoaded(el.target, event); 2182 }, false); 2183 } 2184 var transHeight = $('.hmenu .menu-transparent.menu-primary .menu-container').height() - UNCODE.bodyBorder; 2185 if (transHeight != null) { 2186 requestTimeout(function() { 2187 $(event.currentTarget).closest('.uncode-slider').find('.owl-prev, .owl-next').css('paddingTop', transHeight / 2 + 'px'); 2188 }, 100); 2189 } 2190 } else { 2191 var el = $(event.currentTarget); 2192 el.closest('.uncode-slider').addClass('slider-loaded'); 2193 } 2194 2195 requestTimeout(function() { 2196 window.uncode_textfill(thiis); 2197 if ($(event.currentTarget).closest('.uncode-slider').length) { 2198 if ($(event.currentTarget).data('autoplay')) pauseOnHover(event.currentTarget); 2199 } 2200 }, 500); 2201 2202 if ($(event.currentTarget).closest('.unequal').length) { 2203 $owlInsideEqual.push($(event.currentTarget).closest('.row-parent')); 2204 } 2205 2206 var containerClasses = '', 2207 containerStyle = ''; 2208 if ( $('.owl-dots-classes', $owlContainer).length ) { 2209 containerClasses = $('.owl-dots-classes', $owlContainer).attr('class'); 2210 containerStyle = $('.owl-dots-classes', $owlContainer).attr('style'); 2211 $('.owl-dots-classes', $owlContainer).remove(); 2212 } 2213 2214 if ( containerClasses !== '' ) { 2215 requestTimeout(function() { 2216 if ( containerClasses !== '' ) 2217 $('.owl-dots', $owlContainer).attr('style', containerStyle); 2218 if ( containerStyle !== '' ) 2219 $('.owl-dots', $owlContainer).addClass(containerClasses); 2220 }, 100); 2221 } 2222 2223 $.each($('.column_child.pos-bottom', event.currentTarget), function(index, val) { 2224 $(val).closest('.row-inner').css({ 2225 'margin-top': '-1px' 2226 }); 2227 }); 2228 2229 setIndexActive(event, true); 2230 }); 2231 2232 $elSelector.on('resized.owl.carousel', function(event) { 2233 if ($(this).closest('.nested-carousel').length) { 2234 requestTimeout(function() { 2235 window.dispatchEvent(UNCODE.boxEvent); 2236 }, 200); 2237 } 2238 if ( $(event.currentTarget).hasClass('owl-height-equal') ) 2239 setItemsHeight(event.currentTarget); 2240 2241 setItemsRelHeight($elSelector); 2242 2243 setIndexActive(event); 2244 }); 2245 2246 /** detect resize window for fluid height layout */ 2247 var setFluidResize; 2248 function manageFluidCarouseHeight() { 2249 clearRequestTimeout(setFluidResize); 2250 setFluidResize = requestTimeout(function(){ 2251 setItemsRelHeight($elSelector); 2252 }, 100); 2253 } 2254 window.addEventListener('resize', manageFluidCarouseHeight); 2255 2256 /** Change */ 2257 $elSelector.on('change.owl.carousel', function(event) { 2258 if (!UNCODE.isMobile) UNCODE.owlStopVideo(event.currentTarget); 2259 }); 2260 2261 /** Changed */ 2262 $elSelector.on('changed.owl.carousel', function(event) { 2263 var $row = $elSelector.parents('.row')[0]; 2264 if ( typeof $row !== 'undefined' ) { 2265 $row.dispatchEvent(new CustomEvent('owl-carousel-changed')); 2266 } 2267 setIndexActive(event); 2268 }); 2269 2270 $elSelector.on('translate.owl.carousel', function(event) { 2271 if (UNCODE.isMobile) { 2272 $(event.currentTarget).addClass('owl-translating'); 2273 } 2274 }); 2275 2276 /** Translated */ 2277 $elSelector.on('translated.owl.carousel', function(event) { 2278 2279 var currentItem = $(event.currentTarget).find("> .owl-stage-outer > .owl-stage > .owl-item")[event.item.index], 2280 currentIndex = $(currentItem).attr('data-index'),
2281 stagePadding = $(event.currentTarget).data('stagepadding'); 2282 2283 stagePadding = (stagePadding == undefined || stagePadding == 0) ? false : true; 2284 2285 if (!UNCODE.isMobile) { 2286 UNCODE.owlPlayVideo(event.currentTarget); 2287 } 2288 2289 requestTimeout(function(){ 2290 var lastDelayElems = animate_elems($('.owl-item.index-active', event.currentTarget)); 2291 var lastDelayThumb = animate_thumb($('.owl-item' + (stagePadding ? '' : '.active') + ' .t-inside', event.currentTarget), event); 2292 if ($(event.currentTarget).closest('.uncode-slider').length && $(event.currentTarget).data('autoplay')) { 2293 if (lastDelayElems == undefined) lastDelayElems = 0; 2294 if (lastDelayThumb == undefined) lastDelayThumb = 0; 2295 var maxDelay = Math.max(lastDelayElems, lastDelayThumb); 2296 $(event.currentTarget).trigger('stop.owl.autoplay'); 2297 requestTimeout(function() { 2298 if (!$(event.currentTarget).hasClass('owl-mouseenter') && $(event.currentTarget).data('stopped') != 'true') $(event.currentTarget).trigger('play.owl.autoplay'); 2299 }, maxDelay); 2300 } 2301 }, 200); 2302 2303 $.each($('.owl-item:not(.active) .start_animation', $(event.target)), function(index, val) { 2304 if ($(val).closest('.uncode-slider').length) { 2305 $(val).removeClass('start_animation'); 2306 } 2307 }); 2308 2309 $.each($('.owl-item:not(.active) .already-animated', $(event.target)), function(index, val) { 2310 if ($(val).closest('.uncode-slider').length) { 2311 $(val).removeClass('already-animated'); 2312 } 2313 }); 2314 2315 $.each($('.owl-item:not(.active) [data-animated="yes"]', $(event.target)), function(index, val) { 2316 if ($(val).closest('.uncode-slider').length) { 2317 $(val).removeAttr('data-animated'); 2318 } 2319 }); 2320 2321 $.each($('.owl-item:not(.active)', event.currentTarget), function(index, val) { 2322 if ($(val).attr('data-index') != currentIndex) { 2323 $('.start_animation:not(.t-inside)', val).removeClass('start_animation'); 2324 $('.already-animated:not(.t-inside)', val).removeClass('already-animated'); 2325 } 2326 if ($(val).attr('data-index') != currentIndex) { 2327 $('[data-animated="yes"]:not(.t-inside)', val).removeClass('start_animation'); 2328 } 2329 if ($(val).attr('data-index') == currentIndex) { 2330 $('.animate_when_almost_visible:not(.t-inside), .animate_inner_when_almost_visible:not(.t-inside)', val).addClass('start_animation'); 2331 } 2332 }); 2333 2334 if (UNCODE.isMobile) { 2335 $(event.currentTarget).removeClass('owl-translating'); 2336 } 2337 2338 setIndexActive(event); 2339 }); 2340 2341 if (UNCODE.wwidth < UNCODE.mediaQuery && $(this).data('stagepadding') > 25) values['stagepadding'] = 25; 2342 2343 /** Init carousel */ 2344 $elSelector.not('.showControls').owlCarousel({ 2345 items: values['items'], 2346 animateIn: (values['fade'] == true) ? 'fadeIn' : null, 2347 animateOut: (values['fade'] == true) ? 'fadeOut' : null, 2348 nav: values['nav'], 2349 dots: values['dots'], 2350 loop: values['loop'], 2351 stagePadding: values['stagepadding'], 2352 margin: 0, 2353 video: true, 2354 autoWidth: false, 2355 autoplay: false, 2356 autoplayTimeout: values['timeout'], 2357 autoplaySpeed: values['navspeed'], 2358 autoplayHoverPause: $(this).closest('.uncode-slider').length ? false : true, 2359 autoHeight: ( $(this).hasClass('owl-height-equal') ? false : ( $(this).hasClass('owl-height-auto') ? true : values['autoheight'] ) ), 2360 rtl: $('body').hasClass('rtl') ? true : false, 2361 fluidSpeed: true, 2362 navSpeed: values['navspeed'], 2363 dotsSpeed: values['navspeed'] / values['items'], 2364 navClass: [ 'owl-prev'+values['navskin'], 'owl-next'+values['navskin'] ], 2365 navText: ['<div class="owl-nav-container btn-default btn-hover-nobg"><i class="fa fa-fw fa-angle-left"></i></div>', '<div class="owl-nav-container btn-default btn-hover-nobg"><i class="fa fa-fw fa-angle-right"></i></div>'], 2366 navContainer: values['nav'] && ! SiteParameters.is_frontend_editor ? $elSelector : false, 2367 responsiveClass: true, 2368 responsiveBaseElement: '.box-container', 2369 responsive: { 2370 0: { 2371 items: values['sm'], 2372 nav: values['navmobile'], 2373 dots: values['dotsmobile'], 2374 dotsSpeed: values['navspeed'] / values['sm'], 2375 }, 2376 480: { 2377 items: values['sm'], 2378 nav: values['navmobile'], 2379 dots: values['dotsmobile'], 2380 dotsSpeed: values['navspeed'] / values['sm'], 2381 }, 2382 570: { 2383 items: values['md'], 2384 nav: values['navmobile'], 2385 dots: values['dotsmobile'], 2386 dotsSpeed: values['navspeed'] / values['md'], 2387 }, 2388 960: { 2389 items: values['lg'], 2390 dotsSpeed: values['navspeed'] / values['lg'], 2391 } 2392 } 2393 }); 2394 2395 var transDuration = parseFloat(values['navspeed']) * 0.3; 2396 var transDuration2 = parseFloat(values['navspeed']) * 0.8; 2397 2398 $('.owl-item .tmb', $elSelector).css({ 2399 '-webkit-transition-delay': transDuration + 'ms', 2400 '-moz-transition-delay': transDuration + 'ms', 2401 '-o-transition-delay': transDuration + 'ms', 2402 'transition-delay': transDuration + 'ms', 2403 '-webkit-transition-duration': transDuration2 + 'ms', 2404 '-moz-transition-duration': transDuration2 + 'ms', 2405 '-o-transition-duration': transDuration2 + 'ms', 2406 'transition-duration': transDuration2 + 'ms', 2407 }); 2408 2409 requestTimeout(function() { 2410 for (var i = $owlInsideEqual.length - 1; i >= 0; i--) { 2411 UNCODE.setRowHeight($owlInsideEqual[i]); 2412 }; 2413 }, 300); 2414 2415 $(window).on('load', function(){ 2416 var $elCarousel = $elSelector.data('owl.carousel'); 2417 if ( typeof $elCarousel !== 'undefined' ) { 2418 $elCarousel.trigger('refreshed'); 2419 for (var i = $owlInsideEqual.length - 1; i >= 0; i--) { 2420 UNCODE.setRowHeight($owlInsideEqual[i]); 2421 }; 2422 } 2423 }); 2424 2425 $( document.body ).on( 'added-owl-item', function( e, carousel_id, $new_slide, randId ) { 2426 if ( $('#' + carousel_id).data( 'added-id' ) != randId ) { 2427 $('#' + carousel_id).data( 'added-id', randId ).trigger( 'add.owl.carousel', $new_slide ).trigger('refresh.owl.carousel'); 2428 $('#' + carousel_id).find('.owl-item').each( function() { 2429 var $item = $(this), 2430 index = ( $item.index() + 1 ); 2431 $item.attr('data-index', index); 2432 }); 2433 } 2434 }); 2435 2436 if ( $('body').hasClass('compose-mode') && typeof window.parent.vc !== 'undefined' ) { 2437 window.parent.vc.events.on( 'removed-owl-item', function( carousel_id, item_index, randId ) { 2438 if ( $('#' + carousel_id).data( 'added-id' ) != randId ) { 2439 $('#' + carousel_id).data( 'added-id', randId ).trigger('remove.owl.carousel', [ (item_index-1) ]).trigger('refresh.owl.carousel'); 2440 $('#' + carousel_id).find('.owl-item').each( function() { 2441 var $item = $(this), 2442 index = ( $item.index() + 1 ); 2443 $item.attr('data-index', index); 2444 }); 2445 } 2446 }); 2447 } 2448 2449 }); 2450 2451 function firstLoaded(el, event) { 2452 var el = $(el), 2453 uncode_slider = el.find('.uncode-slider'); 2454 el.find('.owl-carousel').css('opacity', 1); 2455 uncode_slider.addClass('slider-loaded'); 2456 window.uncode_textfill(el.find('.owl-item.active')); 2457 //if (!UNCODE.isMobile) { 2458 requestTimeout(function() { 2459 var lastDelayElems = animate_elems(el.find('.owl-item.index-active')); 2460 var lastDelayThumb = animate_thumb(el.find('.owl-item.active .t-inside'), event); 2461 if (uncode_slider.length && el.find('.owl-carousel').data('autoplay')) { 2462 if (lastDelayElems == undefined) lastDelayElems = 0; 2463 if (lastDelayThumb == undefined) lastDelayThumb = 0; 2464 var maxDelay = Math.max(lastDelayElems, lastDelayThumb); 2465 $('> .owl-carousel', uncode_slider).trigger('stop.owl.autoplay'); 2466 requestTimeout(function() { 2467 $('> .owl-carousel', uncode_slider).trigger('play.owl.autoplay'); 2468 }, maxDelay); 2469 } 2470 }, 500); 2471 2472 //} 2473 } 2474 2475 function navHover(el) { 2476 var $owlCont = el, 2477 $owlPrev = $owlCont.find('.owl-prev'), 2478 $owlNext = $owlCont.find('.owl-next'), 2479 $owlDots = $owlCont.find('.owl-dots-inside .owl-dots'), 2480 $owlPagination = $owlCont.next(), 2481 owlPrevW = $owlPrev.outerWidth(), 2482 owlNextW = $owlNext.outerWidth(), 2483 owlDotsH = $owlDots.innerHeight(), 2484 owlTime = 400, 2485 owlNested = $owlCont.parent().parent().hasClass('nested-carousel'); 2486 if ( $('body').hasClass('rtl') ) { 2487 $owlPrev.css("margin-right", -owlPrevW); 2488 $owlNext.css("margin-left", -owlNextW); 2489 } else { 2490 $owlPrev.css("margin-left", -owlPrevW); 2491 $owlNext.css("margin-right", -owlNextW); 2492 } 2493 if (!owlNested) $owlDots.css("bottom", -owlDotsH); 2494 $owlCont.mouseenter(function() { 2495 owlNested = $owlCont.parent().parent().hasClass('nested-carousel'); 2496 $owlPrev.add($owlNext).css({ 2497 marginLeft: 0, 2498 marginRight: 0 2499 }); 2500 if (!owlNested) { 2501 $owlDots.css({ 2502 opacity: 1, 2503 bottom: 0 2504 }); 2505 } 2506 }).mouseleave(function() { 2507 owlNested = $owlCont.parent().parent().hasClass('nested-carousel'); 2508 if ( $('body').hasClass('rtl') ) { 2509 $owlPrev.css("margin-right", -owlPrevW); 2510 $owlNext.css("margin-left", -owlNextW); 2511 } else { 2512 $owlPrev.css("margin-left", -owlPrevW); 2513 $owlNext.css("margin-right", -owlNextW); 2514 } 2515 if (!owlNested) { 2516 $owlDots.css({ 2517 opacity: 1, 2518 bottom: -owlDotsH 2519 }); 2520 } 2521 }); 2522 }; 2523 2524 function animate_elems($this) { 2525 var lastDelay; 2526 $.each($('.animate_when_almost_visible:not(.t-inside), .animate_inner_when_almost_visible:not(.t-inside), .animate_when_parent_almost_visible:not(.t-inside)', $this), function(index, val) { 2527 var element = $(val), 2528 delayAttr = element.attr('data-delay'), 2529 $first_item = element.closest('.owl-item[data-index="1"]'); 2530 2531 if ( $first_item.length && $first_item.attr('data-already-reached') !== 'true' && !$first_item.closest('#page-header').length ) { 2532 return false;
2533 } 2534 2535 if (delayAttr == undefined) delayAttr = 0; 2536 requestTimeout(function() { 2537 element.addClass('start_animation'); 2538 }, delayAttr); 2539 lastDelay = delayAttr; 2540 }); 2541 return lastDelay; 2542 } 2543 2544 function animate_thumb(items, event) { 2545 var lastDelay, 2546 itemIndex, 2547 tempIndex = ($(event.currentTarget).data('tempIndex') == undefined) ? $('.owl-item.active', event.currentTarget).first().index() : $(event.currentTarget).data('tempIndex'), 2548 numActives = $('.owl-item.active', event.currentTarget).length, 2549 stagePadding = $(event.currentTarget).data('stagepadding'); 2550 2551 stagePadding = (stagePadding == undefined || stagePadding == 0) ? false : true; 2552 2553 $(event.currentTarget).data('tempIndex', event.item.index); 2554 $.each(items, function(index, val) { 2555 var parent = $(val).closest('.owl-item'); 2556 if (UNCODE.isUnmodalOpen && !val.closest('#unmodal-content')) { 2557 return; 2558 } 2559 if (!$(val).hasClass('start_animation')) { 2560 if (parent.hasClass('active') || stagePadding || $owlWrapper.hasClass('carousel-animation-first')) { 2561 var thumbInView = new Waypoint.Inview({ 2562 context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, 2563 element: val, 2564 enter: function(direction) { 2565 var element = $(this.element), 2566 delayAttr = parseInt(element.attr('data-delay')), 2567 itemIndex = element.closest('.owl-item').index() + 1, 2568 diffItem = Math.abs(itemIndex - tempIndex) - 1; 2569 if (itemIndex > tempIndex) { 2570 $(event.currentTarget).data('tempIndex', itemIndex); 2571 } 2572 if (isNaN(delayAttr)) delayAttr = 100; 2573 if (stagePadding) { 2574 var objTimeout = requestTimeout(function() { 2575 element.addClass('start_animation'); 2576 }, index * delayAttr); 2577 lastDelay = index * delayAttr; 2578 } else { 2579 $('.owl-item.cloned[data-index="'+(element.closest('.owl-item').data('index'))+'"] .t-inside', event.currentTarget).addClass('start_animation'); 2580 var objTimeout = requestTimeout(function() { 2581 element.addClass('start_animation'); 2582 }, diffItem * delayAttr); 2583 lastDelay = diffItem * delayAttr; 2584 } 2585 parent.data('objTimeout', objTimeout); 2586 if (!UNCODE.isUnmodalOpen) { 2587 this.destroy(); 2588 } 2589 } 2590 }); 2591 } 2592 } 2593 }); 2594 return lastDelay; 2595 } 2596 2597 function setItemsHeight(item) { 2598 $.each($('.owl-item', item), function(index, val) { 2599 var availableThumbHeight = $('.t-inside', $(val)).height(), 2600 innerThumbHeight = $('.t-entry-text-tc', $(val)).outerHeight(), 2601 difference = availableThumbHeight - innerThumbHeight; 2602 if ($('.tmb-content-under', val).length) { 2603 var visualPart = $('.t-entry-visual', val); 2604 if (visualPart.length) { 2605 difference -= $('.t-entry-visual', val).height(); 2606 } 2607 } 2608 if (! $('.tmb-content-lateral', val).length) 2609 $('.t-entry > *:last-child', val).css( 'transform', 'translateY('+difference+'px)' ); 2610 }); 2611 } 2612 2613 function setItemsRelHeight(item) { 2614 $.each($('.owl-item', item), function(index, val) { 2615 var $rowContainer = $(item).parents('.row-parent').eq(0), 2616 paddingRow = parseInt($rowContainer.css('padding-top')) + parseInt($rowContainer.css('padding-bottom')), 2617 $colContainer = $(item).parents('.uncell').eq(0), 2618 paddingCol = parseInt($colContainer.css('padding-top')) + parseInt($colContainer.css('padding-bottom')), 2619 winHeight = UNCODE.wheight, 2620 multiplier_h = parseInt($(item).attr('data-vp-height')), 2621 data_viewport_h, 2622 consider_menu = $(item).data('vp-menu'); 2623 2624 if ( consider_menu ) { 2625 winHeight = winHeight - UNCODE.menuHeight; 2626 } 2627 2628 data_viewport_h = Math.ceil(winHeight / (100 / multiplier_h) ) - ( paddingRow + paddingCol ); 2629 $('.t-inside', val).css( 'height', data_viewport_h ); 2630 }); 2631 } 2632 2633 function pauseOnHover(slider) { 2634 $('.owl-dots, .owl-prev, .owl-next', slider).on({ 2635 mouseenter: function () { 2636 $(slider).addClass('owl-mouseenter'); 2637 $(slider).trigger('stop.owl.autoplay'); 2638 }, 2639 mouseleave: function () { 2640 $(slider).removeClass('owl-mouseenter') 2641 $(slider).trigger('play.owl.autoplay'); 2642 } 2643 }); 2644 } 2645}; 2646 2647UNCODE.owlPlayVideo = function(carousel) { 2648 var player, iframe; 2649 $('.owl-item.active .uncode-video-container', carousel).each(function(index, val) { 2650 var content = $(val).html(); 2651 if (content == '') { 2652 var getCloned = $('.owl-item:not(.active) .uncode-video-container[data-id="'+$(this).attr('data-id')+'"]').children().first().clone(); 2653 $(val).append(getCloned); 2654 } 2655 if ($(this).attr('data-provider') == 'vimeo') { 2656 iframe = $(this).find('iframe'); 2657 player = $f(iframe[0]); 2658 player.api('play'); 2659 } else if ($(this).attr('data-provider') == 'youtube') { 2660 if (youtubePlayers[$(this).attr('data-id')] != undefined) youtubePlayers[$(this).attr('data-id')].playVideo(); 2661 } else { 2662 var player = $(this).find('video'); 2663 if (player.length) { 2664 $(this).find('video')[0].volume = 0; 2665 $(this).find('video')[0].play(); 2666 $(val).css('opacity', 1); 2667 } 2668 } 2669 }); 2670}; 2671 2672UNCODE.owlStopVideo = function(carousel) { 2673 $('.owl-item .uncode-video-container', carousel).each(function(index, val) { 2674 var player, iframe; 2675 if ($(this).attr('data-provider') == 'vimeo') { 2676 iframe = $(this).find('iframe'); 2677 player = $f(iframe[0]); 2678 player.api('pause'); 2679 } else if ($(this).attr('data-provider') == 'youtube') { 2680 if (youtubePlayers[$(this).attr('data-id')] != undefined) youtubePlayers[$(this).attr('data-id')].pauseVideo(); 2681 } else { 2682 var player = $(this).find('video'); 2683 if (player.length) { 2684 $(this).find('video')[0].volume = 0; 2685 $(this).find('video')[0].play(); 2686 } 2687 } 2688 }); 2689}; 2690 2691UNCODE.animations = function() { 2692 2693 var runWaypoints_TO, 2694 highlightComplexFunc = function($wrap){ 2695 2696 var $lines = $('.heading-line-wrap', $wrap), 2697 not_animate = false;
2698 2699 if ( $wrap.data('animate') === true ) { 2700 not_animate = true; 2701 } 2702 $lines.each(function(_key, _value){ 2703 var $line = $(_value), 2704 $inners = $('.split-word-inner', $line), 2705 $highlights = $('.heading-text-highlight-inner', $line); 2706 2707 if ( $('.heading-text-highlight-inner[data-animated="yes"]', $line).length ) { 2708 if ( not_animate ) { 2709 $highlights.each(function(h_key, high){ 2710 var $highlight = $(high); 2711 $highlight.css({ 2712 '-webkit-transition-duration': '0ms', 2713 '-moz-transition-duration': '0ms', 2714 '-o-transition-duration': '0ms', 2715 'transition-duration': '0ms', 2716 }); 2717 }); 2718 $highlights.removeAttr('data-animated'); 2719 } else { 2720 $inners.last().one('webkitAnimationEnd oanimationend mozAnimationEnd msAnimationEnd animationEnd', function(e) { 2721 var delay = 0; 2722 $highlights.each(function(h_key, high){ 2723 var $highlight = $(high), 2724 $split = $highlight.closest('.split-word'), 2725 $nextSplit = $split.next(), 2726 $next = $('.heading-text-highlight-inner', $nextSplit), 2727 countCh = $split.text().length; 2728 2729 $highlight.css({ 2730 '-webkit-transition-duration': (30 * countCh) + 'ms', 2731 '-moz-transition-duration': (30 * countCh) + 'ms', 2732 '-o-transition-duration': (30 * countCh) + 'ms', 2733 'transition-duration': (30 * countCh) + 'ms', 2734 }); 2735 2736 delay += (30 * countCh); 2737 2738 $next.css({ 2739 '-webkit-transition-delay': delay + 'ms', 2740 '-moz-transition-delay': delay + 'ms', 2741 '-o-transition-delay': delay + 'ms', 2742 'transition-delay': delay + 'ms', 2743 }); 2744 }); 2745 $highlights.removeAttr('data-animated'); 2746 if ( _key+1 === $lines.length ) { 2747 $wrap.data('animate', true); 2748 } 2749 }); 2750 } 2751 } 2752 }); 2753 }; 2754 2755 $.each($('.header-content-inner'), function(index, val) { 2756 var element = $(val), 2757 transition = ''; 2758 if (element.hasClass('top-t-bottom')) transition = 'top-t-bottom'; 2759 if (element.hasClass('bottom-t-top')) transition = 'bottom-t-top'; 2760 if (element.hasClass('left-t-right')) transition = 'left-t-right'; 2761 if (element.hasClass('right-t-left')) transition = 'right-t-left'; 2762 if (element.hasClass('zoom-in')) transition = 'zoom-in'; 2763 if (element.hasClass('zoom-out')) transition = 'zoom-out'; 2764 if (element.hasClass('alpha-anim')) transition = 'alpha-anim'; 2765 if (transition != '') { 2766 $(val).removeClass(transition); 2767 var container = element, 2768 containerDelay = container.attr('data-delay'), 2769 containerSpeed = container.attr('data-speed'), 2770 items = $('.header-title > *, .post-info', container); 2771 $.each(items, function(index, val) { 2772 var element = $(val), 2773 //speedAttr = (containerSpeed == undefined) ? containerSpeed : '', 2774 delayAttr = (containerDelay != undefined) ? containerDelay : 400; 2775 if (!element.hasClass('animate_when_almost_visible')) { 2776 delayAttr = Number(delayAttr) + (400 * index); 2777 if (containerSpeed != undefined) element.attr('data-speed', containerSpeed); 2778 element.addClass(transition + ' animate_when_almost_visible').attr('data-delay', delayAttr); 2779 } 2780 }); 2781 container.css('opacity', 1); 2782 } 2783 }); 2784 2785 window.waypoint_animation = function() { 2786 $.each($('.animate_when_almost_visible:not(.start_animation):not(.t-inside), .tmb-media .animate_when_almost_visible:not(.start_animation)'), function(index, val) { 2787 if ( $(val).hasClass('el-text-split') ) { 2788 return true; 2789 } 2790 if (UNCODE.isUnmodalOpen && !val.closest('#unmodal-content')) { 2791 return; 2792 } 2793 var run = true, 2794 $carousel = $(val).closest('.owl-carousel'), 2795 $first_item = $(val).closest('.owl-item[data-index="1"]'), 2796 $all_first = $('.owl-item[data-index="1"]', $carousel); 2797 if ( $carousel.length && ( ! ( $first_item.length && $first_item.attr('data-already-reached') !== 'true' ) && $carousel.attr('data-front-edited') !== 'true' ) ) { 2798 run = false; 2799 } 2800 if (run) { 2801 new Waypoint({ 2802 context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, 2803 element: val, 2804 handler: function() { 2805 var element = $(this.element), 2806 index = element.index(), 2807 delayAttr = element.attr('data-delay'); 2808 if (delayAttr == undefined) delayAttr = 0; 2809 requestTimeout(function() { 2810 if ( $first_item.length && $first_item.attr('data-already-reached') !== 'true' ) { 2811 $all_first.attr('data-already-reached', 'true'); 2812 } 2813 element.addClass('start_animation'); 2814 }, delayAttr); 2815 if (!UNCODE.isUnmodalOpen) { 2816 this.destroy(); 2817 } 2818 }, 2819 offset: UNCODE.isFullPage ? '100%' : '90%' 2820 }); 2821 } 2822 }); 2823 $.each($('.animate_inner_when_almost_visible'), function(index, val) { 2824 if (UNCODE.isUnmodalOpen && !val.closest('#unmodal-content')) { 2825 return; 2826 } 2827 var run = true, 2828 $carousel = $(val).closest('.owl-carousel'), 2829 $first_item = $(val).closest('.owl-item[data-index="1"]'), 2830 $all_first = $('.owl-item[data-index="1"]', $carousel); 2831 if ( $carousel.length && ( ! ( $first_item.length && $first_item.attr('data-already-reached') !== 'true' ) && $first_item.attr('data-front-edited') !== 'true' ) ) { 2832 run = false;
2833 } 2834 if (run) { 2835 new Waypoint({ 2836 context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, 2837 element: val, 2838 handler: function() { 2839 var $element = $(this.element), 2840 $childs = $('.animate_when_parent_almost_visible', $element); 2841 $childs.each(function(key,el){ 2842 var $child = $(el), 2843 delaySpeed = $child.attr('data-speed'), 2844 delayAttr = $child.attr('data-delay'), 2845 intervalAttr = $child.attr('data-interval'); 2846 if (delayAttr == undefined) { 2847 delayAttr = 50*key; 2848 } 2849 requestTimeout(function() { 2850 if ( $first_item.length && $first_item.attr('data-already-reached') !== 'true' ) { 2851 $all_first.attr('data-already-reached', 'true'); 2852 } 2853 $child.addClass('start_animation'); 2854 if ( $child.hasClass('anim-line-checker') ) { 2855 $child.on('webkitAnimationEnd oanimationend mozAnimationEnd msAnimationEnd animationEnd', function(e) { 2856 var $line = $child.closest('.heading-line-wrap'); 2857 }); 2858 } 2859 var $wrapText = $child.closest('.animate_inner_when_almost_visible'); 2860 highlightComplexFunc($wrapText); 2861 if ( $child.hasClass('anim-tot-checker') ) { 2862 $child.on('webkitAnimationEnd oanimationend mozAnimationEnd msAnimationEnd animationEnd', function(e) { 2863 if ( $child.hasClass('anim-tot-checker') ) { 2864 $wrapText.addClass('already-animated'); 2865 } 2866 }); 2867 } 2868 }, delayAttr ); 2869 }); 2870 $element.addClass('start_animation'); 2871 if (!UNCODE.isUnmodalOpen) { 2872 this.destroy(); 2873 } 2874 }, 2875 offset: UNCODE.isFullPage ? '100%' : '90%' 2876 }); 2877 } 2878 }); 2879 } 2880 2881 var runWaypoints = function(){ 2882 clearRequestTimeout(runWaypoints_TO); 2883 runWaypoints_TO = requestTimeout(function() { 2884 window.waypoint_animation(); 2885 }, 400); 2886 }; 2887 runWaypoints(); 2888 $( document.body ).on( 'uncode_waypoints', runWaypoints ); 2889 if ( $('body').hasClass('compose-mode') && typeof window.parent.vc !== 'undefined' ) { 2890 window.parent.vc.events.on( 'shortcodeView:updated', runWaypoints ); 2891 } 2892 2893 // var tmbImgAnimMove = function(){ 2894 2895 // var $wraps = $('.tmb.tmb-image-anim-move .t-inside').has('.t-background-cover, img:not(.avatar)'); 2896 // $wraps.each(function(){ 2897 // var $wrap = $(this), 2898 // $pushed = $('.t-entry-visual', $wrap), 2899 // $img = $('.t-background-cover, .t-entry-visual img:not(.avatar)', $wrap), 2900 // $tmb = $wrap.closest('.tmb'), 2901 // parentOffset, 2902 // wrapW, 2903 // wrapH; 2904 // $pushed.on('mousemove', function(e){ 2905 // parentOffset = $pushed.offset(); 2906 // wrapW = $pushed.width(); 2907 // wrapH = $pushed.height(); 2908 2909 // var pageX = ( ( e.pageX - parentOffset.left ) / wrapW ) * 100 + '% '; 2910 // var pageY = ( ( e.pageY - parentOffset.top ) / wrapH ) * 100 + '%'; 2911 2912 // $img.css({ 2913 // 'transform-origin': pageX + pageY 2914 // }); 2915 // }); 2916 // $wrap.on('mouseover', function(e){ 2917 // $img.css({ 2918 // 'transform': 'scale(1.05)', 2919 // }); 2920 // }).on('mouseleave', function(e){ 2921 // $img.css({ 2922 // 'transform': 'scale(1)', 2923 // }); 2924 // }); 2925 // }); 2926 2927 // }; 2928 2929 // tmbImgAnimMove(); 2930 // $( document.body ).on( 'isotope-shortcodeView-updated', tmbImgAnimMove ); 2931}; 2932 2933UNCODE.tapHover = function() { 2934 2935 var $el = $('html.touch .tmb:not(.tmb-no-double-tap) .t-entry-visual-cont > a'), //.length //html.touch a.btn 2936 elClass = "hover"; 2937 2938 $(window).on('click', function() { 2939 $el.removeClass(elClass); 2940 }); 2941 2942 $el.on("click", function(e) { // cambia click con touch start 'touchstart' 2943 e.stopPropagation(); 2944 var link = $(this); 2945 if ( ! link.hasClass(elClass)) { 2946 e.preventDefault(); 2947 link.addClass("hover"); 2948 $el.not(this).removeClass(elClass); 2949 return false; 2950 } 2951 }); 2952}; 2953 2954UNCODE.onePage = function(isMobile) { 2955 var current = 0, 2956 last = 0, 2957 lastScrollTop = 0, 2958 forceScroll = false, 2959 lastScrolled = 0, 2960 isSectionscroller = ($('.main-onepage').length) ? true : false, 2961 isOnePage = false, 2962 getOffset = function () { 2963 var calculateOffset = (($('.menu-sticky .menu-container:not(.menu-hide)').length && ($(window).width() > UNCODE.mediaQuery)) ? $('.menu-sticky .menu-container:not(.menu-hide)').outerHeight() : 0); 2964 return calculateOffset; 2965 } 2966 2967 // if ( UNCODE.isFullPage || UNCODE.isFullPageSnap ) 2968 // return false;
2969 2970 function init_onepage() { 2971 if (isSectionscroller && !isMobile && !$('body').hasClass('uncode-scroll-no-dots') && !UNCODE.isFullPageSnap) { 2972 $("<ul class='onepage-pagination'></ul>").prependTo("body"); 2973 } 2974 last = $('.onepage-pagination li').last().find('a').data('index'); 2975 $.each($('div[data-parent=true]'), function(index, val) { 2976 $(this).attr('data-section', index); 2977 if (isMobile) return; 2978 if (UNCODE.isUnmodalOpen && !val.closest('#unmodal-content')) { 2979 return; 2980 } 2981 var sectionDown = new Waypoint({ 2982 context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, 2983 element: val, 2984 handler: function(direction) { 2985 if (direction == 'down') { 2986 changeMenuActive(this.element, index); 2987 } 2988 }, 2989 offset: function() { 2990 return 5 + getOffset() 2991 } 2992 }); 2993 var sectionUp = new Waypoint({ 2994 context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, 2995 element: val, 2996 handler: function(direction) { 2997 if (direction == 'up') { 2998 changeMenuActive(this.element, index); 2999 } 3000 }, 3001 offset: function() { 3002 return -5 - getOffset() 3003 } 3004 }); 3005 3006 if (isSectionscroller) { 3007 var label; 3008 if ($(this).attr('data-label') != undefined) label = $(this).attr('data-label'); 3009 else label = ''; 3010 var getName = $(this).attr('data-name'); 3011 if (getName == undefined) getName = index; 3012 if (label != '') { 3013 isOnePage = true; 3014 label = '<span class="cd-label style-accent-bg border-accent-color">' + label + '</span>'; 3015 $('ul.onepage-pagination').append("<li><a class='one-dot-link' data-index='" + (index) + "' href='#" + (getName) + "'><span class='cd-dot-cont'><span class='cd-dot'></span></span>"+label+"</a></li>"); 3016 } 3017 } 3018 }); 3019 3020 if (isSectionscroller) { 3021 $.each($('ul.onepage-pagination li'), function(index, val) { 3022 var $this = $(val); 3023 $this.on('click', function(evt) { 3024 if ( $('body').hasClass('uncode-scroll-no-history') ) 3025 evt.preventDefault(); 3026 Waypoint.refreshAll(); 3027 var el = $('a', evt.currentTarget); 3028 current = lastScrolled = parseInt(el.attr('data-index')); 3029 lastScrolled += 1; 3030 scrollBody(current); 3031 }); 3032 }); 3033 } 3034 3035 var goToSection = parseInt((window.location.hash).replace(/[^\d.]/g, '')); 3036 if (isNaN(goToSection) && window.location.hash != undefined && window.location.hash != '' ) { 3037 goToSection = String(window.location.hash).replace(/^#/, ""); 3038 goToSection = Number($('[data-name=' + goToSection + ']').attr('data-section')); 3039 } 3040 3041 if (typeof goToSection === 'number' && !isNaN(goToSection)) { 3042 current = lastScrolled = goToSection; 3043 requestTimeout(function() { 3044 scrollBody(goToSection); 3045 }, 500); 3046 } 3047 3048 } 3049 3050 function changeMenuActive(section, index) { 3051 current = lastScrolled = parseInt($(section).attr('data-section')); 3052 if (isOnePage) { 3053 var newSection = $('.onepage-pagination li a[data-index=' + index + ']'); 3054 if (newSection.length) { 3055 $('ul.onepage-pagination li a').removeClass('is-selected'); 3056 newSection.addClass('is-selected'); 3057 } 3058 var getName = $('[data-section=' + index + ']').attr('data-name'); 3059 if (getName != undefined && getName !== '') { 3060 $.each($('.menu-container .menu-item > a, .widget_nav_menu .menu-smart .menu-item > a'), function(i, val) { 3061 var get_href = $(val).attr('href'); 3062 if (get_href != undefined && get_href.substring(get_href.indexOf('#')+1) == getName) { 3063 $(val).closest('ul').find('.active').removeClass('active'); 3064 $(val).parent().addClass('active'); 3065 } 3066 }); 3067 } 3068 } 3069 } 3070 3071 if (isOnePage) { 3072 $(window).on('scroll', function() { 3073 var bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop']; 3074 if (bodyTop == 0) { 3075 $('ul.onepage-pagination li a').removeClass('is-selected'); 3076 $('.onepage-pagination li a[data-index=0]').addClass('is-selected'); 3077 var getName = $('[data-section=0]').attr('data-name'); 3078 if (getName != undefined && getName !== '') { 3079 $.each($('.menu-container .menu-item > a'), function(i, val) { 3080 var get_href = $(val).attr('href'); 3081 if (get_href != undefined && get_href.substring(get_href.indexOf('#')+1) == getName) { 3082 $(val).closest('ul').find('.active').removeClass('active'); 3083 $(val).parent().addClass('active'); 3084 } 3085 }); 3086 } 3087 } else if ((window.innerHeight + bodyTop) >= $('.box-container').height()) { 3088 var lastSection = $('.onepage-pagination li a[data-index="' + last +'"]'); 3089 if (lastSection.length) { 3090 $('ul.onepage-pagination li a').removeClass('is-selected'); 3091 lastSection.addClass('is-selected'); 3092 } 3093 } 3094 }); 3095 } 3096 3097 var scrollBody = function(index) { 3098 $('ul.onepage-pagination li a').removeClass('is-selected'); 3099 $('.onepage-pagination li a[data-index=' + index + ']').addClass('is-selected'); 3100 3101 var getSection = $('[data-section=' + index + ']'), 3102 scrollTo; 3103 3104 if (getSection == undefined) return; 3105 3106 var body = $("html, body"), 3107 bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'], 3108 delta = bodyTop - ($('[data-section=' + index + ']').length ? $('[data-section=' + index + ']').offset().top : 0), 3109 getOffset = UNCODE.get_scroll_offset(index); 3110 if ( typeof getSection.offset() === 'undefined' ) 3111 return; 3112 scrollTo = getSection.offset().top; 3113 3114 3115 3116 var shrink = typeof $('.navbar-brand').data('padding-shrink') !== 'undefined' ? $('.navbar-brand').data('padding-shrink')*2 : 36; 3117 if ( $('.menu-sticky .menu-container:not(.menu-hide)').length && $('.menu-shrink').length ) { 3118 scrollTo += UNCODE.menuHeight - ( $('.navbar-brand').data('minheight') + shrink ); 3119 } 3120 3121 if ( $('.menu-sticky .menu-container:not(.menu-hide)').length && ! $('.menu-shrink').length ) { 3122 if ( index === 0 ) { 3123 scrollTo = 0; 3124 } else { 3125 scrollTo -= $('.menu-sticky .menu-container').outerHeight(); 3126 } 3127 } else { 3128 scrollTo -= getOffset; 3129 } 3130 3131 var scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(delta) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed; 3132 if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000; 3133 3134 if (index != 0) { 3135 UNCODE.scrolling = true; 3136 } 3137 3138 if (scrollSpeed == 0) { 3139 body.scrollTop((delta > 0) ? scrollTo - 0.1 : scrollTo); 3140 UNCODE.scrolling = false;
3141 } else { 3142 body.animate({ 3143 scrollTop: (delta > 0) ? scrollTo - 0.1 : scrollTo 3144 }, scrollSpeed, 'easeInOutQuad', function() { 3145 requestTimeout(function(){ 3146 UNCODE.scrolling = false; 3147 if (getOffset != UNCODE.get_scroll_offset(index)) { 3148 scrollBody(index); 3149 } 3150 }, 100); 3151 }); 3152 } 3153 3154 }; 3155 3156 init_onepage(); 3157}; 3158 3159UNCODE.stickyElements = function() { 3160 var isMobile_wide = UNCODE.isMobile && UNCODE.wwidth < 1024; 3161 if (!isMobile_wide) { 3162 3163 var calculateOffset = function(el) { 3164 var getRowPadding = (!$(el).hasClass('with-bg')) ? $(el).closest('.row-parent').css("padding-top") : 0, 3165 sideOffset = (getRowPadding != undefined && getRowPadding != 0) ? parseInt(getRowPadding.replace("px", "")) : 0, 3166 shrink = typeof $('.navbar-brand').data('padding-shrink') !== 'undefined' ? $('.navbar-brand').data('padding-shrink')*2 : 0; 3167 3168 sideOffset += UNCODE.bodyBorder; 3169 3170 if (UNCODE.adminBarHeight > 0) sideOffset += UNCODE.adminBarHeight; 3171 if ($('.menu-sticky .menu-container:not(.menu-hide)').length) { 3172 if ($('.menu-shrink').length) { 3173 sideOffset += parseFloat( $('.navbar-brand').data('minheight') ) + shrink; 3174 } else sideOffset += ($('body.hmenu-center').length ? $('#masthead .menu-container').outerHeight() : parseInt(UNCODE.menuMobileHeight)); 3175 } 3176 3177 return sideOffset; 3178 3179 }, 3180 3181 initStickyElement = function() { 3182 $.each($('.sticky-element'), function(index, element) { 3183 $(element).stick_in_parent({ 3184 sticky_class: 'is_stucked', 3185 offset_top: calculateOffset(element), 3186 bottoming: true, 3187 inner_scrolling: SiteParameters.sticky_elements === 'on' 3188 }); 3189 }); 3190 }; 3191 3192 requestTimeout(function() { 3193 if ($('.sticky-element').length) { 3194 3195 if ($(window).width() > UNCODE.mediaQuery) { 3196 initStickyElement(); 3197 } 3198 3199 $(window).on('resize', function(event) { 3200 if ($(window).width() > UNCODE.mediaQuery) { 3201 initStickyElement(); 3202 } else { 3203 $(".sticky-element").trigger("sticky_kit:detach"); 3204 } 3205 }); 3206 } 3207 }, 1000); 3208 } 3209}; 3210 3211UNCODE.twentytwenty = function() { 3212 3213 if (!$('.twentytwenty-container').length) return; 3214 3215 // jquery.event.move 3216 // 3217 // 1.3.6 3218 // 3219 // Stephen Band 3220 // 3221 // Triggers 'movestart', 'move' and 'moveend' events after 3222 // mousemoves following a mousedown cross a distance threshold, 3223 // similar to the native 'dragstart', 'drag' and 'dragend' events. 3224 // Move events are throttled to animation frames. Move event objects 3225 // have the properties: 3226 // 3227 // pageX: 3228 // pageY: Page coordinates of pointer. 3229 // startX: 3230 // startY: Page coordinates of pointer at movestart. 3231 // distX: 3232 // distY: Distance the pointer has moved since movestart. 3233 // deltaX: 3234 // deltaY: Distance the finger has moved since last event. 3235 // velocityX: 3236 // velocityY: Average velocity over last few events. 3237 3238 3239 (function (module) { 3240 if (typeof define === 'function' && define.amd) { 3241 // AMD. Register as an anonymous module. 3242 define(['jquery'], module); 3243 } else { 3244 // Browser globals 3245 module(jQuery); 3246 } 3247 })(function(jQuery, undefined){ 3248 3249 var // Number of pixels a pressed pointer travels before movestart 3250 // event is fired. 3251 threshold = 6, 3252 3253 add = jQuery.event.add, 3254 3255 remove = jQuery.event.remove, 3256 3257 // Just sugar, so we can have arguments in the same order as 3258 // add and remove. 3259 trigger = function(node, type, data) { 3260 jQuery.event.trigger(type, data, node); 3261 }, 3262 3263 // Shim for requestAnimationFrame, falling back to timer. See: 3264 // see http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 3265 requestFrame = (function(){ 3266 return ( 3267 window.requestAnimationFrame || 3268 window.webkitRequestAnimationFrame || 3269 window.mozRequestAnimationFrame || 3270 window.oRequestAnimationFrame || 3271 window.msRequestAnimationFrame || 3272 function(fn, element){ 3273 return window.setTimeout(function(){ 3274 fn(); 3275 }, 25); 3276 } 3277 ); 3278 })(), 3279 3280 ignoreTags = { 3281 textarea: true, 3282 input: true, 3283 select: true, 3284 button: true 3285 }, 3286 3287 mouseevents = { 3288 move: 'mousemove', 3289 cancel: 'mouseup dragstart', 3290 end: 'mouseup' 3291 }, 3292 3293 touchevents = { 3294 move: 'touchmove', 3295 cancel: 'touchend', 3296 end: 'touchend' 3297 }; 3298 3299 3300 // Constructors 3301 3302 function Timer(fn){ 3303 var callback = fn, 3304 active = false, 3305 running = false;
3306 3307 function trigger(time) { 3308 if (active){ 3309 callback(); 3310 requestFrame(trigger); 3311 running = true; 3312 active = false; 3313 } 3314 else { 3315 running = false; 3316 } 3317 } 3318 3319 this.kick = function(fn) { 3320 active = true; 3321 if (!running) { trigger(); } 3322 }; 3323 3324 this.end = function(fn) { 3325 var cb = callback; 3326 3327 if (!fn) { return; } 3328 3329 // If the timer is not running, simply call the end callback. 3330 if (!running) { 3331 fn(); 3332 } 3333 // If the timer is running, and has been kicked lately, then 3334 // queue up the current callback and the end callback, otherwise 3335 // just the end callback. 3336 else { 3337 callback = active ? 3338 function(){ cb(); fn(); } : 3339 fn ; 3340 3341 active = true; 3342 } 3343 }; 3344 } 3345 3346 3347 // Functions 3348 3349 function returnTrue() { 3350 return true; 3351 } 3352 3353 function returnFalse() { 3354 return false; 3355 } 3356 3357 function preventDefault(e) { 3358 e.preventDefault(); 3359 } 3360 3361 function preventIgnoreTags(e) { 3362 // Don't prevent interaction with form elements. 3363 if (ignoreTags[ e.target.tagName.toLowerCase() ]) { return; } 3364 3365 e.preventDefault(); 3366 } 3367 3368 function isLeftButton(e) { 3369 // Ignore mousedowns on any button other than the left (or primary) 3370 // mouse button, or when a modifier key is pressed. 3371 return (e.which === 1 && !e.ctrlKey && !e.altKey); 3372 } 3373 3374 function identifiedTouch(touchList, id) { 3375 var i, l; 3376 3377 if (touchList.identifiedTouch) { 3378 return touchList.identifiedTouch(id); 3379 } 3380 3381 // touchList.identifiedTouch() does not exist in 3382 // webkit yet… we must do the search ourselves... 3383 3384 i = -1; 3385 l = touchList.length; 3386 3387 while (++i < l) { 3388 if (touchList[i].identifier === id) { 3389 return touchList[i]; 3390 } 3391 } 3392 } 3393 3394 function changedTouch(e, event) { 3395 var touch = identifiedTouch(e.changedTouches, event.identifier); 3396 3397 // This isn't the touch you're looking for. 3398 if (!touch) { return; } 3399 3400 // Chrome Android (at least) includes touches that have not 3401 // changed in e.changedTouches. That's a bit annoying. Check 3402 // that this touch has changed. 3403 if (touch.pageX === event.pageX && touch.pageY === event.pageY) { return; } 3404 3405 return touch; 3406 } 3407 3408 3409 // Handlers that decide when the first movestart is triggered 3410 3411 function mousedown(e){ 3412 var data; 3413 3414 if (!isLeftButton(e)) { return; } 3415 3416 data = { 3417 target: e.target, 3418 startX: e.pageX, 3419 startY: e.pageY, 3420 timeStamp: e.timeStamp 3421 }; 3422 3423 add(document, mouseevents.move, mousemove, data); 3424 add(document, mouseevents.cancel, mouseend, data); 3425 } 3426 3427 function mousemove(e){ 3428 var data = e.data; 3429 3430 checkThreshold(e, data, e, removeMouse); 3431 } 3432 3433 function mouseend(e) { 3434 removeMouse(); 3435 } 3436 3437 function removeMouse() { 3438 remove(document, mouseevents.move, mousemove); 3439 remove(document, mouseevents.cancel, mouseend); 3440 } 3441 3442 function touchstart(e) { 3443 var touch, template; 3444 3445 // Don't get in the way of interaction with form elements. 3446 if (ignoreTags[ e.target.tagName.toLowerCase() ]) { return; } 3447 3448 touch = e.changedTouches[0]; 3449 3450 // iOS live updates the touch objects whereas Android gives us copies. 3451 // That means we can't trust the touchstart object to stay the same, 3452 // so we must copy the data. This object acts as a template for 3453 // movestart, move and moveend event objects. 3454 template = { 3455 target: touch.target, 3456 startX: touch.pageX, 3457 startY: touch.pageY, 3458 timeStamp: e.timeStamp, 3459 identifier: touch.identifier 3460 }; 3461 3462 // Use the touch identifier as a namespace, so that we can later 3463 // remove handlers pertaining only to this touch. 3464 add(document, touchevents.move + '.' + touch.identifier, touchmove, template); 3465 add(document, touchevents.cancel + '.' + touch.identifier, touchend, template); 3466 } 3467 3468 function touchmove(e){ 3469 var data = e.data, 3470 touch = changedTouch(e, data); 3471 3472 if (!touch) { return; } 3473 3474 checkThreshold(e, data, touch, removeTouch); 3475 } 3476 3477 function touchend(e) { 3478 var template = e.data, 3479 touch = identifiedTouch(e.changedTouches, template.identifier); 3480 3481 if (!touch) { return; } 3482 3483 removeTouch(template.identifier); 3484 } 3485 3486 function removeTouch(identifier) { 3487 remove(document, '.' + identifier, touchmove); 3488 remove(document, '.' + identifier, touchend); 3489 } 3490 3491 3492 // Logic for deciding when to trigger a movestart. 3493 3494 function checkThreshold(e, template, touch, fn) { 3495 var distX = touch.pageX - template.startX, 3496 distY = touch.pageY - template.startY; 3497
3498 // Do nothing if the threshold has not been crossed. 3499 if ((distX * distX) + (distY * distY) < (threshold * threshold)) { return; } 3500 3501 triggerStart(e, template, touch, distX, distY, fn); 3502 } 3503 3504 function handled() { 3505 // this._handled should return false once, and after return true. 3506 this._handled = returnTrue; 3507 return false; 3508 } 3509 3510 function flagAsHandled(e) { 3511 e._handled(); 3512 } 3513 3514 function triggerStart(e, template, touch, distX, distY, fn) { 3515 var node = template.target, 3516 touches, time; 3517 3518 touches = e.targetTouches; 3519 time = e.timeStamp - template.timeStamp; 3520 3521 // Create a movestart object with some special properties that 3522 // are passed only to the movestart handlers. 3523 template.type = 'movestart'; 3524 template.distX = distX; 3525 template.distY = distY; 3526 template.deltaX = distX; 3527 template.deltaY = distY; 3528 template.pageX = touch.pageX; 3529 template.pageY = touch.pageY; 3530 template.velocityX = distX / time; 3531 template.velocityY = distY / time; 3532 template.targetTouches = touches; 3533 template.finger = touches ? 3534 touches.length : 3535 1 ; 3536 3537 // The _handled method is fired to tell the default movestart 3538 // handler that one of the move events is bound. 3539 template._handled = handled; 3540 3541 // Pass the touchmove event so it can be prevented if or when 3542 // movestart is handled. 3543 template._preventTouchmoveDefault = function() { 3544 e.preventDefault(); 3545 }; 3546 3547 // Trigger the movestart event. 3548 trigger(template.target, template); 3549 3550 // Unbind handlers that tracked the touch or mouse up till now. 3551 fn(template.identifier); 3552 } 3553 3554 3555 // Handlers that control what happens following a movestart 3556 3557 function activeMousemove(e) { 3558 var timer = e.data.timer; 3559 3560 e.data.touch = e; 3561 e.data.timeStamp = e.timeStamp; 3562 timer.kick(); 3563 } 3564 3565 function activeMouseend(e) { 3566 var event = e.data.event, 3567 timer = e.data.timer; 3568 3569 removeActiveMouse(); 3570 3571 endEvent(event, timer, function() { 3572 // Unbind the click suppressor, waiting until after mouseup 3573 // has been handled. 3574 setTimeout(function(){ 3575 remove(event.target, 'click', returnFalse); 3576 }, 0); 3577 }); 3578 } 3579 3580 function removeActiveMouse(event) { 3581 remove(document, mouseevents.move, activeMousemove); 3582 remove(document, mouseevents.end, activeMouseend); 3583 } 3584 3585 function activeTouchmove(e) { 3586 var event = e.data.event, 3587 timer = e.data.timer, 3588 touch = changedTouch(e, event); 3589 3590 if (!touch) { return; } 3591 3592 // Stop the interface from gesturing 3593 e.preventDefault(); 3594 3595 event.targetTouches = e.targetTouches; 3596 e.data.touch = touch; 3597 e.data.timeStamp = e.timeStamp; 3598 timer.kick(); 3599 } 3600 3601 function activeTouchend(e) { 3602 var event = e.data.event, 3603 timer = e.data.timer, 3604 touch = identifiedTouch(e.changedTouches, event.identifier); 3605 3606 // This isn't the touch you're looking for. 3607 if (!touch) { return; } 3608 3609 removeActiveTouch(event); 3610 endEvent(event, timer); 3611 } 3612 3613 function removeActiveTouch(event) { 3614 remove(document, '.' + event.identifier, activeTouchmove); 3615 remove(document, '.' + event.identifier, activeTouchend); 3616 } 3617 3618 3619 // Logic for triggering move and moveend events 3620 3621 function updateEvent(event, touch, timeStamp, timer) { 3622 var time = timeStamp - event.timeStamp; 3623 3624 event.type = 'move'; 3625 event.distX = touch.pageX - event.startX; 3626 event.distY = touch.pageY - event.startY; 3627 event.deltaX = touch.pageX - event.pageX; 3628 event.deltaY = touch.pageY - event.pageY; 3629 3630 // Average the velocity of the last few events using a decay 3631 // curve to even out spurious jumps in values. 3632 event.velocityX = 0.3 * event.velocityX + 0.7 * event.deltaX / time; 3633 event.velocityY = 0.3 * event.velocityY + 0.7 * event.deltaY / time; 3634 event.pageX = touch.pageX; 3635 event.pageY = touch.pageY; 3636 } 3637 3638 function endEvent(event, timer, fn) { 3639 timer.end(function(){ 3640 event.type = 'moveend'; 3641 3642 trigger(event.target, event); 3643 3644 return fn && fn(); 3645 }); 3646 } 3647 3648 3649 // jQuery special event definition 3650 3651 function setup(data, namespaces, eventHandle) { 3652 // Stop the node from being dragged 3653 //add(this, 'dragstart.move drag.move', preventDefault); 3654 3655 // Prevent text selection and touch interface scrolling 3656 //add(this, 'mousedown.move', preventIgnoreTags); 3657 3658 // Tell movestart default handler that we've handled this 3659 add(this, 'movestart.move', flagAsHandled); 3660 3661 // Don't bind to the DOM. For speed. 3662 return true; 3663 } 3664 3665 function teardown(namespaces) { 3666 remove(this, 'dragstart drag', preventDefault); 3667 remove(this, 'mousedown touchstart', preventIgnoreTags); 3668 remove(this, 'movestart', flagAsHandled); 3669 3670 // Don't bind to the DOM. For speed. 3671 return true; 3672 } 3673 3674 function addMethod(handleObj) { 3675 // We're not interested in preventing defaults for handlers that 3676 // come from internal move or moveend bindings 3677 if (handleObj.namespace === "move" || handleObj.namespace === "moveend") { 3678 return; 3679 } 3680 3681 // Stop the node from being dragged 3682 add(this, 'dragstart.' + handleObj.guid + ' drag.' + handleObj.guid, preventDefault, undefined, handleObj.selector); 3683 3684 // Prevent text selection and touch interface scrolling 3685 add(this, 'mousedown.' + handleObj.guid, preventIgnoreTags, undefined, handleObj.selector); 3686 } 3687 3688 function removeMethod(handleObj) { 3689 if (handleObj.namespace === "move" || handleObj.namespace === "moveend") { 3690 return; 3691 } 3692 3693 remove(this, 'dragstart.' + handleObj.guid + ' drag.' + handleObj.guid); 3694 remove(this, 'mousedown.' + handleObj.guid); 3695 } 3696 3697 jQuery.event.special.movestart = { 3698 setup: setup, 3699 teardown: teardown, 3700 add: addMethod, 3701 remove: removeMethod, 3702 3703 _default: function(e) { 3704 var event, data; 3705 3706 // If no move events were bound to any ancestors of this 3707 // target, high tail it out of here. 3708 if (!e._handled()) { return; } 3709 3710 function update(time) { 3711 updateEvent(event, data.touch, data.timeStamp); 3712 trigger(e.target, event); 3713 } 3714 3715 event = { 3716 target: e.target, 3717 startX: e.startX, 3718 startY: e.startY, 3719 pageX: e.pageX, 3720 pageY: e.pageY, 3721 distX: e.distX, 3722 distY: e.distY, 3723 deltaX: e.deltaX, 3724 deltaY: e.deltaY, 3725 velocityX: e.velocityX, 3726 velocityY: e.velocityY, 3727 timeStamp: e.timeStamp, 3728 identifier: e.identifier, 3729 targetTouches: e.targetTouches, 3730 finger: e.finger 3731 }; 3732 3733 data = { 3734 event: event, 3735 timer: new Timer(update), 3736 touch: undefined, 3737 timeStamp: undefined 3738 }; 3739 3740 if (e.identifier === undefined) { 3741 // We're dealing with a mouse 3742 // Stop clicks from propagating during a move 3743 add(e.target, 'click', returnFalse); 3744 add(document, mouseevents.move, activeMousemove, data); 3745 add(document, mouseevents.end, activeMouseend, data); 3746 } 3747 else { 3748 // We're dealing with a touch. Stop touchmove doing 3749 // anything defaulty. 3750 e._preventTouchmoveDefault(); 3751 add(document, touchevents.move + '.' + e.identifier, activeTouchmove, data); 3752 add(document, touchevents.end + '.' + e.identifier, activeTouchend, data); 3753 } 3754 } 3755 }; 3756 3757 jQuery.event.special.move = { 3758 setup: function() { 3759 // Bind a noop to movestart. Why? It's the movestart 3760 // setup that decides whether other move events are fired. 3761 add(this, 'movestart.move', jQuery.noop); 3762 }, 3763 3764 teardown: function() { 3765 remove(this, 'movestart.move', jQuery.noop); 3766 } 3767 }; 3768 3769 jQuery.event.special.moveend = { 3770 setup: function() { 3771 // Bind a noop to movestart. Why? It's the movestart 3772 // setup that decides whether other move events are fired. 3773 add(this, 'movestart.moveend', jQuery.noop); 3774 }, 3775 3776 teardown: function() { 3777 remove(this, 'movestart.moveend', jQuery.noop); 3778 } 3779 }; 3780 3781 add(document, 'mousedown.move', mousedown); 3782 add(document, 'touchstart.move', touchstart); 3783 3784 // Make jQuery copy touch event properties over to the jQuery event 3785 // object, if they are not already listed. But only do the ones we 3786 // really need. IE7/8 do not have Array#indexOf(), but nor do they 3787 // have touch events, so let's assume we can ignore them. 3788 if (typeof Array.prototype.indexOf === 'function') { 3789 (function(jQuery, undefined){ 3790 var props = ["changedTouches", "targetTouches"], 3791 l = props.length; 3792 3793 while (l--) { 3794 if (jQuery.event.props.indexOf(props[l]) === -1) { 3795 jQuery.event.props.push(props[l]); 3796 } 3797 } 3798 })(jQuery); 3799 }; 3800 }); 3801 3802 $.fn.twentytwenty = function(options) { 3803 var options = $.extend({default_offset_pct: 0.5, orientation: 'horizontal'}, options); 3804 return this.each(function() { 3805 3806 var sliderPct = options.default_offset_pct; 3807 var container = $(this); 3808 var sliderOrientation = options.orientation; 3809 var beforeDirection = (sliderOrientation === 'vertical') ? 'down' : 'left'; 3810 var afterDirection = (sliderOrientation === 'vertical') ? 'up' : 'right'; 3811 3812 container.wrap("<div class='twentytwenty-wrapper twentytwenty-" + sliderOrientation + "'></div>"); 3813 container.append("<div class='twentytwenty-overlay'></div>"); 3814 var beforeImg = container.find("img:first"); 3815 var afterImg = container.find("img:last"); 3816 container.append("<div class='twentytwenty-handle style-accent-bg border-accent-color'></div>"); 3817 var slider = container.find(".twentytwenty-handle"); 3818 slider.append("<span class='twentytwenty-" + beforeDirection + "-arrow'></span>"); 3819 slider.append("<span class='twentytwenty-" + afterDirection + "-arrow'></span>"); 3820 container.addClass("twentytwenty-container"); 3821 beforeImg.addClass("twentytwenty-before"); 3822 afterImg.addClass("twentytwenty-after"); 3823
3824 var overlay = container.find(".twentytwenty-overlay"); 3825 overlay.append("<div class='twentytwenty-before-label'></div>"); 3826 overlay.append("<div class='twentytwenty-after-label'></div>"); 3827 3828 var calcOffset = function(dimensionPct) { 3829 var w = beforeImg.width(); 3830 var h = beforeImg.height(); 3831 return { 3832 w: w+"px", 3833 h: h+"px", 3834 cw: (dimensionPct*w)+"px", 3835 ch: (dimensionPct*h)+"px" 3836 }; 3837 }; 3838 3839 var adjustContainer = function(offset) { 3840 if (sliderOrientation === 'vertical') { 3841 beforeImg.css("clip", "rect(0,"+offset.w+","+offset.ch+",0)"); 3842 } 3843 else { 3844 beforeImg.css("clip", "rect(0,"+offset.cw+","+offset.h+",0)"); 3845 } 3846 container.css("height", offset.h); 3847 }; 3848 3849 var adjustSlider = function(pct) { 3850 var offset = calcOffset(pct); 3851 slider.css((sliderOrientation==="vertical") ? "top" : "left", (sliderOrientation==="vertical") ? offset.ch : offset.cw); 3852 adjustContainer(offset); 3853 } 3854 3855 $(window).on("resize.twentytwenty", function(e) { 3856 adjustSlider(sliderPct); 3857 }); 3858 3859 var offsetX = 0, 3860 offsetY = 0, 3861 imgWidth = 0, 3862 imgHeight = 0; 3863 3864 slider.on("movestart", function(e) { 3865 if (((e.distX > e.distY && e.distX < -e.distY) || (e.distX < e.distY && e.distX > -e.distY)) && sliderOrientation !== 'vertical') { 3866 e.preventDefault(); 3867 } 3868 else if (((e.distX < e.distY && e.distX < -e.distY) || (e.distX > e.distY && e.distX > -e.distY)) && sliderOrientation === 'vertical') { 3869 e.preventDefault(); 3870 } 3871 container.addClass("active"); 3872 offsetX = container.offset().left; 3873 offsetY = container.offset().top; 3874 imgWidth = beforeImg.width(); 3875 imgHeight = beforeImg.height(); 3876 }); 3877 3878 slider.on("moveend", function(e) { 3879 container.removeClass("active"); 3880 }); 3881 3882 slider.on("move", function(e) { 3883 if (container.hasClass("active")) { 3884 sliderPct = (sliderOrientation === 'vertical') ? (e.pageY-offsetY)/imgHeight : (e.pageX-offsetX)/imgWidth; 3885 if (sliderPct < 0) { 3886 sliderPct = 0; 3887 } 3888 if (sliderPct > 1) { 3889 sliderPct = 1; 3890 } 3891 adjustSlider(sliderPct); 3892 } 3893 }); 3894 3895 container.find("img").on("mousedown", function(event) { 3896 event.preventDefault(); 3897 }); 3898 3899 $(window).trigger("resize.twentytwenty"); 3900 }); 3901 }; 3902 3903 $('.twentytwenty-container').twentytwenty(); 3904 3905} 3906 3907UNCODE.justifiedGallery = function() { 3908 3909 var breakPointMe = function( val ) { 3910 val = parseInt( val ); 3911 if ( isNaN(val) ) { 3912 return false; 3913 } 3914 if ( val >= 1500 ) { 3915 return 1; 3916 } else if ( val < 1500 && val >= 960 ) { 3917 return 2; 3918 } else if ( val < 960 && val >= 570 ) { 3919 return 3; 3920 } else if ( val < 570 ) { 3921 return 4; 3922 } 3923 } 3924 3925 var gutterByBreakpoint = function( bp, gutter ) { 3926 var ret; 3927 switch(gutter) { 3928 case 'no-gutter': 3929 ret = 0; 3930 break; 3931 case 'px-gutter': 3932 ret = 1; 3933 break; 3934 case 'half-gutter': 3935 ret = 18; 3936 break; 3937 case 'double-gutter': 3938 switch(bp) { 3939 case 3: 3940 case 4: 3941 ret = 36; 3942 break; 3943 default: 3944 ret = 72; 3945 break; 3946 } 3947 break; 3948 case 'triple-gutter': 3949 switch(bp) { 3950 case 3: 3951 case 4: 3952 ret = 36; 3953 break; 3954 default: 3955 ret = 108; 3956 break; 3957 } 3958 break; 3959 case 'quad-gutter': 3960 switch(bp) { 3961 case 2: 3962 ret = 108; 3963 break; 3964 case 3: 3965 ret = 72; 3966 break; 3967 case 4: 3968 ret = 36; 3969 break; 3970 default: 3971 ret = 144; 3972 break; 3973 } 3974 break; 3975 default: 3976 ret = 36;//single-gutter 3977 } 3978 return ret; 3979 } 3980 3981 if ($('.justified-layout').length > 0) { 3982 var justifiedContainersArray = [], 3983 typeGridArray = [], 3984 layoutGridArray = [], 3985 transitionDuration = [], 3986 $filterItems = [], 3987 $filters = $('.justified-system .isotope-filters'), 3988 $itemSelector = '.tmb', 3989 $items, 3990 itemMargin, 3991 correctionFactor = 0, 3992 firstLoad = true, 3993 isOriginLeft = $('body').hasClass('rtl') ? false : true, 3994 prevW = breakPointMe(UNCODE.wwidth); 3995 $('[class*="justified-container"]').each(function() { 3996 var isoData = $(this).data(); 3997 transitionDuration.push($('.t-inside.animate_when_almost_visible', this).length > 0 ? 0 : '0.5s'); 3998 if (isoData.type == 'metro') typeGridArray.push(true);
3999 else typeGridArray.push(false); 4000 if (isoData.layout !== undefined) layoutGridArray.push(isoData.layout); 4001 else layoutGridArray.push('justified'); 4002 justifiedContainersArray.push($(this)); 4003 }); 4004 var init_justifiedGallery = function() { 4005 for (var i = 0, len = justifiedContainersArray.length; i < len; i++) { 4006 var justifiedSystem = $(justifiedContainersArray[i]).closest($('.justified-system')), 4007 justifiedId = justifiedSystem.attr('id'), 4008 $layoutMode = layoutGridArray[i], 4009 gutter = $(justifiedContainersArray[i]).data('gutter'), 4010 rowHeight = $(justifiedContainersArray[i]).data('row-height'), 4011 maxRowHeight = $(justifiedContainersArray[i]).data('max-row-height'), 4012 lastRow = $(justifiedContainersArray[i]).data('last-row'), 4013 margins; 4014 4015 rowHeight = typeof rowHeight === 'undefined' || rowHeight === '' ? 250 : parseFloat(rowHeight); 4016 maxRowHeight = typeof maxRowHeight === 'undefined' || maxRowHeight === '' ? false : parseFloat(maxRowHeight); 4017 lastRow = typeof lastRow === 'undefined' || lastRow === '' ? 'nojustify' : lastRow; 4018 4019 margins = gutterByBreakpoint(prevW, gutter); 4020 4021 $(justifiedContainersArray[i]).justifiedGallery({ 4022 rowHeight: rowHeight, 4023 maxRowHeight: maxRowHeight, 4024 margins: margins, 4025 cssAnimation: true, 4026 lastRow: lastRow, 4027 waitThumbnailsLoad: false 4028 }).one('jg.complete', function(){ onLayout($(this), 0); } ); 4029 } 4030 }, 4031 onLayout = function(justifiedObj, startIndex) { 4032 justifiedObj.css('opacity', 1); 4033 justifiedObj.closest('.justified-system').find('.justified-footer').css('opacity', 1); 4034 $('.tmb', justifiedObj).addClass('justified-object-loaded'); 4035 4036 requestTimeout(function() { 4037 window.dispatchEvent(UNCODE.boxEvent); 4038 UNCODE.adaptive(); 4039 $(justifiedObj).find('audio,video').each(function() { 4040 $(this).mediaelementplayer({ 4041 pauseOtherPlayers: false, 4042 }); 4043 }); 4044 if ($(justifiedObj).find('.nested-carousel').length) { 4045 UNCODE.carousel($(justifiedObj).find('.nested-carousel')); 4046 requestTimeout(function() { 4047 boxAnimation($('.tmb', justifiedObj), startIndex, true, justifiedObj); 4048 justifiedObj.addClass('justified-gallery-finished') 4049 Waypoint.refreshAll(); 4050 }, 200); 4051 } else { 4052 requestTimeout(function() { 4053 boxAnimation($('.tmb', justifiedObj), startIndex, true, justifiedObj); 4054 justifiedObj.addClass('justified-gallery-finished') 4055 Waypoint.refreshAll(); 4056 }, 300); 4057 } 4058 }, 100); 4059 4060 }, 4061 boxAnimation = function(items, startIndex, sequential, container) { 4062 var $allItems = items.length - startIndex, 4063 showed = 0, 4064 index = 0; 4065 if (container.closest('.owl-item').length == 1) return false; 4066 $.each(items, function(index, val) { 4067 var elInner = $('> .t-inside', val); 4068 if (UNCODE.isUnmodalOpen && !val.closest('#unmodal-content')) { 4069 return; 4070 } 4071 if (val[0]) val = val[0]; 4072 if (elInner.hasClass('animate_when_almost_visible') && !elInner.hasClass('force-anim')) { 4073 new Waypoint({ 4074 context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window, 4075 element: val, 4076 handler: function() { 4077 var element = $('> .t-inside', this.element), 4078 parent = $(this.element), 4079 currentIndex = parent.index(); 4080 var delay = (!sequential) ? index : ((startIndex !== 0) ? currentIndex - $allItems : currentIndex), 4081 delayAttr = parseInt(element.attr('data-delay')); 4082 if (isNaN(delayAttr)) delayAttr = 100; 4083 delay -= showed; 4084 var objTimeout = requestTimeout(function() { 4085 element.removeClass('zoom-reverse').addClass('start_animation'); 4086 showed = parent.index(); 4087 }, delay * delayAttr); 4088 parent.data('objTimeout', objTimeout); 4089 if (!UNCODE.isUnmodalOpen) { 4090 this.destroy(); 4091 } 4092 }, 4093 offset: '100%' 4094 }) 4095 } else { 4096 elInner.removeClass('animate_when_almost_visible'); 4097 $(val).addClass('no-waypoint-animation'); 4098 /*if (elInner.hasClass('force-anim')) { 4099 elInner.addClass('start_animation'); 4100 } else { 4101 elInner.css('opacity', 1); 4102 }*/ 4103 } 4104 index++; 4105 }); 4106 }; 4107 $filters.on('click', 'a[data-filter]', function(evt) { 4108 var $filter = $(this), 4109 filterContainer = $filter.closest('.isotope-filters'), 4110 filterValue = $filter.attr('data-filter'), 4111 container = $filter.closest('.justified-system').find($('.justified-layout')), 4112 lastRow = container.data('last-row'), 4113 transitionDuration = 0,
4114 delay = 300, 4115 filterItems = []; 4116 4117 lastRow = typeof lastRow === 'undefined' || lastRow === '' ? 'nojustify' : lastRow; 4118 4119 if (!$filter.hasClass('active')) { 4120 /** Scroll top with filtering */ 4121 if (filterContainer.hasClass('filter-scroll')) { 4122 var calc_scroll = container.closest('.uncol').offset().top, 4123 getFilterSpanPadding = (!filterContainer.hasClass('with-bg')) ? $('.filter-show-all span', filterContainer).css("padding-bottom") : 0, 4124 getFilterPadding = (!filterContainer.hasClass('with-bg')) ? $('.filter-show-all span a', filterContainer).css("padding-bottom") : 0, 4125 filterOffset = (getFilterSpanPadding != undefined && getFilterSpanPadding != 0) ? parseInt(getFilterSpanPadding.replace("px", "")) : 0; 4126 filterOffset += (getFilterPadding != undefined && getFilterPadding != 0) ? parseInt(getFilterPadding.replace("px", "")) : 0; 4127 4128 calc_scroll -= filterOffset - 1; 4129 calc_scroll -= UNCODE.get_scroll_offset(); 4130 4131 var bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'], 4132 delta = bodyTop - calc_scroll, 4133 scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(delta) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed; 4134 if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000; 4135 4136 if ( !UNCODE.isFullPage ) { 4137 if (scrollSpeed == 0) { 4138 $('html, body').scrollTop(calc_scroll); 4139 UNCODE.scrolling = false; 4140 } else { 4141 $('html, body').animate({ 4142 scrollTop: calc_scroll 4143 },{ 4144 easing: 'easeInOutQuad', 4145 duration: scrollSpeed, 4146 complete: function(){ 4147 UNCODE.scrolling = false; 4148 } 4149 }); 4150 } 4151 } 4152 } 4153 if (filterValue !== undefined) { 4154 $.each($('> .tmb > .t-inside', container), function(index, val) { 4155 var parent = $(val).parent(), 4156 objTimeout = parent.data('objTimeout'); 4157 if (objTimeout) { 4158 $(val).removeClass('zoom-reverse'); 4159 clearRequestTimeout(objTimeout); 4160 } 4161 if (transitionDuration == 0) { 4162 if ($(val).hasClass('animate_when_almost_visible')) { 4163 $(val).addClass('zoom-reverse').removeClass('start_animation'); 4164 } else { 4165 $(val).addClass('animate_when_almost_visible zoom-reverse zoom-anim force-anim'); 4166 } 4167 } 4168 }); 4169 4170 requestTimeout(function() { 4171 var $block, 4172 selector, 4173 lightboxElements, 4174 $boxes; 4175 4176 if ( filterValue !== '' && filterValue !== '*' ) { 4177 $('[data-lbox^=ilightbox]', container).addClass('lb-disabled'); 4178 selector = '.' + filterValue; 4179 $.each($(selector, container), function(index, block) { 4180 lightboxElements = $('[data-lbox^=ilightbox]', block); 4181 if (lightboxElements.length) { 4182 lightboxElements.removeClass('lb-disabled'); 4183 container.data('lbox', $(lightboxElements[0]).data('lbox')); 4184 } 4185 filterItems.push(block); 4186 }); 4187 container.justifiedGallery({ 4188 filter: selector, 4189 lastRow: 'nojustify' 4190 }); 4191 } else { 4192 container.justifiedGallery({ 4193 filter: false, 4194 lastRow: lastRow 4195 }); 4196 $('[data-lbox^=ilightbox]', $block).removeClass('lb-disabled'); 4197 filterItems = $('> .tmb', container); 4198 } 4199 4200 $('.t-inside.zoom-reverse', container).removeClass('zoom-reverse'); 4201 4202 var getLightbox = UNCODE.lightboxArray[container.data('lbox')]; 4203 if (typeof getLightbox === 'object') getLightbox.refresh(); 4204 4205 if (transitionDuration == 0) { 4206 requestTimeout(function() { 4207 boxAnimation(filterItems, 0, false, container); 4208 }, 100); 4209 } 4210 requestTimeout(function() { 4211 Waypoint.refreshAll(); 4212 }, 2000); 4213 4214 }, delay); 4215 } else { 4216 $.each($('> .tmb > .t-inside', container), function(index, val) { 4217 var parent = $(val).parent(), 4218 objTimeout = parent.data('objTimeout'); 4219 if (objTimeout) { 4220 $(val).removeClass('zoom-reverse').removeClass('start_animation') 4221 clearRequestTimeout(objTimeout); 4222 } 4223 if (transitionDuration == 0) { 4224 if ($(val).hasClass('animate_when_almost_visible')) { 4225 $(val).addClass('zoom-reverse').removeClass('start_animation'); 4226 } else { 4227 $(val).addClass('animate_when_almost_visible zoom-reverse zoom-anim force-anim'); 4228 } 4229 } 4230 }); 4231 container.parent().addClass('justified-loading'); 4232 } 4233 } 4234 evt.preventDefault(); 4235 }); 4236 4237 $filters.each(function(i, buttonGroup) { 4238 var $buttonGroup = $(buttonGroup); 4239 $buttonGroup.on('click', 'a', function() { 4240 $buttonGroup.find('.active').removeClass('active'); 4241 $(this).addClass('active'); 4242 }); 4243 }); 4244 window.addEventListener('boxResized', function(e) { 4245 if ( prevW !== breakPointMe(UNCODE.wwidth) ) { 4246 prevW = breakPointMe(UNCODE.wwidth); 4247 $.each($('.justified-layout'), function(index, val) { 4248 var gutter = $(this).data('gutter'), 4249 margins = gutterByBreakpoint( prevW, gutter); 4250 $(this).justifiedGallery({ 4251 margins: margins 4252 }); 4253 $(this).find('.mejs-video,.mejs-audio').each(function() { 4254 $(this).trigger('resize'); 4255 }); 4256 }); 4257 } 4258 }, false); 4259 4260 init_justifiedGallery(); 4261 }; 4262}; 4263 4264UNCODE.preventDoubleTransition = function() { 4265 $('.sticky-element .animate_when_almost_visible').each(function(){ 4266 var $el = $(this).one('webkitAnimationEnd mozAnimationEnd oAnimationEnd animationEnd', function(e){ 4267 $el.addClass('do_not_reanimate'); 4268 }); 4269 }); 4270}; 4271UNCODE.checkScrollForTabs = function(){ 4272 var goToSection = window.location.hash.replace('#', ''), 4273 $index; 4274 4275 goToSection = goToSection.replace(/[^-A-Za-z0-9+&@#/%?=~_]/g, ""); 4276 goToSection = encodeURIComponent(goToSection); 4277 $index = $('[data-id="' + goToSection + '"]').closest('.uncode-tabs'); 4278 4279 $index.attr('data-parent', 'parent-' + goToSection); 4280 4281 if (window.location.hash != undefined && window.location.hash != '') { 4282 requestTimeout(function() { 4283 scrollBody('parent-' + goToSection); 4284 }, 500); 4285 } 4286 4287 $('.page-body a[href*="#"]').not('[data-tab-history]').not('.scroll-top').click(function(e) { 4288 var hash = (e.currentTarget).hash, 4289 index = (e.currentTarget).closest('.uncode-tabs'); 4290 if ( $('.uncode-tabs a[href="' + hash + '"][data-tab-history]').length ) { 4291 $('a[href="' + hash + '"][data-tab-history]').click(); 4292 scrollBody(index); 4293 } 4294 }); 4295 4296 var scrollBody = function(index) { 4297 4298 var getSection = $('a[href="' + index + '"][data-tab-history]'), 4299 scrollTo; 4300 4301 if ( ! getSection.length ) { 4302 getSection = $('div[data-parent="' + index + '"]'); 4303 } 4304 4305 if (typeof getSection === 'undefined' || ! getSection.length ) { 4306 return; 4307 } 4308 4309 var body = $("html, body"), 4310 bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'], 4311 delta = bodyTop - (getSection.length ? getSection.offset().top : 0), 4312 getOffset = UNCODE.get_scroll_offset(); 4313 if ( typeof getSection.offset() === 'undefined' ) 4314 return; 4315 scrollTo = getSection.offset().top - 27; 4316 scrollTo -= getOffset; 4317 4318 var scrollSpeed = (SiteParameters.constant_scroll == 'on') ? Math.abs(delta) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed; 4319 if (scrollSpeed < 1000 && SiteParameters.constant_scroll == 'on') scrollSpeed = 1000; 4320 4321 if (index != 0) { 4322 UNCODE.scrolling = true; 4323 } 4324 4325 if (scrollSpeed == 0) { 4326 body.scrollTop((delta > 0) ? scrollTo - 0.1 : scrollTo); 4327 UNCODE.scrolling = false;
4328 } else { 4329 body.animate({ 4330 scrollTop: (delta > 0) ? scrollTo - 0.1 : scrollTo 4331 }, scrollSpeed, 'easeInOutQuad', function() { 4332 requestTimeout(function() { 4333 UNCODE.scrolling = false; 4334 if (getOffset != UNCODE.get_scroll_offset()) { 4335 scrollBody(index); 4336 } 4337 }, 100); 4338 }); 4339 } 4340 4341 }; 4342}; 4343 4344UNCODE.printScreen = function() { 4345 var inlineMediaStyle = null, 4346 setResize; 4347 4348 function changeMediaStyle() { 4349 clearRequestTimeout(setResize); 4350 setResize = requestTimeout(function(){ 4351 var $head = document.getElementsByTagName('head')[0], 4352 $newStyle = document.createElement('style'), 4353 winW = window.innerWidth, 4354 printH = window.innerHeight; 4355 4356 $newStyle.setAttribute('type', 'text/css'); 4357 $newStyle.setAttribute('media', 'print'); 4358 $newStyle.appendChild(document.createTextNode('@page { size: ' + winW + 'px ' + printH + 'px; margin: 0; }')); 4359 4360 if (inlineMediaStyle != null) { 4361 $head.replaceChild($newStyle, inlineMediaStyle) 4362 } else { 4363 $head.appendChild($newStyle); 4364 } 4365 inlineMediaStyle = $newStyle; 4366 }, 1000); 4367 } 4368 4369 changeMediaStyle(); 4370 window.addEventListener('resize', changeMediaStyle); 4371}; 4372 4373UNCODE.fullPage = function() { 4374 if ( ( !UNCODE.isFullPage && !UNCODE.isFullPageSnap ) || SiteParameters.is_frontend_editor ) { 4375 $('body').removeClass('uncode-fullpage').removeClass('uncode-fullpage-slide').removeClass('fp-waiting'); 4376 return false; 4377 } else { 4378 requestTimeout(function() { 4379 window.scrollTo(0, 0); 4380 }, 10); 4381 } 4382 4383 var $masthead = $('#masthead'), 4384 $logo = $('#logo-container-mobile'), 4385 $logolink = $('[data-minheight]', $logo), 4386 logoMinScale = $logolink.data('minheight'), 4387 logoMaxScale = $('[data-maxheight]', $logo).data('maxheight'), 4388 $mainWrapper = $('.main-wrapper')[0], 4389 $container = $('.main-container .post-content'), 4390 $mobileMenuWrapper = $('.menu-wrapper'), 4391 mobMenuPos, 4392 $rows = $container.find('.vc_row[data-parent]').addClass('uncode-scroll-lock fp-auto-height'), 4393 $header = $('#page-header').addClass('uncode-scroll-lock fp-auto-height'), 4394 headerName = $('.vc_row[data-name]', $header).attr('data-name'), 4395 headerLabel = $('.vc_row[data-label]', $header).attr('data-label'), 4396 headerWithOpacity = $('.header-scroll-opacity', $header).length, 4397 menuHidden = ! $('body').hasClass('vmenu') && $('body').hasClass('uncode-fp-menu-hide') ? true : false, 4398 menuHeight = $masthead.hasClass('menu-transparent') || menuHidden ? 0 : UNCODE.menuHeight, 4399 footerAdd = ( $('body').hasClass('hmenu') && $('body').hasClass('uncode-fp-menu-shrink') && !$masthead.hasClass('menu-transparent') ) ? -18 : 0, 4400 $footer = $('#colophon').addClass('uncode-scroll-lock fp-auto-height'), 4401 $scrollTop = $('.scroll-top'), 4402 scrollBar = true, 4403 effect, 4404 animationEndTimeOut, 4405 fp_anim_time = 900, 4406 fp_easing = 'cubic-bezier(0.37, 0.31, 0.2, 0.85)', 4407 is_scrolling = false, 4408 dataNames = [], 4409 is_first = true, 4410 no_history = $('body').hasClass('uncode-scroll-no-history'), 4411 theres_footer = true; 4412 4413 if ( $('> div', $footer).outerHeight() < 2 || !$footer.length ) { 4414 $('> div', $footer).each(function(index, el){ 4415 if ( $(el).outerHeight() < 2 ) 4416 theres_footer = false; 4417 else 4418 theres_footer = true; 4419 }); 4420 } 4421 4422 if ( !$footer.length ) 4423 theres_footer = false; 4424 4425 if ( !UNCODE.isFullPageSnap ) { 4426 /*if ( theres_footer ) 4427 $footer.css({ marginTop: ( menuHeight + footerAdd + UNCODE.bodyBorder ) * -1 })*/ 4428 4429 if ( $('body').hasClass('uncode-fullpage-zoom') ) 4430 effect = 'scaleDown'; 4431 else if ( $('body').hasClass('uncode-fullpage-parallax') ) 4432 effect = 'moveparallax'; 4433 else 4434 effect = 'movecurtain'; 4435 } 4436 4437 if ( $('body').hasClass('uncode-fullpage-trid') ) 4438 fp_anim_time = fp_anim_time*2; 4439 4440 if ( $header.length ) { 4441 if ( headerName !== '' ) 4442 $header.attr('data-name', headerName); 4443 if ( headerLabel !== '' ) 4444 $header.attr('data-label', headerLabel); 4445 $container.prepend($header); 4446 } 4447 if ( theres_footer ) { 4448 $container.append($footer); 4449 $footer.attr('data-anchor', SiteParameters.slide_footer).data('name', SiteParameters.slide_footer); 4450 $('aside.widget ul', $footer).addClass('no-list'); 4451 } 4452 4453 var $all = $rows.add($header); 4454 4455 if ( theres_footer ) 4456 $all = $all.add($footer); 4457 4458 $all.each(function(index, row) { 4459 if( index === 0 ) 4460 $(row).addClass('uncode-scroll-active'); 4461 }); 4462 4463 if ( !UNCODE.isMobile && !$('body').hasClass('uncode-scroll-no-dots') ) 4464 $("<ul class='onepage-pagination'></ul>").prependTo("body"); 4465 4466 $all.each(function(index, val) { 4467 var getName = $(val).data('name'), 4468 label; 4469 4470 if (typeof getName == 'undefined' || getName == 'undefined') 4471 getName = SiteParameters.slide_name + '-' + index; 4472 4473 //if ( dataNames.includes(getName) ) { 4474 if ( dataNames.indexOf(getName) > 0 ) { 4475 getName += '_' + index; 4476 $(val).data('name', getName); 4477 } 4478 4479 dataNames.push(getName); 4480 4481 $(val).attr('data-section', (index+1)).attr('data-anchor', getName); 4482 4483 if (typeof $(val).attr('data-label') !== 'undefined') 4484 label = $(val).attr('data-label'); 4485 else label = ''; 4486 4487 if ( $(val).is($footer) ) 4488 return; 4489 4490 if (label != '' ) { 4491 label = '<span class="cd-label style-accent-bg border-accent-color">' + label + '</span>'; 4492 $('ul.onepage-pagination').append("<li><a class='one-dot-link' data-index='" + (index) + "' href='#" + (getName) + "'><span class='cd-dot-cont'><span class='cd-dot'></span></span>"+label+"</a></li>"); 4493 } else if ( label == '' && $('body').hasClass('uncode-empty-dots') ) { 4494 $('ul.onepage-pagination').append("<li><a class='one-dot-link' data-index='" + (index) + "' href='#" + (getName) + "'><span class='cd-dot-cont'><span class='cd-dot'></span></span></a></li>"); 4495 } 4496 4497 }); 4498 4499 var checkVisible = function( el, off ) { 4500 if (typeof jQuery === "function" && el instanceof jQuery) { 4501 el = el[0]; 4502 } 4503 4504 off = typeof off=='undefined' ? 50 : off; 4505 4506 var rect = el.getBoundingClientRect(); 4507 4508 return ( 4509 ( 4510 ( rect.top >= 0 && (rect.top + off) <= (window.innerHeight || document.documentElement.clientHeight) ) || 4511 ( rect.bottom >= off && (rect.bottom) <= (window.innerHeight || document.documentElement.clientHeight) ) || 4512 ( rect.top <= 0 && (rect.bottom) >= (window.innerHeight || document.documentElement.clientHeight) ) 4513 ) 4514 ); 4515 }; 4516 4517 var animationEndAction = function( index, nextIndex ) { 4518 var $currentSlide = $('.uncode-scroll-lock[data-section="' + index + '"]', $container), 4519 $nextSlide = $('.uncode-scroll-lock[data-section="' + nextIndex + '"]', $container), 4520 player, iframe; 4521 4522 if ( !$nextSlide.is($footer) ) { 4523 $('.no-scrolloverflow').removeClass('no-scrolloverflow'); 4524 } 4525 4526 if ( !UNCODE.isFullPageSnap ) { 4527 activateKBurns( nextIndex ); 4528 } 4529 4530 $('body:not(.uncode-fullpage-zoom) .background-video-shortcode, .uncode-video-container.video', $currentSlide).each(function(index, val) { 4531 if ($(this).attr('data-provider') == 'vimeo') { 4532 iframe = $(this).find('iframe'); 4533 player = $f(iframe[0]); 4534 player.api('pause'); 4535 } else if ($(this).attr('data-provider') == 'youtube') { 4536 if (youtubePlayers[$(this).attr('data-id')] != undefined) youtubePlayers[$(this).attr('data-id')].pauseVideo(); 4537 } else { 4538 if ($(this).is('video')) { 4539 $(this)[0].volume = 0; 4540 $(this)[0].pause(); 4541 } 4542 } 4543 }); 4544 4545 if ( ! UNCODE.isMobile && headerWithOpacity ) { 4546 if ( $nextSlide.is($header) ) 4547 $header.removeClass('header-scrolled'); 4548 } 4549 4550 var $otherEl = $('.uncode-scroll-lock:not(.hidden-scroll)', $container).not($nextSlide); 4551 $otherEl.each(function(){ 4552 var $otherThis = $(this), 4553 $bgwrapperOther = $('.background-inner', $otherThis); 4554 if ( !checkVisible($otherThis) ) 4555 $bgwrapperOther.removeClass('uncode-kburns').removeClass('uncode-zoomout'); 4556 4557 }); 4558 4559 if ( !checkVisible($currentSlide) ) { 4560 $currentSlide.removeClass('uncode-scroll-visible'); 4561 var currentScroll = $('.fp-scrollable', $currentSlide).data('iscrollInstance'); 4562 if ( typeof currentScroll != 'undefined' && !UNCODE.isFullPageSnap )
4563 currentScroll.scrollTo(0, 0, 0); 4564 } 4565 4566 clearRequestTimeout(animationEndTimeOut); 4567 animationEndTimeOut = requestTimeout(function(){ 4568 Waypoint.refreshAll(); 4569 $( document.body ).trigger('uncode_waypoints'); 4570 var eventFP = new CustomEvent('fp-slide-changed'); 4571 window.dispatchEvent(eventFP); 4572 is_scrolling = false; 4573 4574 if ( is_first ) { 4575 $('ul.onepage-pagination a').removeClass('is-selected'); 4576 $('ul.onepage-pagination a[data-index="' + (nextIndex-1) + '"]').addClass('is-selected'); 4577 is_first = false; 4578 } 4579 4580 }, 500); 4581 }; 4582 4583 var postLeaveActions = function( nextIndex ){ 4584 if ( menuHidden && ! UNCODE.isMobile ) 4585 return false; 4586 4587 var $el = $('.uncode-scroll-lock[data-section="' + nextIndex + '"]', $container), 4588 $cols = $('.uncol', $el), 4589 anchor = $el.data('anchor'); 4590 4591 if ( ! UNCODE.isFullPageSnap ) { 4592 $.each($cols, function(index, val){ 4593 if ( $(val).hasClass('style-light') ){ 4594 $masthead.removeClass('style-dark-override').addClass('style-light-override'); 4595 return false; 4596 } else if ( $(val).hasClass('style-dark') ) { 4597 $masthead.removeClass('style-light-override').addClass('style-dark-override'); 4598 return false; 4599 } 4600 }); 4601 } 4602 4603 if ( typeof anchor !== 'undefined' && anchor !== '' && $('.menu-item > a[href*="#' + anchor + '"]' ).length ) { 4604 $('.menu-item' ).removeClass('active'); 4605 $('.menu-item > a[href*="#' + anchor + '"]' ).closest('.menu-item').addClass('active'); 4606 } 4607 4608 if ( !UNCODE.isFullPageSnap ) { 4609 activateBackWash( nextIndex ); 4610 } 4611 }; 4612 4613 var activateBackWash = function( nextIndex ){ 4614 var $el = $('.uncode-scroll-lock[data-section="' + nextIndex + '"]', $container), 4615 $bgwrapper; 4616 4617 if ( $el.length ) { 4618 if ( $el.hasClass('with-zoomout') ) { 4619 $bgwrapper = $('.background-inner:nth-child(1)', $el); 4620 } else if ( $('.with-zoomout', $el).length ) { 4621 $bgwrapper = $('.with-zoomout .background-inner:nth-child(1)', $el); 4622 } else { 4623 return false; 4624 } 4625 } else { 4626 return false; 4627 } 4628 4629 $bgwrapper.addClass('uncode-zoomout'); 4630 4631 }; 4632 4633 var activateKBurns = function( nextIndex ){ 4634 var $el = $('.uncode-scroll-lock[data-section="' + nextIndex + '"]', $container), 4635 $bgwrapper; 4636 4637 if ( $el.length ) { 4638 if ( $el.hasClass('with-kburns') ) { 4639 $bgwrapper = $('.background-inner:nth-child(1)', $el); 4640 } else if ( $('.with-kburns', $el).length ) { 4641 $bgwrapper = $('.with-kburns .background-inner:nth-child(1)', $el); 4642 } else { 4643 return false; 4644 } 4645 } else { 4646 return false; 4647 } 4648 4649 $bgwrapper.addClass('uncode-kburns'); 4650 4651 }; 4652 4653 var activateParallax = function( nextIndex, direction ){ 4654 4655 var $el = $('.uncode-scroll-lock[data-section="' + nextIndex + '"]', $container), 4656 $cell = $('.fp-tableCell', $el), 4657 animationEnd = 'webkitAnimationEnd animationend', 4658 cellAnim; 4659 4660 switch( direction ) { 4661 case 'up': 4662 cellAnim = 'moveFromTopInner'; 4663 break; 4664 default: 4665 cellAnim = 'moveFromBottomInner'; 4666 } 4667 4668 $cell.css({ 4669 'animation-name': cellAnim, 4670 'animation-duration': fp_anim_time + 'ms', 4671 'animation-delay': '', 4672 'animation-timing-function': fp_easing, 4673 'animation-fill-mode': 'both', 4674 }).off(animationEnd) 4675 .on(animationEnd, function(event) { 4676 if ( event.originalEvent.animationName === cellAnim ) { 4677 $cell 4678 .css({ 4679 'animation-name': '', 4680 'animation-duration': '', 4681 'animation-delay': '', 4682 'animation-timing-function': '', 4683 'animation-fill-mode': '', 4684 }); 4685 } 4686 }); 4687 }; 4688 4689 var scrollHashes = function(){ 4690 var hash = window.location.hash.replace('#', '').split('/'), 4691 hashInd; 4692 if ( hash[0] !== '' && hash[0] !== SiteParameters.slide_footer ) { 4693 if ( $('.uncode-scroll-lock[data-anchor="' + hash[0] + '"]').length ) { 4694 hashInd = $('.uncode-scroll-lock[data-anchor="' + hash[0] + '"]').index('[data-anchor]'); 4695 $.fn.fullpage.moveTo(hashInd+1); 4696 } 4697 } else if( hash[0] === '' ) { 4698 $.fn.fullpage.moveTo(1); 4699 } 4700 }; 4701 4702 var hideMenu = function( index, nextIndex ){ 4703 if ( $('body').hasClass('vmenu') || UNCODE.isFullPageSnap || !$('body').hasClass('uncode-fp-menu-hide') ) 4704 return false; 4705 4706 var hMenu = UNCODE.menuHeight, 4707 transTime = hMenu * 2; 4708 4709 if ( index === 1 && nextIndex > 1 ) { 4710 hMenu = hMenu * -1; 4711 } else if ( index !== 1 && nextIndex === 1 ) { 4712 hMenu = 0; 4713 } else { 4714 return false;
4715 } 4716 4717 $masthead.css({ 4718 '-webkit-transform': 'translate3d(0, ' + hMenu + 'px, 0)', 4719 'transform': 'translate3d(0, ' + hMenu + 'px, 0)', 4720 '-webkit-transition': 'transform 0.5s ease-in-out', 4721 'transition': 'transform 0.5s ease-in-out' 4722 }); 4723 }; 4724 4725 var shrinkMenu = function( index, nextIndex ){ 4726 if ( $('body').hasClass('vmenu') || !$('body').hasClass('uncode-fp-menu-shrink') ) 4727 return false; 4728 4729 if ( index === 1 && nextIndex > 1 ) { 4730 $logo.addClass('shrinked'); 4731 $('div', $logo).each(function(index, val){ 4732 $(val).css({ 4733 'height': logoMinScale, 4734 'line-height': logoMinScale 4735 }); 4736 if ($(val).hasClass('text-logo')) { 4737 $(val).css({ 4738 'font-size': logoMinScale + 'px' 4739 }); 4740 } 4741 }); 4742 requestTimeout(function() { 4743 UNCODE.menuMobileHeight = $masthead.outerHeight(); 4744 }, 300); 4745 } else if ( index !== 1 && nextIndex === 1 ) { 4746 $logo.removeClass('shrinked'); 4747 $('div', $logo).each(function(index, val){ 4748 $(val).css({ 4749 'height': logoMaxScale, 4750 'line-height': logoMaxScale 4751 }); 4752 if ($(val).hasClass('text-logo')) { 4753 $(val).css({ 4754 'font-size': logoMaxScale + 'px' 4755 }); 4756 } 4757 }); 4758 requestTimeout(function() { 4759 UNCODE.menuMobileHeight = $masthead.outerHeight(); 4760 }, 300); 4761 } else { 4762 return false; 4763 } 4764 4765 }; 4766 4767 var anchorLink = function(){ 4768 4769 $container.add('.menu-item').find('a[href*="#"]').click(function(e) { 4770 var $this = $(e.currentTarget), 4771 hash = e.currentTarget.href.split('#'), 4772 current = window.location.href.split('#'), 4773 ind, 4774 currentMenuOpened = UNCODE.menuOpened, 4775 go = false; 4776 4777 var hash_url = hash[0].replace(/\/?$/, '/'), 4778 current_url = current[0].replace(/\/?$/, '/'); 4779 4780 if ( ( hash_url == current_url || hash_url == '' ) && hash[1] != '' ) { 4781 hash = '#'+hash[1]; 4782 e.preventDefault(); 4783 go = true; 4784 } 4785 4786 if ( go ) { 4787 4788 if ( $(hash).length ) { 4789 ind = $(hash).closest('.fp-section').index(); 4790 } else { 4791 hash = hash.slice(1); 4792 ind = $('.fp-section[data-anchor="' + hash + '"]').index('.fp-section'); 4793 } 4794 4795 if ( typeof $this.attr('data-filter') !== 'undefined' && $this.attr('data-filter') != '' ) 4796 ind = $this.closest('.fp-section').index(); 4797 4798 UNCODE.menuOpened = false; 4799 4800 $.fn.fullpage.moveTo(ind+1); 4801 4802 UNCODE.menuOpened = currentMenuOpened; 4803 if (UNCODE.menuOpened) { 4804 if (UNCODE.wwidth < UNCODE.mediaQuery) window.dispatchEvent(UNCODE.menuMobileTriggerEvent); 4805 else $('.mmb-container-overlay .overlay-close').trigger('click'); 4806 } 4807 4808 } 4809 4810 }); 4811 4812 $('.header-scrolldown').on('click', function(event) { 4813 event.preventDefault(); 4814 var scrollDown = $(this), 4815 ind = scrollDown.closest('.fp-section').index(); 4816 4817 $.fn.fullpage.moveTo(ind+2); 4818 }); 4819 4820 var anchor = $('.fp-section.active').data('anchor'); 4821 4822 if ( typeof anchor !== 'undefined' && anchor !== '' && $('.menu-item > a[href="#' + anchor + '"]' ).length ) { 4823 $('.menu-item').removeClass('active'); 4824 $('.menu-item > a[href="#' + anchor + '"]' ).closest('.menu-item').addClass('active'); 4825 } 4826 4827 }; 4828 4829 var slideLeave = function( index, nextIndex, direction ) { 4830 var $currentSlide = $('.uncode-scroll-lock[data-section="' + index + '"]', $container), 4831 $nextSlide = $('.uncode-scroll-lock[data-section="' + nextIndex + '"]', $container), 4832 animationEnd = 'webkitAnimationEnd animationend', 4833 transitionEnd = 'webkitTransitionEnd transitionend', 4834 animOut = effect != 'scaleDown' ? effect + direction : effect, 4835 animIn, 4836 animInDelay = effect == 'scaleDown' ? 0 : 0, 4837 isFooter = false, 4838 isFooterNext = false, 4839 isHeader = false, 4840 isHeaderNext = false, 4841 containerOff = $container.offset().top, 4842 footerH = $footer.outerHeight(), 4843 timeout, 4844 dataHash = $nextSlide.attr('data-anchor'), 4845 player, iframe, 4846 footerCoeff; 4847 switch( direction ) { 4848 case 'up': 4849 animIn = 'moveFromTop'; 4850 break; 4851 default: 4852 animIn = 'moveFromBottom'; 4853 } 4854 4855 if ( $('body').hasClass('uncode-fullpage-trid') ) { 4856 animOut = animIn + 'trid'; 4857 animIn = animOut + 'In'; 4858 } else if ( UNCODE.isFullPageSnap ) { 4859 animIn = animOut = 'none'; 4860 } 4861 4862 hideMenu(index, nextIndex); 4863 shrinkMenu(index, nextIndex); 4864 4865 $('.uncode-fullpage-zoom .background-video-shortcode, .uncode-video-container.video', $currentSlide).each(function(index, val) { 4866 if ($(this).attr('data-provider') == 'vimeo') { 4867 iframe = $(this).find('iframe'); 4868 player = $f(iframe[0]); 4869 player.api('pause'); 4870 } else if ($(this).attr('data-provider') == 'youtube') { 4871 if (youtubePlayers[$(this).attr('data-id')] != undefined) youtubePlayers[$(this).attr('data-id')].pauseVideo(); 4872 } else { 4873 if ($(this).is('video')) { 4874 $(this)[0].volume = 0; 4875 $(this)[0].pause(); 4876 } 4877 } 4878 }); 4879 4880 $('.background-video-shortcode, .uncode-video-container.video', $nextSlide).each(function(index, val) { 4881 if ($(this).attr('data-provider') == 'vimeo') { 4882 iframe = $(this).find('iframe'); 4883 player = $f(iframe[0]); 4884 player.api('play'); 4885 } else if ($(this).attr('data-provider') == 'youtube') { 4886 if (youtubePlayers[$(this).attr('data-id')] != undefined) youtubePlayers[$(this).attr('data-id')].playVideo(); 4887 } else { 4888 if ($(this).is('video')) { 4889 $(this)[0].volume = 0; 4890 $(this)[0].play(); 4891 } 4892 } 4893 }); 4894 4895 if ( $currentSlide.is($footer) ) 4896 isFooter = true; 4897 4898 if ( $nextSlide.is($footer) ) 4899 isFooterNext = true; 4900 4901 // if ( typeof dataHash && dataHash && !no_history && dataHash != SiteParameters.slide_footer ) 4902 // window.location.hash = '#' + dataHash; 4903 4904 if ( ! UNCODE.isMobile && headerWithOpacity ) { 4905 if ( $currentSlide.is($header) ) 4906 $header.addClass('header-scrolled'); 4907 } 4908 4909 footerCoeff = footerH; 4910 4911 if ( UNCODE.isFullPageSnap ) { 4912 postLeaveActions( nextIndex ); 4913 activateBackWash( nextIndex ); 4914 activateKBurns( nextIndex ); 4915 requestTimeout(function(){ 4916 animationEndAction( index, nextIndex ); 4917 }, fp_anim_time+150); 4918 } else { 4919 if ( isFooterNext ) { 4920 4921 var $iscrollWrapper = $currentSlide.find('.fp-scrollable'); 4922 $iscrollWrapper.addClass('no-scrolloverflow'); 4923 4924 $nextSlide 4925 .add($currentSlide) 4926 .addClass('uncode-scroll-front') 4927 .addClass('uncode-scroll-active') 4928 .addClass('uncode-scroll-visible'); 4929 $container.css({ 4930 '-webkit-transform': 'translate3d(0, -' + ( footerCoeff ) + 'px, 0)', 4931 'transform': 'translate3d(0, -' + ( footerCoeff ) + 'px, 0)', 4932 '-webkit-transition': 'transform ' + (( footerCoeff )*2) + 'ms ' + fp_easing, 4933 'transition': 'transform ' + (( footerCoeff )*2) + 'ms ' + fp_easing, 4934 }).off(transitionEnd) 4935 .one(transitionEnd, function(){ 4936 animationEndAction( index, nextIndex ); 4937 }); 4938 4939 } else if ( isFooter ) { 4940 4941 $('.uncode-scroll-lock[data-section="' + (index-1) + '"]', $container) // so it is always the section above the footer to be animated first 4942 .add($currentSlide) 4943 .addClass('uncode-scroll-front') 4944 .addClass('uncode-scroll-active') 4945 .addClass('uncode-scroll-visible'); 4946 $container.css({ 4947 '-webkit-transform': 'translate3d(0, 0, 0)', 4948 'transform': 'translate3d(0, 0, 0)', 4949 '-webkit-transition': 'transform ' + (( footerCoeff )*2) + 'ms ' + fp_easing, 4950 'transition': 'transform ' + (( footerCoeff )*2) + 'ms ' + fp_easing, 4951 }) 4952 .one(transitionEnd, function(){ 4953 if ( nextIndex !== index-1 ) { // if a bullet triggered a slide different than the one above the footer 4954 clearRequestTimeout(timeout); 4955 timeout = requestTimeout(function(){ 4956 $.fn.fullpage.moveTo(nextIndex); 4957 slideLeave( index-1, nextIndex, 'up' ); 4958 $container.off(transitionEnd); 4959 }, 50); 4960 } 4961 animationEndAction( index, nextIndex ); 4962 }); 4963 4964 } else { 4965 4966 postLeaveActions( nextIndex ); 4967 4968 if ( !$('body').hasClass('uncode-fullpage-trid') ) 4969 activateParallax( nextIndex, direction ); 4970 4971 var $outBg = $('.background-wrapper', $currentSlide); 4972 4973 $nextSlide 4974 .addClass('uncode-scroll-front') 4975 .addClass('uncode-scroll-active') 4976 .addClass('uncode-scroll-visible') 4977 .addClass('uncode-scroll-animating-in') 4978 .css({ 4979 'z-index':4, 4980 'animation-name': animIn, 4981 'animation-duration': fp_anim_time + 'ms', 4982 'animation-delay': '', 4983 'animation-timing-function': fp_easing, 4984 'animation-fill-mode': 'both', 4985 'transition': 'initial', 4986 }).off(animationEnd) 4987 .on(animationEnd, function(event) { 4988 if ( event.originalEvent.animationName === animIn ) { 4989 $(this) 4990 .addClass('uncode-scroll-already') 4991 .removeClass('uncode-scroll-front') 4992 .removeClass('uncode-scroll-animating-in') 4993 .css({ 4994 'animation-name': '', 4995 'animation-duration': '', 4996 'animation-delay': '', 4997 'animation-timing-function': '', 4998 'animation-fill-mode': '', 4999 'transition': 'initial', 5000 }); 5001 5002 $currentSlide 5003 .removeClass('uncode-scroll-active') 5004 .add($outBg) 5005 .css({ 5006 'animation-name': '', 5007 'animation-duration': '', 5008 'animation-delay': '', 5009 'animation-timing-function': '', 5010 'animation-fill-mode': '', 5011 'transition': 'initial', 5012 }); 5013 5014 animationEndAction( index, nextIndex ); 5015 5016 } 5017 5018 if ( nextIndex > 1 ) 5019 $('body').addClass('window-scrolled'); 5020 else 5021 $('body').removeClass('window-scrolled'); 5022 }); 5023 5024 $currentSlide 5025 .addClass('uncode-scroll-animating-out') 5026 .removeClass('uncode-scroll-front') 5027 .css({ 5028 'z-index':'1', 5029 'animation-name': animOut, 5030 'animation-duration': fp_anim_time + 'ms', 5031 'animation-delay': '', 5032 'animation-timing-function': fp_easing, 5033 'animation-fill-mode': 'both', 5034 'transition': 'initial', 5035 'will-change': 'auto' 5036 }).off(animationEnd) 5037 .on(animationEnd, function(event) { 5038 if ( event.originalEvent.animationName === animOut ) { 5039 $currentSlide.removeClass('uncode-scroll-animating-out'); 5040 } 5041 }); 5042 5043 if ( $('body').hasClass('uncode-fp-opacity') ) { 5044 $currentSlide.find('> div').css({ 5045 'animation-name': 'opacityout', 5046 'animation-duration': fp_anim_time + 'ms', 5047 'animation-delay': '', 5048 'animation-timing-function': fp_easing, 5049 'animation-fill-mode': 'both', 5050 'transition': 'initial', 5051 }).off(animationEnd) 5052 .on(animationEnd, function(event) { 5053 if ( event.originalEvent.animationName === 'opacityout' ) { 5054 $(event.currentTarget).css({ 5055 'animation-name': '', 5056 'animation-duration': '', 5057 'animation-delay': '', 5058 'animation-timing-function': '', 5059 'animation-fill-mode': '', 5060 'transition': '', 5061 }); 5062 } 5063 }); 5064 } 5065 } 5066 } 5067 5068 $('.scroll-top').on('click', function(e){ 5069 $.fn.fullpage.moveTo(1); 5070 return false;
5071 }); 5072 5073 }; 5074 5075 var init_fullPage = function(mode){ 5076 5077 // if ( typeof mode !== 'undefined' && mode === 'mobile' ) { 5078 // scrollBar = false; 5079 // } 5080 5081 var checkFPeffects; 5082 5083 $container.fullpage({ 5084 sectionSelector: '.uncode-scroll-lock', 5085 scrollOverflow: true, 5086 scrollOverflowOptions: { 5087 click: false, 5088 preventDefaultException: { tagName:/.*/ } 5089 }, 5090 navigation: false, 5091 scrollBar: scrollBar, 5092 scrollingSpeed: fp_anim_time, 5093 verticalCentered: true, 5094 anchors: no_history ? false : dataNames, 5095 recordHistory: !no_history, 5096 afterRender: function(){ 5097 $('body').removeClass('fp-waiting'); 5098 $('.uncode-scroll-lock', $container).not(':visible').each(function(){ 5099 var $invisible = $(this).addClass('hidden-scroll');//, 5100 }); 5101 $('.uncode-scroll-lock.active', $container).filter(':visible').each(function(){ 5102 var $visible = $(this).addClass('uncode-scroll-visible'), 5103 visIndex = $visible.index('.uncode-scroll-lock:not(.hidden-scroll)'); 5104 $('ul.onepage-pagination a[data-index="' + visIndex + '"]').addClass('is-selected'); 5105 }); 5106 5107 $('ul.onepage-pagination a').on('click', function(e){ 5108 e.preventDefault(); 5109 var $a = $(this), 5110 toIndex = $a.data('index'); 5111 5112 $.fn.fullpage.moveTo(toIndex+1); 5113 }); 5114 5115 requestTimeout(function(){ 5116 scrollHashes(); 5117 }, 1000); 5118 5119 $(window).on('hashchange', function(e){ 5120 requestTimeout(function(){ 5121 scrollHashes(); 5122 }, 500); 5123 }); 5124 5125 anchorLink(); 5126 5127 if ( $('body').hasClass('uncode-fp-opacity') ) { 5128 $all.each(function(index, row) { 5129 var testmatch = $(row)[0].className.match(/\bstyle-.*?-bg\b/g, ''), 5130 classBg; 5131 5132 if ( typeof testmatch !== 'undefined' && testmatch !== null ) { 5133 classBg = testmatch[0]; 5134 $(row).removeClass(classBg).find('.fp-tableCell').addClass(classBg); 5135 } 5136 }); 5137 } 5138 5139 if ( !$('body').hasClass('vmenu') && !$('body').hasClass('menu-offcanvas') ) { 5140 $(window).on('menuOpen gdprOpen', function(){ 5141 $.fn.fullpage.setAutoScrolling(false); 5142 }).on('menuClose gdprClose', function(){ 5143 $.fn.fullpage.setAutoScrolling(true); 5144 }); 5145 } 5146 5147 $(window).on('menuMobileOpen menuCanvasOpen unmodal-open uncode-sidecart-open', function(){ 5148 requestTimeout(function(){ 5149 $.fn.fullpage.setAutoScrolling(false); 5150 }, 1000); 5151 }).on('menuMobileClose menuCanvasClose unmodal-close uncode-sidecart-closed', function(){ 5152 $.fn.fullpage.setAutoScrolling(true); 5153 }); 5154 5155 if ( !UNCODE.isFullPageSnap ) { 5156 clearRequestTimeout(checkFPeffects); 5157 checkFPeffects = requestTimeout(function(){ 5158 activateBackWash( 1 ); 5159 activateKBurns( 1 ); 5160 }, 100); 5161 } 5162 5163 }, 5164 onLeave: function( index, nextIndex, direction ){ 5165 5166 if ( UNCODE.menuOpened || is_scrolling ) 5167 return false; 5168 5169 is_scrolling = true; 5170 5171 var event = new CustomEvent('fp-slide-leave'); 5172 window.dispatchEvent(event); 5173 5174 slideLeave( index, nextIndex, direction ); 5175 5176 if ( $('.uncode-scroll-lock', $container).eq(nextIndex-1).hasClass('hidden-scroll') ) { 5177 if ( direction === 'up' ) { 5178 $.fn.fullpage.moveTo(nextIndex-1); 5179 } else { 5180 $.fn.fullpage.moveTo(nextIndex+1); 5181 } 5182 return false; 5183 } 5184 5185 $('ul.onepage-pagination a').removeClass('is-selected'); 5186 $('ul.onepage-pagination a[data-index="' + (nextIndex-1) + '"]').addClass('is-selected'); 5187 5188 } 5189 }); 5190 }; 5191 5192 init_fullPage(); 5193 $(window).on('load', function(){ 5194 requestTimeout(function(){ 5195 $.fn.fullpage.reBuild(); 5196 }, 3000); 5197 }); 5198 5199 var addScrollingClass, 5200 removeScrollingClass; 5201 5202 window.addEventListener("fp-slide-scroll", function(){ 5203 addScrollingClass = requestTimeout( function(){ 5204 $('body').addClass('fp-slide-scrolling'); 5205 }, 10 ); 5206 5207 clearRequestTimeout(removeScrollingClass); 5208 removeScrollingClass = requestTimeout( function(){ 5209 $('body').removeClass('fp-slide-scrolling'); 5210 }, 150 ); 5211 5212 Waypoint.refreshAll(); 5213 }, false); 5214 5215 var setFPheight = function(){ 5216 var $body = document.body, 5217 $footer = document.getElementById('colophon'), 5218 $maincontainer = document.querySelector('.main-wrapper'), 5219 rect = $maincontainer.getBoundingClientRect(); 5220 $body.style.height = UNCODE.wheight + 'px'; 5221 if ( theres_footer ) 5222 $footer.style.top = rect.height + 'px'; 5223 }; 5224 5225 setFPheight(); 5226 5227 window.addEventListener('resize', setFPheight, false); 5228 window.addEventListener('orientationchange', setFPheight, false); 5229 5230}; 5231 5232UNCODE.particles = function() { 5233 $(".vc-particles-background").each(function() { 5234 var $particle = $(this); 5235 var $parent = $particle.closest('[data-parent]'); 5236
5237 $parent.prepend($particle); 5238 $(window).trigger('resize'); 5239 }) 5240}; 5241 5242UNCODE.filters = function() { 5243 var $isotopes = $('.isotope-system'); 5244 5245 $isotopes.each(function(index, val){ 5246 var $isotope = $(this), 5247 $widget_trgr = $('.uncode-woocommerce-toggle-widgetized-cb__link', $isotope), 5248 $widgets = $('.widgetized-cb-wrapper', $isotope), 5249 $sorting_trgr = $('.uncode-woocommerce-sorting__link', $isotope), 5250 $sorting_dd = $('.uncode-woocommerce-sorting-dropdown', $isotope), 5251 $cats_trigger = $('.menu-smart--filter-cats_mobile-toggle-trigger', $isotope), 5252 $cats_filters = $('.menu-smart--filter-cats-mobile-dropdown', $isotope); 5253 5254 if ($isotope.hasClass('isotope-processed')) { 5255 return; 5256 } 5257 5258 $cats_trigger.on('click', function(e) { 5259 if ( ! $('html').hasClass('screen-sm') ) { 5260 // $widgets.add($sorting_dd).slideUp(400); 5261 $widgets.slideUp(200, 'easeInOutCirc'); 5262 } 5263 }); 5264 5265 $('.filters-toggle-trigger', $isotope).on('click', function(e) { 5266 e.preventDefault(); 5267 var $filters = $('.isotope-filters .menu-horizontal', $isotope); 5268 $filters.slideToggle(200); 5269 $widgets.add($cats_filters).slideUp(200); 5270 }); 5271 5272 $widget_trgr.on('click', function(e) { 5273 e.preventDefault(); 5274 $widgets.slideToggle(200); 5275 if (!$('html').hasClass('screen-sm')) { 5276 // $cats_filters.add($sorting_dd).slideUp(200); 5277 $cats_filters.slideUp(200); 5278 } 5279 window.dispatchEvent(new CustomEvent('boxResized')); 5280 }); 5281 5282 $sorting_trgr.on('click', function(e) { 5283 e.preventDefault(); 5284 if ($('html').hasClass('screen-sm')) { 5285 return false; 5286 } else { 5287 $widgets.add($cats_filters).slideUp(200); 5288 } 5289 }); 5290 5291 $isotope.addClass('isotope-processed'); 5292 }) 5293 5294}; 5295 5296UNCODE.widgets = function() { 5297 var widget_titles = $('.widget-mobile-collapse').find('.widget-title'); 5298 var widgets = widget_titles.closest('.widget'); 5299 5300 widgets.each(function() { 5301 var _this = $(this); 5302 var content = _this.children().not('.widget-title'); 5303 5304 if (_this.hasClass('widget-mobile-done')) { 5305 return; 5306 } 5307 5308 content.wrapAll( '<div class="widget-collapse-content"></div> '); 5309 _this.removeClass('collapse-init'); 5310 _this.addClass('widget-mobile-done'); 5311 }); 5312 5313 var widgets_without_title = $('.collapse-init'); 5314 5315 widgets_without_title.removeClass('collapse-init'); 5316 5317 widget_titles.on('click', function() { 5318 var _this = $(this); 5319 var content = _this.closest('.widget').find('.widget-collapse-content'); 5320 5321 // Get content of :after element (+ icon) to check the visibility 5322 var icon_content = window.getComputedStyle(_this[0], ':after').getPropertyValue('content'); 5323 5324 if (icon_content === 'none') { 5325 return false; 5326 } 5327 5328 _this.toggleClass('open'); 5329 content.slideToggle(400, 'easeInOutCirc'); 5330 5331 return false; 5332 }); 5333}; 5334 5335UNCODE.unmodal = function() { 5336 $(document).off('click', '.open-unmodal').on('click', '.open-unmodal', function() { 5337 $('.unmodal-overlay').fadeIn(); 5338 $('.unmodal-overlay').addClass('loading'); 5339 $('body').addClass('uncode-unmodal-overlay-visible'); 5340 $(window).trigger('unmodal-open'); 5341 }); 5342 5343 $(document).off('click', '.unmodal-overlay').on('click', '.unmodal-overlay, .unmodal-close', function() { 5344 $('.unmodal-overlay').fadeOut(); 5345 $('.unmodal').fadeOut(); 5346 $('body').removeClass('uncode-unmodal-overlay-visible'); 5347 $('body').removeClass('uncode-unmodal-open'); 5348 $('html').removeClass('uncode-unmodal-body-disable-scroll'); 5349 $(document).trigger('unmodal-close'); 5350 UNCODE.isUnmodalOpen = false; 5351 }); 5352 5353 $(document).on('uncode-unmodal-show-content', function() { 5354 $('.unmodal-overlay').removeClass('loading'); 5355 $('.unmodal').show(); 5356 $('.unmodal').addClass('show-unmodal-with-animation'); 5357 $('.unmodal-content')[0].scrollTop = 0; 5358 $('body').addClass('uncode-unmodal-open'); 5359 UNCODE.isUnmodalOpen = true; 5360 5361 if ($('body').hasClass('qw-body-scroll-disabled')) { 5362 $('html').addClass('uncode-unmodal-body-disable-scroll'); 5363 } 5364 5365 if ($('.unmodal').hasClass('auto-height')) { 5366 set_modal_height(); 5367 } 5368 }); 5369 5370 var set_modal_height = function() { 5371 var modal = $('.unmodal'); 5372 var window_height = $(window).outerHeight(); 5373 var modal_height = modal.outerHeight(); 5374 5375 modal.css('height', 'auto'); 5376 5377 if (modal_height > window_height) { 5378 modal.outerHeight(window_height); 5379 } 5380 } 5381 5382 if ($('.unmodal').hasClass('auto-height')) { 5383 var setCTA; 5384 5385 $(window).on('resize', function() { 5386 clearRequestTimeout(setCTA); 5387 setCTA = requestTimeout(function() { 5388 set_modal_height(); 5389 }, 100); 5390 }); 5391 } 5392}; 5393 5394 UNCODE.init = function() { 5395 var wfl_check = false, wfl_request, waypoint_request; 5396 UNCODE.preventDoubleTransition(); 5397 UNCODE.utils(); 5398 UNCODE.menuSystem(); 5399 UNCODE.okvideo(); 5400 UNCODE.tapHover(); 5401 UNCODE.isotopeLayout(); 5402 UNCODE.justifiedGallery(); 5403 UNCODE.lightbox(); 5404 UNCODE.carousel($('body')); 5405 UNCODE.lettering(); 5406 UNCODE.animations(); 5407 UNCODE.stickyElements(); 5408 UNCODE.twentytwenty(); 5409 UNCODE.disableHoverScroll(); 5410 UNCODE.printScreen(); 5411 UNCODE.particles(); 5412 UNCODE.filters(); 5413 UNCODE.widgets(); 5414 UNCODE.unmodal(); 5415 if ( !UNCODE.isFullPage ) { 5416 UNCODE.checkScrollForTabs(); 5417 } 5418 UNCODE.onePage(UNCODE.isMobile); 5419 $(document).ready(function(){ 5420 UNCODE.fullPage(); 5421 }); 5422 $(window).on('load',function(){ 5423 clearRequestTimeout(waypoint_request);
5424 waypoint_request = requestTimeout( function(){ 5425 Waypoint.refreshAll(); 5426 }, 1000); 5427 }); 5428 } 5429 5430 if ( ! SiteParameters.is_frontend_editor ) { 5431 UNCODE.init(); 5432 } 5433 5434 5435})(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.