/* Name: Theme Base Written by: Okler Themes - (http://www.okler.net) Theme Version: 9.5.0 */ // Theme window.theme = {}; // Theme Common Functions window.theme.fn = { getOptions: function(opts) { if (typeof(opts) == 'object') { return opts; } else if (typeof(opts) == 'string') { try { return JSON.parse(opts.replace(/'/g, '"').replace(';', '')); } catch (e) { return {}; } } else { return {}; } }, execPluginFunction: function(functionName, context) { var args = Array.prototype.slice.call(arguments, 2); var namespaces = functionName.split("."); var func = namespaces.pop(); for (var i = 0; i < namespaces.length; i++) { context = context[namespaces[i]]; } return context[func].apply(context, args); }, intObs: function(selector, functionName, intObsOptions, alwaysObserve) { var $el = document.querySelectorAll(selector); var intersectionObserverOptions = { rootMargin: '0px 0px 200px 0px' } if (Object.keys(intObsOptions).length) { intersectionObserverOptions = $.extend(intersectionObserverOptions, intObsOptions); } var observer = new IntersectionObserver(function(entries) { for (var i = 0; i < entries.length; i++) { var entry = entries[i]; if (entry.intersectionRatio > 0) { if (typeof functionName === 'string') { var func = Function('return ' + functionName)(); } else { var callback = functionName; callback.call($(entry.target)); } // Unobserve if (!alwaysObserve) { observer.unobserve(entry.target); } } } }, intersectionObserverOptions); $($el).each(function() { observer.observe($(this)[0]); }); }, intObsInit: function(selector, functionName) { var $el = document.querySelectorAll(selector); var intersectionObserverOptions = { rootMargin: '200px' } var observer = new IntersectionObserver(function(entries) { for (var i = 0; i < entries.length; i++) { var entry = entries[i]; if (entry.intersectionRatio > 0) { var $this = $(entry.target), opts; var pluginOptions = theme.fn.getOptions($this.data('plugin-options')); if (pluginOptions) opts = pluginOptions; theme.fn.execPluginFunction(functionName, $this, opts); // Unobserve observer.unobserve(entry.target); } } }, intersectionObserverOptions); $($el).each(function() { observer.observe($(this)[0]); }); }, dynIntObsInit: function(selector, functionName, pluginDefaults) { var $el = document.querySelectorAll(selector); $($el).each(function() { var $this = $(this), opts; var pluginOptions = theme.fn.getOptions($this.data('plugin-options')); if (pluginOptions) opts = pluginOptions; var mergedPluginDefaults = theme.fn.mergeOptions(pluginDefaults, opts) var intersectionObserverOptions = { rootMargin: theme.fn.getRootMargin(functionName, mergedPluginDefaults), threshold: 0 } if (!mergedPluginDefaults.forceInit) { var observer = new IntersectionObserver(function(entries) { for (var i = 0; i < entries.length; i++) { var entry = entries[i]; if (entry.intersectionRatio > 0) { theme.fn.execPluginFunction(functionName, $this, mergedPluginDefaults); // Unobserve observer.unobserve(entry.target); } } }, intersectionObserverOptions); observer.observe($this[0]); } else { theme.fn.execPluginFunction(functionName, $this, mergedPluginDefaults); } }); }, getRootMargin: function(plugin, pluginDefaults) { switch (plugin) { case 'themePluginCounter': return pluginDefaults.accY ? '0px 0px ' + pluginDefaults.accY + 'px 0px' : '0px 0px 200px 0px'; break; case 'themePluginAnimate': return pluginDefaults.accY ? '0px 0px ' + pluginDefaults.accY + 'px 0px' : '0px 0px 200px 0px'; break; case 'themePluginIcon': return pluginDefaults.accY ? '0px 0px ' + pluginDefaults.accY + 'px 0px' : '0px 0px 200px 0px'; break; case 'themePluginRandomImages': return pluginDefaults.accY ? '0px 0px ' + pluginDefaults.accY + 'px 0px' : '0px 0px 200px 0px'; break; default: return '0px 0px 200px 0px'; break; } }, mergeOptions: function(obj1, obj2) { var obj3 = {}; for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; } for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; } return obj3; }, execOnceTroughEvent: function($el, event, callback) { var self = this, dataName = self.formatDataName(event); $($el).on(event, function() { if (!$(this).data(dataName)) { // Exec Callback Function callback.call($(this)); // Add data name $(this).data(dataName, true); // Unbind event $(this).off(event); } }); return this; }, execOnceTroughWindowEvent: function($el, event, callback) { var self = this, dataName = self.formatDataName(event); $($el).on(event, function() { if (!$(this).data(dataName)) { // Exec Callback Function callback(); // Add data name $(this).data(dataName, true); // Unbind event $(this).off(event); } }); return this; }, formatDataName: function(name) { name = name.replace('.', ''); return name; }, isElementInView: function($el) { var rect = $el[0].getBoundingClientRect(); return ( rect.top <= (window.innerHeight / 3) ); }, getScripts: function(arr, path) { var _arr = $.map(arr, function(scr) { return $.getScript((path || "") + scr); }); _arr.push($.Deferred(function(deferred) { $(deferred.resolve); })); return $.when.apply($, _arr); } }; /** * Copyright 2016 Google Inc. All Rights Reserved. * * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE. * * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document * */ !function(){"use strict";if("object"==typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var t=function(t){for(var e=window.document,o=i(e);o;)o=i(e=o.ownerDocument);return e}(),e=[],o=null,n=null;s.prototype.THROTTLE_TIMEOUT=100,s.prototype.POLL_INTERVAL=null,s.prototype.USE_MUTATION_OBSERVER=!0,s._setupCrossOriginUpdater=function(){return o||(o=function(t,o){n=t&&o?l(t,o):{top:0,bottom:0,left:0,right:0,width:0,height:0},e.forEach(function(t){t._checkForIntersections()})}),o},s._resetCrossOriginUpdater=function(){o=null,n=null},s.prototype.observe=function(t){if(!this._observationTargets.some(function(e){return e.element==t})){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(t.ownerDocument),this._checkForIntersections()}},s.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter(function(e){return e.element!=t}),this._unmonitorIntersections(t.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},s.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},s.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},s.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter(function(t,e,o){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==o[e-1]})},s.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map(function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}});return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},s.prototype._monitorIntersections=function(e){var o=e.defaultView;if(o&&-1==this._monitoringDocuments.indexOf(e)){var n=this._checkForIntersections,r=null,s=null;this.POLL_INTERVAL?r=o.setInterval(n,this.POLL_INTERVAL):(h(o,"resize",n,!0),h(e,"scroll",n,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in o&&(s=new o.MutationObserver(n)).observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(e),this._monitoringUnsubscribes.push(function(){var t=e.defaultView;t&&(r&&t.clearInterval(r),c(t,"resize",n,!0)),c(e,"scroll",n,!0),s&&s.disconnect()});var u=this.root&&(this.root.ownerDocument||this.root)||t;if(e!=u){var a=i(e);a&&this._monitorIntersections(a.ownerDocument)}}},s.prototype._unmonitorIntersections=function(e){var o=this._monitoringDocuments.indexOf(e);if(-1!=o){var n=this.root&&(this.root.ownerDocument||this.root)||t;if(!this._observationTargets.some(function(t){var o=t.element.ownerDocument;if(o==e)return!0;for(;o&&o!=n;){var r=i(o);if((o=r&&r.ownerDocument)==e)return!0}return!1})){var r=this._monitoringUnsubscribes[o];if(this._monitoringDocuments.splice(o,1),this._monitoringUnsubscribes.splice(o,1),r(),e!=n){var s=i(e);s&&this._unmonitorIntersections(s.ownerDocument)}}}},s.prototype._unmonitorAllIntersections=function(){var t=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var e=0;e=0&&m>=0&&{top:c,bottom:a,left:f,right:d,width:g,height:m}||null),!v)break;_=_&&p(_)}return v}},s.prototype._getRootRect=function(){var e;if(this.root&&!d(this.root))e=u(this.root);else{var o=d(this.root)?this.root:t,n=o.documentElement,i=o.body;e={top:0,left:0,right:n.clientWidth||i.clientWidth,width:n.clientWidth||i.clientWidth,bottom:n.clientHeight||i.clientHeight,height:n.clientHeight||i.clientHeight}}return this._expandRectByRootMargin(e)},s.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map(function(e,o){return"px"==e.unit?e.value:e.value*(o%2?t.width:t.height)/100}),o={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return o.width=o.right-o.left,o.height=o.bottom-o.top,o},s.prototype._hasCrossedThreshold=function(t,e){var o=t&&t.isIntersecting?t.intersectionRatio||0:-1,n=e.isIntersecting?e.intersectionRatio||0:-1;if(o!==n)for(var i=0;i -1; }, g = 'gecko', w = 'webkit', s = 'safari', o = 'opera', h = document.documentElement, b = [(!(/opera|webtv/i.test(ua)) && /msie\s(\d)/.test(ua)) ? ('ie ie' + parseFloat(navigator.appVersion.split("MSIE")[1])) : is('firefox/2') ? g + ' ff2' : is('firefox/3.5') ? g + ' ff3 ff3_5' : is('firefox/3') ? g + ' ff3' : is('gecko/') ? g : is('opera') ? o + (/version\/(\d+)/.test(ua) ? ' ' + o + RegExp.jQuery1 : (/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + RegExp.jQuery2 : '')) : is('konqueror') ? 'konqueror' : is('chrome') ? w + ' chrome' : is('iron') ? w + ' iron' : is('applewebkit/') ? w + ' ' + s + (/version\/(\d+)/.test(ua) ? ' ' + s + RegExp.jQuery1 : '') : is('mozilla/') ? g : '', is('j2me') ? 'mobile' : is('iphone') ? 'iphone' : is('ipod') ? 'ipod' : is('mac') ? 'mac' : is('darwin') ? 'mac' : is('webtv') ? 'webtv' : is('win') ? 'win' : is('freebsd') ? 'freebsd' : (is('x11') || is('linux')) ? 'linux' : '', 'js']; c = b.join(' '); if ($.browser.mobile) { c += ' mobile'; } if (hasTouch) { c += ' touch'; } h.className += ' ' + c; // Edge Detect var isEdge = /Edge/.test(navigator.userAgent); if(isEdge) { $('html').removeClass('chrome').addClass('edge'); } // IE11 Detect var isIE11 = !(window.ActiveXObject) && "ActiveXObject" in window; if (isIE11) { $('html').removeClass('gecko').addClass('ie ie11'); return; } // Dark and Boxed Compatibility if($('body').hasClass('dark')) { $('html').addClass('dark'); } if($('body').hasClass('boxed')) { $('html').addClass('boxed'); } } }); $.browserSelector(); /* Global Variable For Screen Size */ theme.globalWindowWidth = $(window).width(); var globalWindowWidth = $(window).width(); window.onresize = function() { theme.globalWindowWidth = $(window).width(); } /* Browser Workarounds */ if (/iPad|iPhone|iPod/.test(navigator.platform)) { // iPad/Iphone/iPod Hover Workaround $(document).ready(function($) { $('.thumb-info').attr('onclick', 'return true'); }); } /* Tabs */ if( $('a[data-bs-toggle="tab"]').length ) { $('a[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) { var $tabPane = $($(e.target).attr('href')); // Carousel Refresh if($tabPane.length) { $tabPane.find('.owl-carousel').trigger('refresh.owl.carousel'); } // Change Active Class $(this).parents('.nav-tabs').find('.active').removeClass('active'); $(this).addClass('active').parent().addClass('active'); }); if( window.location.hash ) { $(window).on('load', function(){ if( window.location.hash !== '*' && $( window.location.hash ).get(0) ) { new bootstrap.Tab( $('a.nav-link[href="'+ window.location.hash +'"]:not([data-hash])')[0] ).show(); } }); } } /* On Load Scroll */ if( !$('html').hasClass('disable-onload-scroll') && window.location.hash && !['#*'].includes( window.location.hash ) ) { window.scrollTo(0, 0); $(window).on('load', function() { setTimeout(function() { var target = window.location.hash, offset = ( $(window).width() < 768 ) ? 180 : 90; if (!$(target).length) { return; } if ( $("a[href$='" + window.location.hash + "']").is('[data-hash-offset]') ) { offset = parseInt( $("a[href$='" + window.location.hash + "']").first().attr('data-hash-offset') ); } else if ( $("html").is('[data-hash-offset]') ) { offset = parseInt( $("html").attr('data-hash-offset') ); } if (isNaN(offset)) { offset = 0; } $('body').addClass('scrolling'); $('html, body').animate({ scrollTop: $(target).offset().top - offset }, 600, 'easeOutQuad', function() { $('body').removeClass('scrolling'); }); }, 1); }); } /* * Text Rotator */ $.fn.extend({ textRotator: function(options) { var defaults = { fadeSpeed: 500, pauseSpeed: 100, child: null }; var options = $.extend(defaults, options); return this.each(function() { var o = options; var obj = $(this); var items = $(obj.children(), obj); items.each(function() { $(this).hide(); }) if (!o.child) { var next = $(obj).children(':first'); } else { var next = o.child; } $(next).fadeIn(o.fadeSpeed, function() { $(next).delay(o.pauseSpeed).fadeOut(o.fadeSpeed, function() { var next = $(this).next(); if (next.length == 0) { next = $(obj).children(':first'); } $(obj).textRotator({ child: next, fadeSpeed: o.fadeSpeed, pauseSpeed: o.pauseSpeed }); }) }); }); } }); /* * Notice Top bar */ var $noticeTopBar = { $wrapper: $('.notice-top-bar'), $closeBtn: $('.notice-top-bar-close'), $header: $('#header'), $body: $('.body'), init: function() { var self = this; if( !$.cookie('portoNoticeTopBarClose') ) { self .build() .events(); } else { self.$wrapper.parent().prepend( '' ); self.$wrapper.remove(); } return this; }, build: function(){ var self = this; $(window).on('load', function(){ setTimeout(function(){ self.$body.css({ 'margin-top': self.$wrapper.outerHeight(), 'transition': 'ease margin 300ms' }); $('#noticeTopBarContent').textRotator({ fadeSpeed: 500, pauseSpeed: 5000 }); if( ['absolute', 'fixed'].includes( self.$header.css('position') ) ) { self.$header.css({ 'top': self.$wrapper.outerHeight(), 'transition': 'ease top 300ms' }); } $(window).trigger('notice.top.bar.opened'); }, 1000); }); return this; }, events: function() { var self = this; self.$closeBtn.on('click', function(e){ e.preventDefault(); self.$body.animate({ 'margin-top': 0, }, 300, function(){ self.$wrapper.remove(); self.saveCookie(); }); if( ['absolute', 'fixed'].includes( self.$header.css('position') ) ) { self.$header.animate({ top: 0 }, 300); } // When header has shrink effect if( self.$header.hasClass('header-effect-shrink') ) { self.$header.find('.header-body').animate({ top: 0 }, 300); } $(window).trigger('notice.top.bar.closed'); }); return this; }, checkCookie: function(){ var self = this; if( $.cookie('portoNoticeTopBarClose') ) { return true; } else { return false; } return this; }, saveCookie: function() { var self = this; $.cookie('portoNoticeTopBarClose', true); return this; } } if( $('.notice-top-bar').length ) { $noticeTopBar.init(); } /* * Image Hotspots */ if( $('.image-hotspot').length ) { $('.image-hotspot') .append('') .append(''); } /* * Page Transition if( $('body[data-plugin-page-transition]').length ) { var link_click = false; $(document).on('click', 'a', function(e){ link_click = $(this); }); $(window).on("beforeunload", function(e) { if( typeof link_click === 'object' ) { var href = link_click.attr('href'); if( href.indexOf('mailto:') != 0 && href.indexOf('tel:') != 0 && !link_click.data('rm-from-transition') ) { $('body').addClass('page-transition-active'); } } }); $(window).on("pageshow", function(e){ if( e.persisted ) { if( $('html').hasClass('safari') ) { window.location.reload(); } $('body').removeClass('page-transition-active'); } }); }*/ /* * Thumb Info Floating Caption */ $('.thumb-info-floating-caption').each(function() { $(this) .addClass('thumb-info-floating-element-wrapper') .append( ''+ $(this).data('title') +'' ); if( $(this).data('type') ) { $('.thumb-info-floating-caption-title', $(this)) .append( '
'+ $(this).data('type') +'
' ) .css({ 'padding-bottom' : 22 }); } if( $(this).hasClass('thumb-info-floating-caption-clean') ) { $('.thumb-info-floating-element', $(this)).addClass('bg-transparent'); } }); /* * Thumb Info Floating Element */ if( $('.thumb-info-floating-element-wrapper').length ) { $('.thumb-info-floating-element-wrapper').on('mouseenter', function(e){ if(!$(this).data('offset')) { $(this).data('offset', 0); } var offset = parseInt($(this).data('offset')); $('.thumb-info-floating-element-clone').remove(); $('.thumb-info-floating-element', $(this)).clone().addClass('thumb-info-floating-element-clone p-fixed p-events-none').attr('style', 'transform: scale(0.1);').removeClass('d-none').appendTo('body'); $('.thumb-info-floating-element-clone').css({ left: e.clientX + (offset), top: e.clientY + (offset) }).fadeIn(300); gsap.to('.thumb-info-floating-element-clone', 0.5, { css: { scaleX: 1, scaleY: 1 } }); $(document).off('mousemove').on('mousemove', function(e){ gsap.to('.thumb-info-floating-element-clone', 0.5, { css: { left: e.clientX + (offset), top: e.clientY + (offset) } }); }); }).on('mouseout', function(){ gsap.to('.thumb-info-floating-element-clone', 0.5, { css: { scaleX: 0.5, scaleY: 0.5, opacity: 0 } }); }); } /* * Thumb Info Direction Aware */ $(window).on('load', function() { $('.thumb-info-wrapper-direction-aware').each( function() { $(this).hoverdir({ speed : 300, easing : 'ease', hoverDelay : 0, inverse : false, hoverElem: '.thumb-info-wrapper-overlay' }); }); }); /* * Toggle Text Click */ $('[data-toggle-text-click]').on('click', function () { $(this).text(function(i, text){ return text === $(this).attr('data-toggle-text-click') ? $(this).attr('data-toggle-text-click-alt') : $(this).attr('data-toggle-text-click'); }); }); /* * Shape Divider Aspect Ratio */ if( $('.shape-divider').length ) { aspectRatioSVG(); $(window).on('resize', function(){ aspectRatioSVG(); }); } /* * Shape Divider Animated */ if( $('.shape-divider-horizontal-animation').length ) { theme.fn.intObs('.shape-divider-horizontal-animation', function(){ for( var i = 0; i <= 1; i++ ) { var svgClone = $(this).find('svg:nth-child(1)').clone(); $(this).append( svgClone ) } $(this).addClass('start'); }, {}); } /* * Toggle Class */ $('[data-porto-toggle-class]').on('click', function (e) { e.preventDefault(); $(this).toggleClass( $(this).data('porto-toggle-class') ); }); /* * Dynamic Height */ var $window = $(window); $window.on('resize dynamic.height.resize', function(){ $('[data-dynamic-height]').each(function(){ var $this = $(this), values = JSON.parse($this.data('dynamic-height').replace(/'/g,'"').replace(';','')) // XS if( $window.width() < 576 ) { $this.height( values[4] ); } // SM if( $window.width() > 575 && $window.width() < 768 ) { $this.height( values[3] ); } // MD if( $window.width() > 767 && $window.width() < 992 ) { $this.height( values[2] ); } // LG if( $window.width() > 991 && $window.width() < 1200 ) { $this.height( values[1] ); } // XS if( $window.width() > 1199 ) { $this.height( values[0] ); } }); }); // Mobile First Load if( $window.width() < 992 ) { $window.trigger('dynamic.height.resize'); } /* Video - Trigger Play */ if( $('[data-trigger-play-video]').length ) { theme.fn.execOnceTroughEvent( '[data-trigger-play-video]', 'mouseover.trigger.play.video', function(){ var $video = $( $(this).data('trigger-play-video') ); $(this).on('click', function(e){ e.preventDefault(); if( $(this).data('trigger-play-video-remove') == 'yes' ) { $(this).animate({ opacity: 0 }, 300, function(){ $video[0].play(); $(this).remove(); }); } else { setTimeout(function(){ $video[0].play(); },300); } }); }); } /* Video - Custom Auto Play */ if( $('video[data-auto-play]').length ) { $(window).on('load', function(){ $('video[data-auto-play]').each(function(){ var $video = $(this); setTimeout(function(){ if( $( '#' + $video.attr('id') ).length ) { if( $( '[data-trigger-play-video="#' + $video.attr('id') + '"]' ).data('trigger-play-video-remove') == 'yes' ) { $( '[data-trigger-play-video="#' + $video.attr('id') + '"]' ).animate({ opacity: 0 }, 300, function(){ $video[0].play(); $( '[data-trigger-play-video="#' + $video.attr('id') + '"]' ).remove(); }); } else { setTimeout(function(){ $video[0].play(); },300); } } }, 100); }); }); } /* * Remove min height after the load of page */ if( $('[data-remove-min-height]').length ) { $(window).on('load', function(){ $('[data-remove-min-height]').each(function(){ $(this).css({ 'min-height': 0 }); }); }); } /* * Style Switcher Open Loader Button */ if( $('.style-switcher-open-loader').length ) { $('.style-switcher-open-loader').on('click', function(e){ e.preventDefault(); var $this = $(this); // Add Spinner to icon $this.addClass('style-switcher-open-loader-loading'); var basePath = $(this).data('base-path'), skinSrc = $(this).data('skin-src'); var script1 = document.createElement("script"); script1.src = basePath + "master/style-switcher/style.switcher.localstorage.js"; var script2 = document.createElement("script"); script2.src = basePath + "master/style-switcher/style.switcher.js"; script2.id = "styleSwitcherScript"; script2.setAttribute('data-base-path', basePath); script2.setAttribute('data-skin-src', skinSrc); script2.onload = function() { setTimeout(function(){ // Trigger a click to open the style switcher sidebar function checkIfReady() { if( !$('.style-switcher-open').length ) { window.setTimeout(checkIfReady, 100); } else { $('.style-switcher-open').trigger('click'); } } checkIfReady(); }, 500); } document.body.appendChild(script1); document.body.appendChild(script2); }); } })(jQuery); /* * Scroll and Focus */ function scrollAndFocus($this, scrollTarget, focusTarget, scrollOffset, scrollAgain) { (function($) { $('body').addClass('scrolling'); // if it's inside a header menu if( $($this).closest('#mainNav').length ) { $($this).parents('.collapse.show').collapse('hide'); } $('html, body').animate({ scrollTop: $(scrollTarget).offset().top - (scrollOffset ? scrollOffset : 0) }, 300, function() { $('body').removeClass('scrolling'); setTimeout(function(){ $(focusTarget).focus(); }, 500); if( scrollAgain ) { $('html, body').animate({ scrollTop: $(scrollTarget).offset().top - (scrollOffset ? scrollOffset : 0) }); } }); })(jQuery); } /* * Shape Divider - SVG Aspect Ratio */ function aspectRatioSVG() { if( $(window).width() < 1950 ) { $('.shape-divider svg[preserveAspectRatio]').each(function(){ if( !$(this).parent().hasClass('shape-divider-horizontal-animation') ) { $(this).attr('preserveAspectRatio', 'xMinYMin'); } else { $(this).attr('preserveAspectRatio', 'none'); } }); } else { $('.shape-divider svg[preserveAspectRatio]').each(function(){ $(this).attr('preserveAspectRatio', 'none'); }); } } /* * Lazy Load Background Images (with lazySizes plugin) */ document.addEventListener('lazybeforeunveil', function(e){ var bg = e.target.getAttribute('data-bg-src'); if(bg) { e.target.style.backgroundImage = 'url(' + bg + ')'; } }); (function (factory) { if (typeof define === 'function' && define.amd) { // AMD define(['jquery'], factory); } else if (typeof exports === 'object') { // CommonJS factory(require('jquery')); } else { // Browser globals factory(jQuery); } }(function ($) { var CountTo = function (element, options) { this.$element = $(element); this.options = $.extend({}, CountTo.DEFAULTS, this.dataOptions(), options); this.init(); }; CountTo.DEFAULTS = { from: 0, // the number the element should start at to: 0, // the number the element should end at speed: 1000, // how long it should take to count between the target numbers refreshInterval: 100, // how often the element should be updated decimals: 0, // the number of decimal places to show formatter: formatter, // handler for formatting the value before rendering onUpdate: null, // callback method for every time the element is updated onComplete: null // callback method for when the element finishes updating }; CountTo.prototype.init = function () { this.value = this.options.from; this.loops = Math.ceil(this.options.speed / this.options.refreshInterval); this.loopCount = 0; this.increment = (this.options.to - this.options.from) / this.loops; }; CountTo.prototype.dataOptions = function () { var options = { from: this.$element.data('from'), to: this.$element.data('to'), speed: this.$element.data('speed'), refreshInterval: this.$element.data('refresh-interval'), decimals: this.$element.data('decimals') }; var keys = Object.keys(options); for (var i in keys) { var key = keys[i]; if (typeof(options[key]) === 'undefined') { delete options[key]; } } return options; }; CountTo.prototype.update = function () { this.value += this.increment; this.loopCount++; this.render(); if (typeof(this.options.onUpdate) == 'function') { this.options.onUpdate.call(this.$element, this.value); } if (this.loopCount >= this.loops) { clearInterval(this.interval); this.value = this.options.to; if (typeof(this.options.onComplete) == 'function') { this.options.onComplete.call(this.$element, this.value); } } }; CountTo.prototype.render = function () { var formattedValue = this.options.formatter.call(this.$element, this.value, this.options); this.$element.text(formattedValue); }; CountTo.prototype.restart = function () { this.stop(); this.init(); this.start(); }; CountTo.prototype.start = function () { this.stop(); this.render(); this.interval = setInterval(this.update.bind(this), this.options.refreshInterval); }; CountTo.prototype.stop = function () { if (this.interval) { clearInterval(this.interval); } }; CountTo.prototype.toggle = function () { if (this.interval) { this.stop(); } else { this.start(); } }; function formatter(value, options) { return value.toFixed(options.decimals); } $.fn.countTo = function (option) { return this.each(function () { var $this = $(this); var data = $this.data('countTo'); var init = !data || typeof(option) === 'object'; var options = typeof(option) === 'object' ? option : {}; var method = typeof(option) === 'string' ? option : 'start'; if (init) { if (data) data.stop(); $this.data('countTo', data = new CountTo(this, options)); } data[method].call(data); }); }; })); (function($){ /** * Copyright 2012, Digital Fusion * Licensed under the MIT license. * http://teamdf.com/jquery-plugins/license/ * * @author Sam Sehnert * @desc A small plugin that checks whether elements are within * the user visible viewport of a web browser. * only accounts for vertical position, not horizontal. */ $.fn.visible = function(partial,hidden,direction,container){ if (this.length < 1) return; var $t = this.length > 1 ? this.eq(0) : this, isContained = typeof container !== 'undefined' && container !== null, $w = isContained ? $(container) : $(window), wPosition = isContained ? $w.position() : 0, t = $t.get(0), vpWidth = $w.outerWidth(), vpHeight = $w.outerHeight(), direction = (direction) ? direction : 'both', clientSize = hidden === true ? t.offsetWidth * t.offsetHeight : true; if (typeof t.getBoundingClientRect === 'function'){ // Use this native browser method, if available. var rec = t.getBoundingClientRect(), tViz = isContained ? rec.top - wPosition.top >= 0 && rec.top < vpHeight + wPosition.top : rec.top >= 0 && rec.top < vpHeight, bViz = isContained ? rec.bottom - wPosition.top > 0 && rec.bottom <= vpHeight + wPosition.top : rec.bottom > 0 && rec.bottom <= vpHeight, lViz = isContained ? rec.left - wPosition.left >= 0 && rec.left < vpWidth + wPosition.left : rec.left >= 0 && rec.left < vpWidth, rViz = isContained ? rec.right - wPosition.left > 0 && rec.right < vpWidth + wPosition.left : rec.right > 0 && rec.right <= vpWidth, vVisible = partial ? tViz || bViz : tViz && bViz, hVisible = partial ? lViz || rViz : lViz && rViz; if(direction === 'both') return clientSize && vVisible && hVisible; else if(direction === 'vertical') return clientSize && vVisible; else if(direction === 'horizontal') return clientSize && hVisible; } else { var viewTop = isContained ? 0 : wPosition, viewBottom = viewTop + vpHeight, viewLeft = $w.scrollLeft(), viewRight = viewLeft + vpWidth, position = $t.position(), _top = position.top, _bottom = _top + $t.height(), _left = position.left, _right = _left + $t.width(), compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom, compareLeft = partial === true ? _right : _left, compareRight = partial === true ? _left : _right; if(direction === 'both') return !!clientSize && ((compareBottom <= viewBottom) && (compareTop >= viewTop)) && ((compareRight <= viewRight) && (compareLeft >= viewLeft)); else if(direction === 'vertical') return !!clientSize && ((compareBottom <= viewBottom) && (compareTop >= viewTop)); else if(direction === 'horizontal') return !!clientSize && ((compareRight <= viewRight) && (compareLeft >= viewLeft)); } }; })(jQuery); /** * jquery-match-height 0.7.2 by @liabru * http://brm.io/jquery-match-height/ * License: MIT */ ;(function(factory) { // eslint-disable-line no-extra-semi 'use strict'; if (typeof define === 'function' && define.amd) { // AMD define(['jquery'], factory); } else if (typeof module !== 'undefined' && module.exports) { // CommonJS module.exports = factory(require('jquery')); } else { // Global factory(jQuery); } })(function($) { /* * internal */ var _previousResizeWidth = -1, _updateTimeout = -1; /* * _parse * value parse utility function */ var _parse = function(value) { // parse value and convert NaN to 0 return parseFloat(value) || 0; }; /* * _rows * utility function returns array of jQuery selections representing each row * (as displayed after float wrapping applied by browser) */ var _rows = function(elements) { var tolerance = 1, $elements = $(elements), lastTop = null, rows = []; // group elements by their top position $elements.each(function(){ var $that = $(this), top = $that.offset().top - _parse($that.css('margin-top')), lastRow = rows.length > 0 ? rows[rows.length - 1] : null; if (lastRow === null) { // first item on the row, so just push it rows.push($that); } else { // if the row top is the same, add to the row group if (Math.floor(Math.abs(lastTop - top)) <= tolerance) { rows[rows.length - 1] = lastRow.add($that); } else { // otherwise start a new row group rows.push($that); } } // keep track of the last row top lastTop = top; }); return rows; }; /* * _parseOptions * handle plugin options */ var _parseOptions = function(options) { var opts = { byRow: true, property: 'height', target: null, remove: false }; if (typeof options === 'object') { return $.extend(opts, options); } if (typeof options === 'boolean') { opts.byRow = options; } else if (options === 'remove') { opts.remove = true; } return opts; }; /* * matchHeight * plugin definition */ var matchHeight = $.fn.matchHeight = function(options) { var opts = _parseOptions(options); // handle remove if (opts.remove) { var that = this; // remove fixed height from all selected elements this.css(opts.property, ''); // remove selected elements from all groups $.each(matchHeight._groups, function(key, group) { group.elements = group.elements.not(that); }); // TODO: cleanup empty groups return this; } if (this.length <= 1 && !opts.target) { return this; } // keep track of this group so we can re-apply later on load and resize events matchHeight._groups.push({ elements: this, options: opts }); // match each element's height to the tallest element in the selection matchHeight._apply(this, opts); return this; }; /* * plugin global options */ matchHeight.version = '0.7.2'; matchHeight._groups = []; matchHeight._throttle = 80; matchHeight._maintainScroll = false; matchHeight._beforeUpdate = null; matchHeight._afterUpdate = null; matchHeight._rows = _rows; matchHeight._parse = _parse; matchHeight._parseOptions = _parseOptions; /* * matchHeight._apply * apply matchHeight to given elements */ matchHeight._apply = function(elements, options) { var opts = _parseOptions(options), $elements = $(elements), rows = [$elements]; // take note of scroll position var scrollTop = $(window).scrollTop(), htmlHeight = $('html').outerHeight(true); // get hidden parents var $hiddenParents = $elements.parents().filter(':hidden'); // cache the original inline style $hiddenParents.each(function() { var $that = $(this); $that.data('style-cache', $that.attr('style')); }); // temporarily must force hidden parents visible $hiddenParents.css('display', 'block'); // get rows if using byRow, otherwise assume one row if (opts.byRow && !opts.target) { // must first force an arbitrary equal height so floating elements break evenly $elements.each(function() { var $that = $(this), display = $that.css('display'); // temporarily force a usable display value if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') { display = 'block'; } // cache the original inline style $that.data('style-cache', $that.attr('style')); $that.css({ 'display': display, 'padding-top': '0', 'padding-bottom': '0', 'margin-top': '0', 'margin-bottom': '0', 'border-top-width': '0', 'border-bottom-width': '0', 'height': '100px', 'overflow': 'hidden' }); }); // get the array of rows (based on element top position) rows = _rows($elements); // revert original inline styles $elements.each(function() { var $that = $(this); $that.attr('style', $that.data('style-cache') || ''); }); } $.each(rows, function(key, row) { var $row = $(row), targetHeight = 0; if (!opts.target) { // skip apply to rows with only one item if (opts.byRow && $row.length <= 1) { $row.css(opts.property, ''); return; } // iterate the row and find the max height $row.each(function(){ var $that = $(this), style = $that.attr('style'), display = $that.css('display'); // temporarily force a usable display value if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') { display = 'block'; } // ensure we get the correct actual height (and not a previously set height value) var css = { 'display': display }; css[opts.property] = ''; $that.css(css); // find the max height (including padding, but not margin) if ($that.outerHeight(false) > targetHeight) { targetHeight = $that.outerHeight(false); } // revert styles if (style) { $that.attr('style', style); } else { $that.css('display', ''); } }); } else { // if target set, use the height of the target element targetHeight = opts.target.outerHeight(false); } // iterate the row and apply the height to all elements $row.each(function(){ var $that = $(this), verticalPadding = 0; // don't apply to a target if (opts.target && $that.is(opts.target)) { return; } // handle padding and border correctly (required when not using border-box) if ($that.css('box-sizing') !== 'border-box') { verticalPadding += _parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width')); verticalPadding += _parse($that.css('padding-top')) + _parse($that.css('padding-bottom')); } // set the height (accounting for padding and border) $that.css(opts.property, (targetHeight - verticalPadding) + 'px'); }); }); // revert hidden parents $hiddenParents.each(function() { var $that = $(this); $that.attr('style', $that.data('style-cache') || null); }); // restore scroll position if enabled if (matchHeight._maintainScroll) { $(window).scrollTop((scrollTop / htmlHeight) * $('html').outerHeight(true)); } return this; }; /* * matchHeight._applyDataApi * applies matchHeight to all elements with a data-match-height attribute */ matchHeight._applyDataApi = function() { var groups = {}; // generate groups by their groupId set by elements using data-match-height $('[data-match-height], [data-mh]').each(function() { var $this = $(this), groupId = $this.attr('data-mh') || $this.attr('data-match-height'); if (groupId in groups) { groups[groupId] = groups[groupId].add($this); } else { groups[groupId] = $this; } }); // apply matchHeight to each group $.each(groups, function() { this.matchHeight(true); }); }; /* * matchHeight._update * updates matchHeight on all current groups with their correct options */ var _update = function(event) { if (matchHeight._beforeUpdate) { matchHeight._beforeUpdate(event, matchHeight._groups); } $.each(matchHeight._groups, function() { matchHeight._apply(this.elements, this.options); }); if (matchHeight._afterUpdate) { matchHeight._afterUpdate(event, matchHeight._groups); } }; matchHeight._update = function(throttle, event) { // prevent update if fired from a resize event // where the viewport width hasn't actually changed // fixes an event looping bug in IE8 if (event && event.type === 'resize') { var windowWidth = $(window).width(); if (windowWidth === _previousResizeWidth) { return; } _previousResizeWidth = windowWidth; } // throttle updates if (!throttle) { _update(event); } else if (_updateTimeout === -1) { _updateTimeout = setTimeout(function() { _update(event); _updateTimeout = -1; }, matchHeight._throttle); } }; /* * bind events */ // apply on DOM ready event $(matchHeight._applyDataApi); // use on or bind where supported var on = $.fn.on ? 'on' : 'bind'; // update heights on load and resize events $(window)[on]('load', function(event) { matchHeight._update(false, event); }); // throttled update heights on resize events $(window)[on]('resize orientationchange', function(event) { matchHeight._update(true, event); }); }); /*! waitForImages jQuery Plugin - v2.4.0 - 2018-02-13 * https://github.com/alexanderdickson/waitForImages * Copyright (c) 2018 Alex Dickson; Licensed MIT */ ;(function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof exports === 'object') { // CommonJS / nodejs module module.exports = factory(require('jquery')); } else { // Browser globals factory(jQuery); } }(function ($) { // Namespace all events. var eventNamespace = 'waitForImages'; // Is srcset supported by this browser? var hasSrcset = (function(img) { return img.srcset && img.sizes; })(new Image()); // CSS properties which contain references to images. $.waitForImages = { hasImageProperties: [ 'backgroundImage', 'listStyleImage', 'borderImage', 'borderCornerImage', 'cursor' ], hasImageAttributes: ['srcset'] }; // Custom selector to find all `img` elements with a valid `src` attribute. $.expr.pseudos['has-src'] = function (obj) { // Ensure we are dealing with an `img` element with a valid // `src` attribute. return $(obj).is('img[src][src!=""]'); }; // Custom selector to find images which are not already cached by the // browser. $.expr.pseudos.uncached = function (obj) { // Ensure we are dealing with an `img` element with a valid // `src` attribute. if (!$(obj).is(':has-src')) { return false; } return !obj.complete; }; $.fn.waitForImages = function () { var allImgsLength = 0; var allImgsLoaded = 0; var deferred = $.Deferred(); var originalCollection = this; var allImgs = []; // CSS properties which may contain an image. var hasImgProperties = $.waitForImages.hasImageProperties || []; // Element attributes which may contain an image. var hasImageAttributes = $.waitForImages.hasImageAttributes || []; // To match `url()` references. // Spec: http://www.w3.org/TR/CSS2/syndata.html#value-def-uri var matchUrl = /url\(\s*(['"]?)(.*?)\1\s*\)/g; var finishedCallback; var eachCallback; var waitForAll; // Handle options object (if passed). if ($.isPlainObject(arguments[0])) { waitForAll = arguments[0].waitForAll; eachCallback = arguments[0].each; finishedCallback = arguments[0].finished; } else { // Handle if using deferred object and only one param was passed in. if (arguments.length === 1 && $.type(arguments[0]) === 'boolean') { waitForAll = arguments[0]; } else { finishedCallback = arguments[0]; eachCallback = arguments[1]; waitForAll = arguments[2]; } } // Handle missing callbacks. finishedCallback = finishedCallback || $.noop; eachCallback = eachCallback || $.noop; // Convert waitForAll to Boolean. waitForAll = !! waitForAll; // Ensure callbacks are functions. if (!$.isFunction(finishedCallback) || !$.isFunction(eachCallback)) { throw new TypeError('An invalid callback was supplied.'); } this.each(function () { // Build a list of all imgs, dependent on what images will // be considered. var obj = $(this); if (waitForAll) { // Get all elements (including the original), as any one of // them could have a background image. obj.find('*').addBack().each(function () { var element = $(this); // If an `img` element, add it. But keep iterating in // case it has a background image too. if (element.is('img:has-src') && !element.is('[srcset]')) { allImgs.push({ src: element.attr('src'), element: element[0] }); } $.each(hasImgProperties, function (i, property) { var propertyValue = element.css(property); var match; // If it doesn't contain this property, skip. if (!propertyValue) { return true; } // Get all url() of this element. while (match = matchUrl.exec(propertyValue)) { allImgs.push({ src: match[2], element: element[0] }); } }); $.each(hasImageAttributes, function (i, attribute) { var attributeValue = element.attr(attribute); var attributeValues; // If it doesn't contain this property, skip. if (!attributeValue) { return true; } allImgs.push({ src: element.attr('src'), srcset: element.attr('srcset'), element: element[0] }); }); }); } else { // For images only, the task is simpler. obj.find('img:has-src') .each(function () { allImgs.push({ src: this.src, element: this }); }); } }); allImgsLength = allImgs.length; allImgsLoaded = 0; // If no images found, don't bother. if (allImgsLength === 0) { finishedCallback.call(originalCollection); deferred.resolveWith(originalCollection); } // Now that we've found all imgs in all elements in this, // load them and attach callbacks. $.each(allImgs, function (i, img) { var image = new Image(); var events = 'load.' + eventNamespace + ' error.' + eventNamespace; // Handle the image loading and error with the same callback. $(image).one(events, function me (event) { // If an error occurred with loading the image, set the // third argument accordingly. var eachArguments = [ allImgsLoaded, allImgsLength, event.type == 'load' ]; allImgsLoaded++; eachCallback.apply(img.element, eachArguments); deferred.notifyWith(img.element, eachArguments); // Unbind the event listeners. I use this in addition to // `one` as one of those events won't be called (either // 'load' or 'error' will be called). $(this).off(events, me); if (allImgsLoaded == allImgsLength) { finishedCallback.call(originalCollection[0]); deferred.resolveWith(originalCollection[0]); return false; } }); if (hasSrcset && img.srcset) { image.srcset = img.srcset; image.sizes = img.sizes; } image.src = img.src; }); return deferred.promise(); }; })); /* jQuery-FontSpy.js v3.0.0 * https://github.com/patrickmarabeas/jQuery-FontSpy.js * * Copyright 2013, Patrick Marabeas http://pulse-dev.com * Released under the MIT license * http://opensource.org/licenses/mit-license.php * * Date: 02/11/2015 */ (function( w, $ ) { fontSpy = function ( fontName, conf ) { var $html = $('html'), $body = $('body'), fontFamilyName = fontName; // Throw error if fontName is not a string or not is left as an empty string if (typeof fontFamilyName !== 'string' || fontFamilyName === '') { throw 'A valid fontName is required. fontName must be a string and must not be an empty string.'; } var defaults = { font: fontFamilyName, fontClass: fontFamilyName.toLowerCase().replace( /\s/g, '' ), success: function() {}, failure: function() {}, testFont: 'Courier New', testString: 'QW@HhsXJ', glyphs: '', delay: 50, timeOut: 1000, callback: $.noop }; var config = $.extend( defaults, conf ); var $tester = $('' + config.testString+config.glyphs + '') .css('position', 'absolute') .css('top', '-9999px') .css('left', '-9999px') .css('visibility', 'hidden') .css('fontFamily', config.testFont) .css('fontSize', '250px'); $body.append($tester); var fallbackFontWidth = $tester.outerWidth(); $tester.css('fontFamily', config.font + ',' + config.testFont); var failure = function () { $html.addClass("no-"+config.fontClass); if( config && config.failure ) { config.failure(); } config.callback(new Error('FontSpy timeout')); $tester.remove(); }; var success = function () { config.callback(); $html.addClass(config.fontClass); if( config && config.success ) { config.success(); } $tester.remove(); }; var retry = function () { setTimeout(checkFont, config.delay); config.timeOut = config.timeOut - config.delay; }; var checkFont = function () { var loadedFontWidth = $tester.outerWidth(); if (fallbackFontWidth !== loadedFontWidth){ success(); } else if(config.timeOut < 0) { failure(); } else { retry(); } } checkFont(); } })( this, jQuery ); /* Plugin Name: jQuery.pin https://github.com/webpop/jquery.pin Licensed under the terms of the MIT license. */ (function ($) { "use strict"; $.fn.pin = function (options) { var scrollY = 0, elements = [], disabled = false, $window = $(window); options = options || {}; var recalculateLimits = function () { for (var i=0, len=elements.length; i"); } var pad = $.extend({ top: 0, bottom: 0 }, options.padding || {}); $this.data("pin", { pad: pad, from: (options.containerSelector ? containerOffset.top : offset.top) - pad.top, to: containerOffset.top + $container.height() - $this.outerHeight() - pad.bottom, end: containerOffset.top + $container.height(), parentTop: parentOffset.top }); $this.css({width: $this.outerWidth()}); $this.parent().css("height", $this.outerHeight()); } }; var onScroll = function () { if (disabled) { return; } scrollY = $window.scrollTop(); var elmts = []; for (var i=0, len=elements.length; i data.end) { $this.css('position', ''); continue; } if (from < scrollY && to > scrollY) { !($this.css("position") == "fixed") && $this.css({ left: $this.offset().left, top: data.pad.top }).css("position", "fixed"); if (options.activeClass) { $this.addClass(options.activeClass); } } else if (scrollY >= to) { $this.css({ left: "", top: to - data.parentTop + data.pad.top }).css("position", "absolute"); if (options.activeClass) { $this.addClass(options.activeClass); } } else { $this.css({position: "", top: "", left: ""}); if (options.activeClass) { $this.removeClass(options.activeClass); } } } elements = elmts; }; var update = function () { recalculateLimits(); onScroll(); }; this.each(function () { var $this = $(this), data = $(this).data('pin') || {}; if (data && data.update) { return; } elements.push($this); $("img", this).one("load", recalculateLimits); data.update = update; $(this).data('pin', data); }); $window.scroll(onScroll); $window.resize(function () { recalculateLimits(); }); recalculateLimits(); $window.on('load', update); return this; }; })(jQuery); ( function( $ ) { "use strict"; // Define default settings var defaults = { action: function() {}, runOnLoad: false, duration: 500 }; // Define global variables var settings = defaults, running = false, start; var methods = {}; // Initial plugin configuration methods.init = function() { // Allocate passed arguments to settings based on type for( var i = 0; i <= arguments.length; i++ ) { var arg = arguments[i]; switch ( typeof arg ) { case "function": settings.action = arg; break; case "boolean": settings.runOnLoad = arg; break; case "number": settings.duration = arg; break; } } // Process each matching jQuery object return this.each(function() { if( settings.runOnLoad ) { settings.action(); } $(this).resize( function() { methods.timedAction.call( this ); } ); } ); }; methods.timedAction = function( code, millisec ) { var doAction = function() { var remaining = settings.duration; if( running ) { var elapse = new Date() - start; remaining = settings.duration - elapse; if( remaining <= 0 ) { // Clear timeout and reset running variable clearTimeout(running); running = false; // Perform user defined function settings.action(); return; } } wait( remaining ); }; var wait = function( time ) { running = setTimeout( doAction, time ); }; // Define new action starting time start = new Date(); // Define runtime settings if function is run directly if( typeof millisec === 'number' ) { settings.duration = millisec; } if( typeof code === 'function' ) { settings.action = code; } // Only run timed loop if not already running if( !running ) { doAction(); } }; $.fn.afterResize = function( method ) { if( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ) ); } else { return methods.init.apply( this, arguments ); } }; })(jQuery); /* Plugin Name: Animated Headlines Written by: Codyhouse - (https://codyhouse.co/demo/animated-headlines/index.html) */ jQuery(document).ready(function($) { //set animation timing var animationDelay = 2500, //loading bar effect barAnimationDelay = 3800, barWaiting = barAnimationDelay - 3000, //3000 is the duration of the transition on the loading bar - set in the scss/css file //letters effect lettersDelay = 50, //type effect typeLettersDelay = 150, selectionDuration = 500, typeAnimationDelay = selectionDuration + 800, //clip effect revealDuration = 600, revealAnimationDelay = 1500; initHeadline(); function initHeadline() { //initialise headline animation animateHeadline('.word-rotator', '.word-rotator.letters'); } function animateHeadline($selector) { var duration = animationDelay; theme.fn.intObs($selector, function(){ // Single Letters - Insert element for each letter of a changing word if( $(this).hasClass('letters') ) { $(this).find('b').each(function() { var word = $(this), letters = word.text().split(''), selected = word.hasClass('is-visible'); for (i in letters) { if (word.parents('.rotate-2').length > 0) letters[i] = '' + letters[i] + ''; letters[i] = (selected) ? '' + letters[i] + '' : '' + letters[i] + ''; } var newLetters = letters.join(''); word.html(newLetters).css('opacity', 1); }); } // Animate the Headline var headline = $(this); if (headline.hasClass('loading-bar')) { duration = barAnimationDelay; setTimeout(function() { headline.find('.word-rotator-words').addClass('is-loading') }, barWaiting); } else if (headline.hasClass('clip')) { var spanWrapper = headline.find('.word-rotator-words'), newWidth = spanWrapper.outerWidth() + 10 spanWrapper.css('width', newWidth); } else if (!headline.hasClass('type')) { //assign to .word-rotator-words the width of its longest word var words = headline.find('.word-rotator-words b'), width = 0; words.each(function() { var wordWidth = $(this).outerWidth(); if (wordWidth > width) width = wordWidth; }); headline.find('.word-rotator-words').css('width', width); }; // Trigger animation setTimeout(function() { hideWord(headline.find('.is-visible').eq(0)) }, duration); }, {}); } function hideWord($word) { var nextWord = takeNext($word); if ($word.parents('.word-rotator').hasClass('type')) { var parentSpan = $word.parent('.word-rotator-words'); parentSpan.addClass('selected').removeClass('waiting'); setTimeout(function() { parentSpan.removeClass('selected'); $word.removeClass('is-visible').addClass('is-hidden').children('i').removeClass('in').addClass('out'); }, selectionDuration); setTimeout(function() { showWord(nextWord, typeLettersDelay) }, typeAnimationDelay); } else if ($word.parents('.word-rotator').hasClass('letters')) { var bool = ($word.children('i').length >= nextWord.children('i').length) ? true : false; hideLetter($word.find('i').eq(0), $word, bool, lettersDelay); showLetter(nextWord.find('i').eq(0), nextWord, bool, lettersDelay); } else if ($word.parents('.word-rotator').hasClass('clip')) { $word.parents('.word-rotator-words').stop( true, true ).animate({ width: '2px' }, revealDuration, function() { switchWord($word, nextWord); showWord(nextWord); }); } else if ($word.parents('.word-rotator').hasClass('loading-bar')) { $word.parents('.word-rotator-words').removeClass('is-loading'); switchWord($word, nextWord); setTimeout(function() { hideWord(nextWord) }, barAnimationDelay); setTimeout(function() { $word.parents('.word-rotator-words').addClass('is-loading') }, barWaiting); } else { switchWord($word, nextWord); setTimeout(function() { hideWord(nextWord) }, animationDelay); } } function showWord($word, $duration) { if ($word.parents('.word-rotator').hasClass('type')) { showLetter($word.find('i').eq(0), $word, false, $duration); $word.addClass('is-visible').removeClass('is-hidden'); } else if ($word.parents('.word-rotator').hasClass('clip')) { if (document.hasFocus()) { $word.parents('.word-rotator-words').stop( true, true ).animate({ 'width': $word.outerWidth() + 10 }, revealDuration, function() { setTimeout(function() { hideWord($word) }, revealAnimationDelay); }); } else { $word.parents('.word-rotator-words').stop( true, true ).animate({ width: $word.outerWidth() + 10 }); setTimeout(function() { hideWord($word) }, revealAnimationDelay); } } } function hideLetter($letter, $word, $bool, $duration) { $letter.removeClass('in').addClass('out'); if (!$letter.is(':last-child')) { setTimeout(function() { hideLetter($letter.next(), $word, $bool, $duration); }, $duration); } else if ($bool) { setTimeout(function() { hideWord(takeNext($word)) }, animationDelay); } if ($letter.is(':last-child') && $('html').hasClass('no-csstransitions')) { var nextWord = takeNext($word); switchWord($word, nextWord); } } function showLetter($letter, $word, $bool, $duration) { $letter.addClass('in').removeClass('out'); if (!$letter.is(':last-child')) { setTimeout(function() { showLetter($letter.next(), $word, $bool, $duration); }, $duration); } else { if ($word.parents('.word-rotator').hasClass('type')) { setTimeout(function() { $word.parents('.word-rotator-words').addClass('waiting'); }, 200); } if (!$bool) { setTimeout(function() { hideWord($word) }, animationDelay) } if (!$word.closest('.word-rotator').hasClass('type')) { $word.closest('.word-rotator-words').stop( true, true ).animate({ width: $word.outerWidth() }); } } } function takeNext($word) { return (!$word.is(':last-child')) ? $word.next() : $word.parent().children().eq(0); } function takePrev($word) { return (!$word.is(':first-child')) ? $word.prev() : $word.parent().children().last(); } function switchWord($oldWord, $newWord) { $oldWord.removeClass('is-visible').addClass('is-hidden'); $newWord.removeClass('is-hidden').addClass('is-visible'); if (!$newWord.closest('.word-rotator').hasClass('clip')) { var space = 0, delay = ($newWord.outerWidth() > $oldWord.outerWidth()) ? 0 : 600; if ($newWord.closest('.word-rotator').hasClass('loading-bar') || $newWord.closest('.word-rotator').hasClass('slide')) { space = 3; delay = 0; } setTimeout(function() { $newWord.closest('.word-rotator-words').stop( true, true ).animate({ width: $newWord.outerWidth() + space }); }, delay); } } }); /* jQuery Hover3d ================================================= Version: 1.1.0 Author: Rian Ariona Website: http://ariona.net Docs: http://ariona.github.io/hover3d Repo: http://github.com/ariona/hover3d Issues: http://github.com/ariona/hover3d/issues */ (function($){ $.fn.hover3d = function(options){ var settings = $.extend({ selector : null, perspective : 1000, sensitivity : 20, invert : false, shine : false, hoverInClass : "hover-in", hoverOutClass : "hover-out", hoverClass : "hover-3d" }, options); return this.each(function(){ var $this = $(this), $card = $this.find(settings.selector); currentX = 0; currentY = 0; if( settings.shine ){ $card.append('
'); } var $shine = $(this).find(".shine"); // Set perspective and transformStyle value // for element and 3d object $this.css({ perspective: settings.perspective+"px", transformStyle: "preserve-3d" }); $card.css({ perspective: settings.perspective+"px", transformStyle: "preserve-3d", }); $shine.css({ position : "absolute", top : 0, left : 0, bottom : 0, right : 0, transform : 'translateZ(1px)', "z-index" : 9 }); // Mouse Enter function, this will add hover-in // Class so when mouse over it will add transition // based on hover-in class function enter(event){ $card.addClass(settings.hoverInClass+" "+settings.hoverClass); currentX = currentY = 0; setTimeout(function(){ $card.removeClass(settings.hoverInClass); }, 1000); } // Mouse movement Parallax effect function move(event){ var w = $card.innerWidth(), h = $card.innerHeight(), currentX = Math.round(event.pageX - $card.offset().left), currentY = Math.round(event.pageY - $card.offset().top), ax = settings.invert ? ( w / 2 - currentX)/settings.sensitivity : -( w / 2 - currentX)/settings.sensitivity, ay = settings.invert ? -( h / 2 - currentY)/settings.sensitivity : ( h / 2 - currentY)/settings.sensitivity, dx = currentX - w / 2, dy = currentY - h / 2, theta = Math.atan2(dy, dx), angle = theta * 180 / Math.PI - 90; if (angle < 0) { angle = angle + 360; } $card.css({ perspective : settings.perspective+"px", transformStyle : "preserve-3d", transform : "rotateY("+ax+"deg) rotateX("+ay+"deg)" }); $shine.css('background', 'linear-gradient(' + angle + 'deg, rgba(255,255,255,' + event.offsetY / h * .5 + ') 0%,rgba(255,255,255,0) 80%)'); } // Mouse leave function, will set the transform // property to 0, and add transition class // for exit animation function leave(){ $card.addClass(settings.hoverOutClass+" "+settings.hoverClass); $card.css({ perspective : settings.perspective+"px", transformStyle : "preserve-3d", transform : "rotateX(0) rotateY(0)" }); setTimeout( function(){ $card.removeClass(settings.hoverOutClass+" "+settings.hoverClass); currentX = currentY = 0; }, 1000 ); } // Mouseenter event binding $this.on( "mouseenter", function(){ return enter(); }); // Mousemove event binding $this.on( "mousemove", function(event){ return move(event); }); // Mouseleave event binding $this.on( "mouseleave", function(){ return leave(); }); }); }; }(jQuery)); /** * jquery.hoverdir.js v1.1.0 * http://www.codrops.com * * Licensed under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * Copyright 2012, Codrops * http://www.codrops.com */ ;( function( $, window, undefined ) { 'use strict'; $.HoverDir = function( options, element ) { this.$el = $( element ); this._init( options ); }; // the options $.HoverDir.defaults = { speed : 300, easing : 'ease', hoverDelay : 0, inverse : false, hoverElem: '.thumb-info-wrapper-overlay' }; $.HoverDir.prototype = { _init : function( options ) { // options this.options = $.extend( true, {}, $.HoverDir.defaults, options ); // transition properties this.transitionProp = 'all ' + this.options.speed + 'ms ' + this.options.easing; // support for CSS transitions this.support = Modernizr.csstransitions; // load the events this._loadEvents(); }, _loadEvents : function() { var self = this; this.$el.on( 'mouseenter.hoverdir, mouseleave.hoverdir', function( event ) { var $el = $( this ), $hoverElem = $el.find( self.options.hoverElem ), direction = self._getDir( $el, { x : event.pageX, y : event.pageY } ), styleCSS = self._getStyle( direction ); if( event.type === 'mouseenter' ) { $hoverElem.hide().css( styleCSS.from ); clearTimeout( self.tmhover ); self.tmhover = setTimeout( function() { $hoverElem.show( 0, function() { var $el = $( this ); if( self.support ) { $el.css( 'transition', self.transitionProp ); } self._applyAnimation( $el, styleCSS.to, self.options.speed ); } ); }, self.options.hoverDelay ); } else { if( self.support ) { $hoverElem.css( 'transition', self.transitionProp ); } clearTimeout( self.tmhover ); self._applyAnimation( $hoverElem, styleCSS.from, self.options.speed ); } } ); }, // credits : http://stackoverflow.com/a/3647634 _getDir : function( $el, coordinates ) { // the width and height of the current div var w = $el.width(), h = $el.height(), // calculate the x and y to get an angle to the center of the div from that x and y. // gets the x value relative to the center of the DIV and "normalize" it x = ( coordinates.x - $el.offset().left - ( w/2 )) * ( w > h ? ( h/w ) : 1 ), y = ( coordinates.y - $el.offset().top - ( h/2 )) * ( h > w ? ( w/h ) : 1 ), // the angle and the direction from where the mouse came in/went out clockwise (TRBL=0123); // first calculate the angle of the point, // add 180 deg to get rid of the negative values // divide by 90 to get the quadrant // add 3 and do a modulo by 4 to shift the quadrants to a proper clockwise TRBL (top/right/bottom/left) **/ direction = Math.round( ( ( ( Math.atan2(y, x) * (180 / Math.PI) ) + 180 ) / 90 ) + 3 ) % 4; return direction; }, _getStyle : function( direction ) { var fromStyle, toStyle, slideFromTop = { left : '0px', top : '-100%' }, slideFromBottom = { left : '0px', top : '100%' }, slideFromLeft = { left : '-100%', top : '0px' }, slideFromRight = { left : '100%', top : '0px' }, slideTop = { top : '0px' }, slideLeft = { left : '0px' }; switch( direction ) { case 0: // from top fromStyle = !this.options.inverse ? slideFromTop : slideFromBottom; toStyle = slideTop; break; case 1: // from right fromStyle = !this.options.inverse ? slideFromRight : slideFromLeft; toStyle = slideLeft; break; case 2: // from bottom fromStyle = !this.options.inverse ? slideFromBottom : slideFromTop; toStyle = slideTop; break; case 3: // from left fromStyle = !this.options.inverse ? slideFromLeft : slideFromRight; toStyle = slideLeft; break; }; return { from : fromStyle, to : toStyle }; }, // apply a transition or fallback to jquery animate based on Modernizr.csstransitions support _applyAnimation : function( el, styleCSS, speed ) { $.fn.applyStyle = this.support ? $.fn.css : $.fn.animate; el.stop().applyStyle( styleCSS, $.extend( true, [], { duration : speed + 'ms' } ) ); }, }; var logError = function( message ) { if ( window.console ) { window.console.error( message ); } }; $.fn.hoverdir = function( options ) { var instance = $.data( this, 'hoverdir' ); if ( typeof options === 'string' ) { var args = Array.prototype.slice.call( arguments, 1 ); this.each(function() { if ( !instance ) { logError( "cannot call methods on hoverdir prior to initialization; " + "attempted to call method '" + options + "'" ); return; } if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) { logError( "no such method '" + options + "' for hoverdir instance" ); return; } instance[ options ].apply( instance, args ); }); } else { this.each(function() { if ( instance ) { instance._init(); } else { instance = $.data( this, 'hoverdir', new $.HoverDir( options, this ) ); } }); } return instance; }; } )( jQuery, window ); /*! * GSAP 3.9.1 * https://greensock.com * * @license Copyright 2021, GreenSock. All rights reserved. * Subject to the terms at https://greensock.com/standard-license or for Club GreenSock members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(e){"use strict";function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t){return"string"==typeof t}function p(t){return"function"==typeof t}function q(t){return"number"==typeof t}function r(t){return void 0===t}function s(t){return"object"==typeof t}function t(t){return!1!==t}function u(){return"undefined"!=typeof window}function v(t){return p(t)||o(t)}function M(t){return(h=mt(t,ot))&&oe}function N(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")}function O(t,e){return!e&&console.warn(t)}function P(t,e){return t&&(ot[t]=e)&&h&&(h[t]=e)||ot}function Q(){return 0}function $(t){var e,r,i=t[0];if(s(i)||p(i)||(t=[t]),!(e=(i._gsap||{}).harness)){for(r=ct.length;r--&&!ct[r].targetTest(i););e=ct[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Lt(t[r],e)))||t.splice(r,1);return t}function _(t){return t._gsap||$(xt(t))[0]._gsap}function aa(t,e,i){return(i=t[e])&&p(i)?t[e]():r(i)&&t.getAttribute&&t.getAttribute(e)||i}function ba(t,e){return(t=t.split(",")).forEach(e)||t}function ca(t){return Math.round(1e5*t)/1e5||0}function da(t){return Math.round(1e7*t)/1e7||0}function ea(t,e){for(var r=e.length,i=0;t.indexOf(e[i])<0&&++it._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t}function wa(t){return t._repeat?gt(t._tTime,t=t.duration()+t._rDelay)*t:0}function ya(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function za(t){return t._end=da(t._start+(t._tDur/Math.abs(t._ts||t._rts||X)||0))}function Aa(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=da(r._time-(0X)&&e.render(r,!0)),ta(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dura;)s=s._prev;s?(e._next=s._next,s._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[i]=e,e._prev=s,e.parent=e._dp=t}(t,e,"_first","_last",t._sort?"_start":0),vt(e)||(t._recent=e),i||Ba(t,e),t}function Da(t,e){return(ot.ScrollTrigger||N("scrollTrigger",e))&&ot.ScrollTrigger.create(e,t)}function Ea(t,e,r,i){return jt(t,e),t._initted?!r&&t._pt&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&f!==St.frame?(ht.push(t),t._lazy=[e,i],1):void 0:1}function Ja(t,e,r,i){var n=t._repeat,a=da(e)||0,s=t._tTime/t._tDur;return s&&!i&&(t._time*=a/t._dur),t._dur=a,t._tDur=n?n<0?1e10:da(a*(n+1)+t._rDelay*n):a,0(n=Math.abs(n))&&(a=i,o=n);return a}function lb(t){return sa(t),t.scrollTrigger&&t.scrollTrigger.kill(!1),t.progress()<1&&Mt(t,"onInterrupt"),t}function qb(t,e,r){return(6*(t+=t<0?1:1>16,t>>8&kt,t&kt]:0:Ct.black;if(!p){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),Ct[t])p=Ct[t];else if("#"===t.charAt(0)){if(t.length<6&&(t="#"+(i=t.charAt(1))+i+(n=t.charAt(2))+n+(a=t.charAt(3))+a+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(p=parseInt(t.substr(1,6),16))>>16,p>>8&kt,p&kt,parseInt(t.substr(7),16)/255];p=[(t=parseInt(t.substr(1),16))>>16,t>>8&kt,t&kt]}else if("hsl"===t.substr(0,3))if(p=d=t.match(tt),e){if(~t.indexOf("="))return p=t.match(et),r&&p.length<4&&(p[3]=1),p}else s=+p[0]%360/360,o=p[1]/100,i=2*(u=p[2]/100)-(n=u<=.5?u*(o+1):u+o-u*o),3=j?u.endTime(!1):t._dur;return o(e)&&(isNaN(e)||e in s)?(n=e.charAt(0),a="%"===e.substr(-1),i=e.indexOf("="),"<"===n||">"===n?(0<=i&&(e=e.replace(/=/,"")),("<"===n?u._start:u.endTime(0<=u._repeat))+(parseFloat(e.substr(1))||0)*(a?(i<0?u:r).totalDuration()/100:1)):i<0?(e in s||(s[e]=h),s[e]):(n=parseFloat(e.charAt(i-1)+e.substr(i+1)),a&&r&&(n=n/100*(W(r)?r[0]:r).totalDuration()),1=r&&te)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if("isPause"===i.data&&i._start=n._start)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0=this.totalDuration()||!v&&_)&&(f!==this._start&&Math.abs(l)===Math.abs(this._ts)||this._lock||(!t&&g||!(v===m&&0=i&&(a instanceof Jt?e&&n.push(a):(r&&n.push(a),t&&n.push.apply(n,a.getChildren(!0,e,r)))),a=a._next;return n},e.getById=function getById(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},e.remove=function remove(t){return o(t)?this.removeLabel(t):p(t)?this.killTweensOf(t):(ra(this,t),t===this._recent&&(this._recent=this._last),ta(this))},e.totalTime=function totalTime(t,e){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=da(St.time-(0e:!e||a.isActive())&&i.push(a):(r=a.getTweensOf(n,e)).length&&i.push.apply(i,r),a=a._next;return i},e.tweenTo=function tweenTo(t,e){e=e||{};var r,i=this,n=bt(i,t),a=e.startAt,s=e.onStart,o=e.onStartParams,u=e.immediateRender,h=Jt.to(i,ja({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale())||X,onStart:function onStart(){if(i.pause(),!r){var t=e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale());h._dur!==t&&Ja(h,t,0,1).render(h._time,!0,!0),r=1}s&&s.apply(h,o||[])}},e));return u?h.render(0):h},e.tweenFromTo=function tweenFromTo(t,e,r){return this.tweenTo(e,ja({startAt:{time:bt(this,t)}},r))},e.recent=function recent(){return this._recent},e.nextLabel=function nextLabel(t){return void 0===t&&(t=this._time),jb(this,bt(this,t))},e.previousLabel=function previousLabel(t){return void 0===t&&(t=this._time),jb(this,bt(this,t),1)},e.currentLabel=function currentLabel(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+X)},e.shiftChildren=function shiftChildren(t,e,r){void 0===r&&(r=0);for(var i,n=this._first,a=this.labels;n;)n._start>=r&&(n._start+=t,n._end+=t),n=n._next;if(e)for(i in a)a[i]>=r&&(a[i]+=t);return ta(this)},e.invalidate=function invalidate(){var t=this._first;for(this._lock=0;t;)t.invalidate(),t=t._next;return n.prototype.invalidate.call(this)},e.clear=function clear(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),ta(this)},e.totalDuration=function totalDuration(t){var e,r,i,n=0,a=this,s=a._last,o=j;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-t:t));if(a._dirty){for(i=a.parent;s;)e=s._prev,s._dirty&&s.totalDuration(),o<(r=s._start)&&a._sort&&s._ts&&!a._lock?(a._lock=1,Ca(a,s,r-s._delay,1)._lock=0):o=r,r<0&&s._ts&&(n-=r,(!i&&!a._dp||i&&i.smoothChildTiming)&&(a._start+=r/a._ts,a._time-=r,a._tTime-=r),a.shiftChildren(-r,!1,-Infinity),o=0),s._end>n&&s._ts&&(n=s._end),s=e;Ja(a,a===I&&a._time>n?a._time:n,1,1),a._dirty=0}return a._tDur},Timeline.updateRoot=function updateRoot(t){if(I._ts&&(ga(I,ya(t,I)),f=St.frame),St.frame>=pt){pt+=Y.autoSleep||120;var e=I._first;if((!e||!e._ts)&&Y.autoSleep&&St._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||St.sleep()}}},Timeline}(qt);ja(Nt.prototype,{_lock:0,_hasPause:0,_forcing:0});function Tb(t,e,r,i,n,a){var u,h,l,f;if(ft[t]&&!1!==(u=new ft[t]).init(n,u.rawVars?e[t]:function _processVars(t,e,r,i,n){if(p(t)&&(t=Xt(t,n,e,r,i)),!s(t)||t.style&&t.nodeType||W(t)||H(t))return o(t)?Xt(t,n,e,r,i):t;var a,u={};for(a in t)u[a]=Xt(t[a],n,e,r,i);return u}(e[t],i,n,a,r),r,i,a)&&(r._pt=h=new ae(r._pt,n,t,0,1,u.render,u,0,u.priority),r!==d))for(l=r._ptLookup[r._targets.indexOf(n)],f=u._props.length;f--;)l[u._props[f]]=h;return u}function Xb(t,r,e,i){var n,a,s=r.ease||i||"power1.inOut";if(W(r))a=e[t]||(e[t]=[]),r.forEach(function(t,e){return a.push({t:e/(r.length-1)*100,v:t,e:s})});else for(n in r)a=e[n]||(e[n]=[]),"ease"===n||a.push({t:parseFloat(t),v:r[n],e:s})}var Qt,Yt=function _addPropTween(t,e,r,i,n,a,s,u,h){p(i)&&(i=i(n||0,t,a));var l,f=t[e],d="get"!==r?r:p(f)?h?t[e.indexOf("set")||!p(t["get"+e.substr(3)])?e:"get"+e.substr(3)](h):t[e]():f,c=p(f)?h?Zt:$t:Gt;if(o(i)&&(~i.indexOf("random(")&&(i=gb(i)),"="===i.charAt(1)&&(!(l=parseFloat(d)+parseFloat(i.substr(2))*("-"===i.charAt(0)?-1:1)+(Qa(d)||0))&&0!==l||(i=l))),d!==i)return isNaN(d*i)||""===i?(f||e in t||N(e,i),function _addComplexStringPropTween(t,e,r,i,n,a,s){var o,u,h,l,f,d,p,c,_=new ae(this._pt,t,e,0,1,te,null,n),m=0,g=0;for(_.b=r,_.e=i,r+="",(p=~(i+="").indexOf("random("))&&(i=gb(i)),a&&(a(c=[r,i],t,e),r=c[0],i=c[1]),u=r.match(it)||[];o=it.exec(i);)l=o[0],f=i.substring(m,o.index),h?h=(h+1)%5:"rgba("===f.substr(-5)&&(h=1),l!==u[g++]&&(d=parseFloat(u[g-1])||0,_._pt={_next:_._pt,p:f||1===g?f:",",s:d,c:"="===l.charAt(1)?parseFloat(l.substr(2))*("-"===l.charAt(0)?-1:1):parseFloat(l)-d,m:h&&h<4?Math.round:0},m=it.lastIndex);return _.c=m")});else{for(f in h={},w)"ease"===f||"easeEach"===f||Xb(f,w[f],h,w.easeEach);for(f in h)for(A=h[f].sort(function(t,e){return t.t-e.t}),u=z=0;u=t._tDur||e<0)&&t.ratio===u&&(u&&sa(t,1),r||(Mt(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},e.targets=function targets(){return this._targets},e.invalidate=function invalidate(){return this._pt=this._op=this._startAt=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(),F.prototype.invalidate.call(this)},e.kill=function kill(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?lb(this):this;if(this.timeline){var r=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Qt&&!0!==Qt.vars.overwrite)._first||lb(this),this.parent&&r!==this.timeline.totalDuration()&&Ja(this,this._dur*this.timeline._tDur/r,0,1),this}var i,n,a,s,u,h,l,f=this._targets,d=t?xt(t):f,p=this._ptLookup,c=this._pt;if((!e||"all"===e)&&function _arraysMatch(t,e){for(var r=t.length,i=r===e.length;i&&r--&&t[r]===e[r];);return r<0}(f,d))return"all"===e&&(this._pt=0),lb(this);for(i=this._op=this._op||[],"all"!==e&&(o(e)&&(u={},ba(e,function(t){return u[t]=1}),e=u),e=function _addAliasesToVars(t,e){var r,i,n,a,s=t[0]?_(t[0]).harness:0,o=s&&s.aliases;if(!o)return e;for(i in r=mt({},e),o)if(i in r)for(n=(a=o[i].split(",")).length;n--;)r[a[n]]=r[i];return r}(f,e)),l=f.length;l--;)if(~d.indexOf(f[l]))for(u in n=p[l],"all"===e?(i[l]=e,s=n,a={}):(a=i[l]=i[l]||{},s=e),s)(h=n&&n[u])&&("kill"in h.d&&!0!==h.d.kill(u)||ra(this,h,"_pt"),delete n[u]),"all"!==a&&(a[u]=1);return this._initted&&!this._pt&&c&&lb(this),this},Tween.to=function to(t,e,r){return new Tween(t,e,r)},Tween.from=function from(t,e){return Na(1,arguments)},Tween.delayedCall=function delayedCall(t,e,r,i){return new Tween(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},Tween.fromTo=function fromTo(t,e,r){return Na(2,arguments)},Tween.set=function set(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new Tween(t,e)},Tween.killTweensOf=function killTweensOf(t,e,r){return I.killTweensOf(t,e,r)},Tween}(qt);ja(Jt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ba("staggerTo,staggerFrom,staggerFromTo",function(r){Jt[r]=function(){var t=new Nt,e=wt.call(arguments,0);return e.splice("staggerFromTo"===r?5:4,0,0),t[r].apply(t,e)}});function dc(t,e,r){return t.setAttribute(e,r)}function lc(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)}var Gt=function _setterPlain(t,e,r){return t[e]=r},$t=function _setterFunc(t,e,r){return t[e](r)},Zt=function _setterFuncWithParam(t,e,r,i){return t[e](i.fp,r)},Kt=function _getSetter(t,e){return p(t[e])?$t:r(t[e])&&t.setAttribute?dc:Gt},Ht=function _renderPlain(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},Wt=function _renderBoolean(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},te=function _renderComplexString(t,e){var r=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+i,r=r._next;i+=e.c}e.set(e.t,e.p,i,e)},ee=function _renderPropTweens(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},re=function _addPluginModifier(t,e,r,i){for(var n,a=this._pt;a;)n=a._next,a.p===i&&a.modifier(t,e,r),a=n},ie=function _killPropTweensOf(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?ra(this,i,"_pt"):i.dep||(e=1),i=r;return!e},ne=function _sortPropTweensByPriority(t){for(var e,r,i,n,a=t._pt;a;){for(e=a._next,r=i;r&&r.pr>a.pr;)r=r._next;(a._prev=r?r._prev:n)?a._prev._next=a:i=a,(a._next=r)?r._prev=a:n=a,a=e}t._pt=i},ae=(PropTween.prototype.modifier=function modifier(t,e,r){this.mSet=this.mSet||this.set,this.set=lc,this.m=t,this.mt=r,this.tween=e},PropTween);function PropTween(t,e,r,i,n,a,s,o,u){this.t=e,this.s=i,this.c=n,this.p=r,this.r=a||Ht,this.d=s||this,this.set=o||Gt,this.pr=u||0,(this._next=t)&&(t._prev=this)}ba(_t+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(t){return ut[t]=1}),ot.TweenMax=ot.TweenLite=Jt,ot.TimelineLite=ot.TimelineMax=Nt,I=new Nt({sortChildren:!1,defaults:L,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Y.stringFilter=wb;var se={registerPlugin:function registerPlugin(){for(var t=arguments.length,e=new Array(t),r=0;r'), $pageHeaderTitle = $('[data-title-border]'), $window = $(window); $pageHeaderTitle.before($pageHeaderTitleBorder); var setPageHeaderTitleBorderWidth = function() { $pageHeaderTitleBorder.width($pageHeaderTitle.width()); } $window.afterResize(function(){ setPageHeaderTitleBorderWidth(); }); setPageHeaderTitleBorderWidth(); $pageHeaderTitleBorder.addClass('visible'); } /* * Footer Reveal */ (function($) { var $footerReveal = { $wrapper: $('.footer-reveal'), init: function() { var self = this; self.build(); self.events(); }, build: function() { var self = this, footer_height = self.$wrapper.outerHeight(true), window_height = ( $(window).height() - $('.header-body').height() ); if( footer_height > window_height ) { $('#footer').removeClass('footer-reveal'); $('body').css('margin-bottom', 0); } else { $('#footer').addClass('footer-reveal'); $('body').css('margin-bottom', footer_height); } }, events: function() { var self = this, $window = $(window); $window.on('load', function(){ $window.afterResize(function(){ self.build(); }); }); } } if( $('.footer-reveal').length ) { $footerReveal.init(); } })(jQuery); /* Re-Init Plugin */ if( $('[data-reinit-plugin]').length ) { $('[data-reinit-plugin]').on('click', function(e) { e.preventDefault(); var pluginInstance = $(this).data('reinit-plugin'), pluginFunction = $(this).data('reinit-plugin-function'), pluginElement = $(this).data('reinit-plugin-element'), pluginOptions = theme.fn.getOptions($(this).data('reinit-plugin-options')); $( pluginElement ).data( pluginInstance ).destroy(); setTimeout(function(){ theme.fn.execPluginFunction(pluginFunction, $( pluginElement ), pluginOptions); }, 1000); }); } /* Simple Copy To Clipboard */ if( $('[data-copy-to-clipboard]').length ) { theme.fn.intObs( '[data-copy-to-clipboard]', function(){ var $this = $(this); $this.wrap( '
' ); var $copyButton = $('COPY'); $this.parent().prepend( $copyButton ); $copyButton.on('click', function(e){ e.preventDefault(); var $btn = $(this), $temp = $('