/*------------------------------------------------------------------------- 1. Plugin Init 2. Helper Functions 3. Shortcode Stuff 4. Header + Search 5. Page Specific 6. Scroll to top 7. Cross Browser Fixes -------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/ /* 1. Plugin Init /*-------------------------------------------------------------------------*/ /*! Waypoints - 4.0.1 */ !function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.Context.refreshAll();for(var e in i)i[e].enabled=!0;return this},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,n.windowContext||(n.windowContext=!0,n.windowContext=new e(window)),this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical),i=this.element==this.element.window;t&&e&&!i&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s];if(null!==a.triggerPoint){var l=o.oldScroll=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=Math.floor(y+l-f),h=w=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); //visible !function(t){var i=t(window);t.fn.visible=function(t,e,o){if(!(this.length<1)){var r=this.length>1?this.eq(0):this,n=r.get(0),f=i.width(),h=i.height(),o=o?o:"both",l=e===!0?n.offsetWidth*n.offsetHeight:!0;if("function"==typeof n.getBoundingClientRect){var g=n.getBoundingClientRect(),u=g.top>=0&&g.top0&&g.bottom<=h,c=g.left>=0&&g.left0&&g.right<=f,v=t?u||s:u&&s,b=t?c||a:c&&a;if("both"===o)return l&&v&&b;if("vertical"===o)return l&&v;if("horizontal"===o)return l&&b}else{var d=i.scrollTop(),p=d+h,w=i.scrollLeft(),m=w+f,y=r.offset(),z=y.top,B=z+r.height(),C=y.left,R=C+r.width(),j=t===!0?B:z,q=t===!0?z:B,H=t===!0?R:C,L=t===!0?C:R;if("both"===o)return!!l&&p>=q&&j>=d&&m>=L&&H>=w;if("vertical"===o)return!!l&&p>=q&&j>=d;if("horizontal"===o)return!!l&&m>=L&&H>=w}}}}(jQuery); /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ */ jQuery.easing["jswing"]=jQuery.easing["swing"];jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(hb&&(b+=1);1b?c:b<2/3?a+(c-a)*(2/3-b)*6:a}var d=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(a);a=parseInt(d[1])/360;var b=parseInt(d[2])/100,f=parseInt(d[3])/100,d=d[4]||1;if(0==b)f=b=a=f;else{var n=.5>f?f*(1+b):f+b-f*b,k=2*f-n,f=c(k,n,a+1/3),b=c(k,n,a);a=c(k,n,a-1/3)}return"rgba("+ 255*f+","+255*b+","+255*a+","+d+")"}function y(a){if(a=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(a))return a[2]}function V(a){if(-1=g.currentTime)for(var G=0;G=w||!k)g.began||(g.began=!0,f("begin")),f("run");if(q>n&&q=k&&r!==k||!k)b(k),x||e();f("update");a>=k&&(g.remaining?(t=h,"alternate"===g.direction&&(g.reversed=!g.reversed)):(g.pause(),g.completed||(g.completed=!0,f("complete"),"Promise"in window&&(p(),m=c()))),l=0)}a=void 0===a?{}:a;var h,t,l=0,p=null,m=c(),g=fa(a);g.reset=function(){var a=g.direction,c=g.loop;g.currentTime= 0;g.progress=0;g.paused=!0;g.began=!1;g.completed=!1;g.reversed="reverse"===a;g.remaining="alternate"===a&&1===c?2:c;b(0);for(a=g.children.length;a--;)g.children[a].reset()};g.tick=function(a){h=a;t||(t=h);k((l+h-t)*q.speed)};g.seek=function(a){k(d(a))};g.pause=function(){var a=v.indexOf(g);-1=c&&0<=b&&1>=b){var e=new Float32Array(11);if(c!==d||b!==f)for(var k=0;11>k;++k)e[k]=a(.1*k,c,b);return function(k){if(c===d&&b===f)return k;if(0===k)return 0;if(1===k)return 1;for(var h=0,l=1;10!==l&&e[l]<=k;++l)h+=.1;--l;var l=h+(k-e[l])/(e[l+1]-e[l])*.1,n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(.001<=n){for(h=0;4>h;++h){n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(0===n)break;var m=a(l,c,b)-k,l=l-m/n}k=l}else if(0=== n)k=l;else{var l=h,h=h+.1,g=0;do m=l+(h-l)/2,n=a(m,c,b)-k,0++g);k=m}return a(k,d,f)}}}}(),Q=function(){function a(a,b){return 0===a||1===a?a:-Math.pow(2,10*(a-1))*Math.sin(2*(a-1-b/(2*Math.PI)*Math.asin(1))*Math.PI/b)}var c="Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),d={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],a],Out:[[.25, .46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(b,c){return 1-a(1-b,c)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(b,c){return.5>b?a(2*b,c)/2:1-a(-2*b+2,c)/2}]},b={linear:A(.25,.25,.75,.75)},f={},e;for(e in d)f.type=e,d[f.type].forEach(function(a){return function(d,f){b["ease"+a.type+c[f]]=h.fnc(d)? d:A.apply($jscomp$this,d)}}(f)),f={type:f.type};return b}(),ha={css:function(a,c,d){return a.style[c]=d},attribute:function(a,c,d){return a.setAttribute(c,d)},object:function(a,c,d){return a[c]=d},transform:function(a,c,d,b,f){b[f]||(b[f]=[]);b[f].push(c+"("+d+")")}},v=[],B=0,ia=function(){function a(){B=requestAnimationFrame(c)}function c(c){var b=v.length;if(b){for(var d=0;db&&(c.duration=d.duration);c.children.push(d)});c.seek(0);c.reset();c.autoplay&&c.restart();return c};return c};q.random=function(a,c){return Math.floor(Math.random()*(c-a+1))+a};return q}); /*! Mousewheel by Brandon Aaron (http://brandon.aaron.sh) */ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}); (function($, window, document) { jQuery(document).ready(function($){ // ========================= smartresize =============================== /* * smartresize: debounced resize event for jQuery * * latest version and complete README available on Github: * https://github.com/louisremi/jquery.smartresize.js * * Copyright 2011 @louis_remi * Licensed under the MIT license. */ var $event = $.event, dispatchMethod = $.event.handle ? 'handle' : 'dispatch', resizeTimeout; $event.special.smartresize = { setup: function() { $(this).on( "resize", $event.special.smartresize.handler ); }, teardown: function() { $(this).off( "resize", $event.special.smartresize.handler ); }, handler: function( event, execAsap ) { // Save the context var context = this, args = arguments; // set correct event type event.type = "smartresize"; if ( resizeTimeout ) { clearTimeout( resizeTimeout ); } resizeTimeout = setTimeout(function() { $event[ dispatchMethod ].apply( context, args ); }, execAsap === "execAsap"? 0 : 100 ); } }; $.fn.smartresize = function( fn ) { return fn ? this.on( "smartresize", fn ) : this.trigger( "smartresize", ["execAsap"] ); }; /*! * jQuery Transit - CSS3 transitions and transformations * (c) 2011-2012 Rico Sta. Cruz * MIT Licensed. * * http://ricostacruz.com/jquery.transit * http://github.com/rstacruz/jquery.transit */ (function(k){k.transit={version:"0.9.9",propertyMap:{marginLeft:"margin",marginRight:"margin",marginBottom:"margin",marginTop:"margin",paddingLeft:"padding",paddingRight:"padding",paddingBottom:"padding",paddingTop:"padding"},enabled:true,useTransitionEnd:false};var d=document.createElement("div");var q={};function b(v){if(v in d.style){return v}var u=["Moz","Webkit","O","ms"];var r=v.charAt(0).toUpperCase()+v.substr(1);if(v in d.style){return v}for(var t=0;t-1;q.transition=b("transition");q.transitionDelay=b("transitionDelay");q.transform=b("transform");q.transformOrigin=b("transformOrigin");q.transform3d=e();var i={transition:"transitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",msTransition:"MSTransitionEnd"};var f=q.transitionEnd=i[q.transition]||null;for(var p in q){if(q.hasOwnProperty(p)&&typeof k.support[p]==="undefined"){k.support[p]=q[p]}}d=null;k.cssEase={_default:"ease","in":"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"};k.cssHooks["transit:transform"]={get:function(r){return k(r).data("transform")||new j()},set:function(s,r){var t=r;if(!(t instanceof j)){t=new j(t)}if(q.transform==="WebkitTransform"&&!a){s.style[q.transform]=t.toString(true)}else{s.style[q.transform]=t.toString()}k(s).data("transform",t)}};k.cssHooks.transform={set:k.cssHooks["transit:transform"].set};if(k.fn.jquery<"1.8"){k.cssHooks.transformOrigin={get:function(r){return r.style[q.transformOrigin]},set:function(r,s){r.style[q.transformOrigin]=s}};k.cssHooks.transition={get:function(r){return r.style[q.transition]},set:function(r,s){r.style[q.transition]=s}}}n("scale");n("translate");n("rotate");n("rotateX");n("rotateY");n("rotate3d");n("perspective");n("skewX");n("skewY");n("x",true);n("y",true);function j(r){if(typeof r==="string"){this.parse(r)}return this}j.prototype={setFromString:function(t,s){var r=(typeof s==="string")?s.split(","):(s.constructor===Array)?s:[s];r.unshift(t);j.prototype.set.apply(this,r)},set:function(s){var r=Array.prototype.slice.apply(arguments,[1]);if(this.setter[s]){this.setter[s].apply(this,r)}else{this[s]=r.join(",")}},get:function(r){if(this.getter[r]){return this.getter[r].apply(this)}else{return this[r]||0}},setter:{rotate:function(r){this.rotate=o(r,"deg")},rotateX:function(r){this.rotateX=o(r,"deg")},rotateY:function(r){this.rotateY=o(r,"deg")},scale:function(r,s){if(s===undefined){s=r}this.scale=r+","+s},skewX:function(r){this.skewX=o(r,"deg")},skewY:function(r){this.skewY=o(r,"deg")},perspective:function(r){this.perspective=o(r,"px")},x:function(r){this.set("translate",r,null)},y:function(r){this.set("translate",null,r)},translate:function(r,s){if(this._translateX===undefined){this._translateX=0}if(this._translateY===undefined){this._translateY=0}if(r!==null&&r!==undefined){this._translateX=o(r,"px")}if(s!==null&&s!==undefined){this._translateY=o(s,"px")}this.translate=this._translateX+","+this._translateY}},getter:{x:function(){return this._translateX||0},y:function(){return this._translateY||0},scale:function(){var r=(this.scale||"1,1").split(",");if(r[0]){r[0]=parseFloat(r[0])}if(r[1]){r[1]=parseFloat(r[1])}return(r[0]===r[1])?r[0]:r},rotate3d:function(){var t=(this.rotate3d||"0,0,0,0deg").split(",");for(var r=0;r<=3;++r){if(t[r]){t[r]=parseFloat(t[r])}}if(t[3]){t[3]=o(t[3],"deg")}return t}},parse:function(s){var r=this;s.replace(/([a-zA-Z0-9]+)\((.*?)\)/g,function(t,v,u){r.setFromString(v,u)})},toString:function(t){var s=[];for(var r in this){if(this.hasOwnProperty(r)){if((!q.transform3d)&&((r==="rotateX")||(r==="rotateY")||(r==="perspective")||(r==="transformOrigin"))){continue}if(r[0]!=="_"){if(t&&(r==="scale")){s.push(r+"3d("+this[r]+",1)")}else{if(t&&(r==="translate")){s.push(r+"3d("+this[r]+",0)")}else{s.push(r+"("+this[r]+")")}}}}}return s.join(" ")}};function m(s,r,t){if(r===true){s.queue(t)}else{if(r){s.queue(r,t)}else{t()}}}function h(s){var r=[];k.each(s,function(t){t=k.camelCase(t);t=k.transit.propertyMap[t]||k.cssProps[t]||t;t=c(t);if(k.inArray(t,r)===-1){r.push(t)}});return r}function g(s,v,x,r){var t=h(s);if(k.cssEase[x]){x=k.cssEase[x]}var w=""+l(v)+" "+x;if(parseInt(r,10)>0){w+=" "+l(r)}var u=[];k.each(t,function(z,y){u.push(y+" "+w)});return u.join(", ")}k.fn.transition=k.fn.transit=function(z,s,y,C){var D=this;var u=0;var w=true;if(typeof s==="function"){C=s;s=undefined}if(typeof y==="function"){C=y;y=undefined}if(typeof z.easing!=="undefined"){y=z.easing;delete z.easing}if(typeof z.duration!=="undefined"){s=z.duration;delete z.duration}if(typeof z.complete!=="undefined"){C=z.complete;delete z.complete}if(typeof z.queue!=="undefined"){w=z.queue;delete z.queue}if(typeof z.delay!=="undefined"){u=z.delay;delete z.delay}if(typeof s==="undefined"){s=k.fx.speeds._default}if(typeof y==="undefined"){y=k.cssEase._default}s=l(s);var E=g(z,s,y,u);var B=k.transit.enabled&&q.transition;var t=B?(parseInt(s,10)+parseInt(u,10)):0;if(t===0){var A=function(F){D.css(z);if(C){C.apply(D)}if(F){F()}};m(D,w,A);return D}var x={};var r=function(H){var G=false;var F=function(){if(G){D.unbind(f,F)}if(t>0){D.each(function(){this.style[q.transition]=(x[this]||null)})}if(typeof C==="function"){C.apply(D)}if(typeof H==="function"){H()}};if((t>0)&&(f)&&(k.transit.useTransitionEnd)){G=true;D.bind(f,F)}else{window.setTimeout(F,t)}D.each(function(){if(t>0){this.style[q.transition]=E}k(this).css(z)})};var v=function(F){this.offsetWidth;r(F)};m(D,w,v);return this};function n(s,r){if(!r){k.cssNumber[s]=true}k.transit.propertyMap[s]=q.transform;k.cssHooks[s]={get:function(v){var u=k(v).css("transit:transform");return u.get(s)},set:function(v,w){var u=k(v).css("transit:transform");u.setFromString(s,w);k(v).css({"transit:transform":u})}}}function c(r){return r.replace(/([A-Z])/g,function(s){return"-"+s.toLowerCase()})}function o(s,r){if((typeof s==="string")&&(!s.match(/^[\-0-9\.]+$/))){return s}else{return""+s+r}}function l(s){var r=s;if(k.fx.speeds[r]){r=k.fx.speeds[r]}return o(r,"ms")}k.transit.getTransitionValue=g})(jQuery); /****************** Nectar ******************/ // Create cross browser requestAnimationFrame method: window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function(f){setTimeout(f, 1000/60)} var nectarDOMInfo = { usingMobileBrowser: (navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) ? true : false, usingFrontEndEditor: (typeof window.vc_iframe === 'undefined') ? false : true, getWindowSize: function() { nectarDOMInfo.windowHeight = window.innerHeight; nectarDOMInfo.windowWidth = window.innerWidth; nectarDOMInfo.adminBarHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; nectarDOMInfo.secondaryHeaderHeight = ($('#header-secondary-outer').length > 0) ? $('#header-secondary-outer').height() : 0; }, scrollPosMouse: function() { return $(window).scrollTop(); }, scrollPosRAF: function() { nectarDOMInfo.scrollTop = $(window).scrollTop(); requestAnimationFrame(nectarDOMInfo.scrollPosRAF); }, bindEvents: function() { if(!nectarDOMInfo.usingMobileBrowser) { $(window).on('scroll',function(){ nectarDOMInfo.scrollTop = nectarDOMInfo.scrollPosMouse(); }); } $(window).on('resize',nectarDOMInfo.getWindowSize); } } nectarDOMInfo.getWindowSize(); nectarDOMInfo.scrollTop = nectarDOMInfo.scrollPosMouse(); if(nectarDOMInfo.usingMobileBrowser) { requestAnimationFrame(nectarDOMInfo.scrollPosRAF); } nectarDOMInfo.bindEvents(); //set row sizes fullWidthSections(); fwsClasses(); /***************** VC FRONTEND ******************/ function addRowCtrls() { //remove padding for rows with only fullwidth ns $('.wpb_row').removeClass('only-ns'); $('.nectar-slider-wrap[data-full-width="true"], .page-submenu, .portfolio-items[data-col-num="elastic"]:not(.fullwidth-constrained), .blog-fullwidth-wrap').parents('.wpb_row').addClass('only-ns'); //padding when column contains item that could get lost under column controls $('body.vc_editor.compose-mode .wpb_row .vc_vc_column > .wpb_column > .vc_column-inner').each(function(){ if($(this).find('> .vc_element-container > div').length > 0) { if( $(this).find('> .vc_element-container > div:first-child').is('.vc_vc_row_inner') ) { $(this).find('> .vc_element-container > div:first-child').addClass('first-inner-row-el'); } else { $(this).find('> .vc_element-container > div:first-child').removeClass('first-inner-row-el'); } } }); } //addRowCtrl end function convertFrontEndPadding() { $('.vc_element > .wpb_column[class*="padding-"][class*="-percent"]').each(function(){ var $elPaddingPercent = 4; var elclassName = this.className.match(/padding-\d+/); if (elclassName) { $elPaddingPercent = elclassName[0].match(/\d+/); if($elPaddingPercent) { $elPaddingPercent = $elPaddingPercent[0]/100; } else { $elPaddingPercent = 0; } } if($elPaddingPercent) { var $parentRowWidth = $(this).parents('.span_12').width(); if($(this).is('[data-padding-pos="all"]')){ $(this).css('padding', $parentRowWidth * $elPaddingPercent ); } else if($(this).is('[data-padding-pos="top"]')) { $(this).css('padding-top', $parentRowWidth * $elPaddingPercent ); } else if($(this).is('[data-padding-pos="bottom"]')) { $(this).css('padding-bottom', $parentRowWidth * $elPaddingPercent ); } else if($(this).is('[data-padding-pos="left"]')) { $(this).css('padding-left', $parentRowWidth * $elPaddingPercent ); } else if($(this).is('[data-padding-pos="right"]')) { $(this).css('padding-right', $parentRowWidth * $elPaddingPercent ); } else if($(this).is('[data-padding-pos="top-bottom"]')) { $(this).css({ 'padding-top': $parentRowWidth * $elPaddingPercent, 'padding-bottom': $parentRowWidth * $elPaddingPercent, }); } else if($(this).is('[data-padding-pos="top-right"]')) { $(this).css({ 'padding-top': $parentRowWidth * $elPaddingPercent, 'padding-right': $parentRowWidth * $elPaddingPercent, }); } else if($(this).is('[data-padding-pos="bottom-right"]')) { $(this).css({ 'padding-right': $parentRowWidth * $elPaddingPercent, 'padding-bottom': $parentRowWidth * $elPaddingPercent, }); } else if($(this).is('[data-padding-pos="bottom-left"]')) { $(this).css({ 'padding-left': $parentRowWidth * $elPaddingPercent, 'padding-bottom': $parentRowWidth * $elPaddingPercent, }); } else if($(this).is('[data-padding-pos="left-right"]')) { $(this).css({ 'padding-left': $parentRowWidth * $elPaddingPercent, 'padding-right': $parentRowWidth * $elPaddingPercent, }); } } }); //each //remove margins on element wrappers that are setting custom margin $('.wpb_row[class*="vc_custom_"]').each(function(){ $(this).parent().addClass('no-bottom-margin'); }); } //convertFrontEndPadding end setTimeout(function(){ if($('body.compose-mode').length > 0) { $('.container-wrap').addClass('visible-editor-controls'); } if(nectarDOMInfo.usingFrontEndEditor) { addRowCtrls(); convertFrontEndPadding(); $(window).smartresize(convertFrontEndPadding); } },200); var $fp_section_length = 0, $fp_section_prev_length = 0; $(window).on( 'vc_reload', function() { addRowCtrls(); columnBGColors(); coloredButtons(); twentytwentyInit(); parallaxRowsBGCals(); if($('.carousel').length > 0) { standardCarouselInit(); clientsCarouselInit(); carouselHeightCalcs(); } if($('.owl-carousel').length > 0) { $('.owl-carousel').each(function(){ $(this).trigger('destroy.owl.carousel').removeClass('owl-loaded'); $(this).find('.owl-stage-outer .owl-stage > *').unwrap(); $(this).find('.owl-stage-outer > *').unwrap(); $(this).find('.owl-item > *').unwrap(); $(this).find('.owl-dots').remove(); $(this).find('.owl-nav').remove(); }); owlCarouselInit(); } flexsliderInit(); accordionInit(); ulChecks(); oneFourthClasses(); carouselfGrabbingClass(); if($('.nectar_cascading_images').length > 0) { imagesLoaded($('.nectar_cascading_images'),function(instance){ cascadingImageBGSizing(); }); } fullWidthSections(); fwsClasses(); fullwidthImgOnlySizingInit(); fullwidthImgOnlySizing(); fullWidthRowPaddingAdjustInit(); recentPostsFlickityInit(); if(nectarDOMInfo.usingMobileBrowser) { fullWidthRowPaddingAdjustCalc(); } if($('.nectar-box-roll').length == 0) { boxRollInit(); } /*flickity carousels*/ if($flickitySliders.length > 0) { for(var i=0; i<$flickitySliders.length; i++) { $flickitySliders[i].reloadCells(); $flickitySliders[i].off( 'scroll.flickity'); $flickitySliders[i].off( 'dragStart.flickity'); $flickitySliders[i].off( 'dragEnd.flickity'); } } setTimeout(function(){ flickityInit(); if($flickitySliders.length > 0) { for(var i=0; i<$flickitySliders.length; i++) { $flickitySliders[i].reloadCells(); $flickitySliders[i].resize(); } } },100); /*flickity product carousels*/ if($wooFlickityCarousels.length > 0) { for(var i=0; i<$wooFlickityCarousels.length; i++) { $wooFlickityCarousels[i].flickity('reloadCells'); $wooFlickityCarousels[i].off( 'scroll.flickity'); $wooFlickityCarousels[i].off( 'dragStart.flickity'); $wooFlickityCarousels[i].off( 'dragEnd.flickity'); } } setTimeout(function(){ if( $('.nectar-woo-flickity').length > 0) { productCarouselInit(); } if($wooFlickityCarousels.length > 0) { for(var i=0; i<$wooFlickityCarousels.length; i++) { $wooFlickityCarousels[i].flickity('reloadCells'); $wooFlickityCarousels[i].flickity('resize'); } } },100); socialSharingInit(); hotSpotHoverBind(); pricingTableHeight(); nectarIconMatchColoring(); if($testimonialSlider.length > 0) { for(var i=0; i<$testimonialSlider.length; i++) { var testimonialflkty = $testimonialSlider[i].data('flickity'); $testimonialSlider[i].flickity('reloadCells'); $testimonialSlider[i].off( 'select.flickity'); } } createTestimonialControls(); lightBoxInit(); imageWithHotspotClickEvents(); testimonialSliderHeight(); largeIconHover(); if($('.nectar-box-roll').length == 0) boxRollMouseWheelInit(); midnightInit(); responsiveVideoIframesInit(); responsiveVideoIframes(); fullWidthContentColumns(); setTimeout(fullWidthContentColumns,1000); videoBGInit(); $(window).off('scroll.parallaxSections').off('resize.parallaxSections'); parallaxScrollInit(); //update blog arr $('.posts-container').each(function(i){ $blog_containers[i] = $(this); }); masonryBlogInit(); masonryPortfolioInit(); portfolioAccentColor(); portfolioHoverEffects(); portfolioFiltersInit(); style6Img(); fsProjectSliderInit(); setTimeout(function(){ if($('.nectar_fullscreen_zoom_recent_projects').length > 0){ portfolioFullScreenSliderCalcs(); splitLineText(); $(window).resize(splitLineText); $(window).resize(portfolioFullScreenSliderCalcs); } },300); isotopeCatSelection(); $(window).unbind('.infscr'); infiniteScrollInit(); postNextButtonEffect(); mouseParallaxInit(); //play video BGs $('.nectar-video-wrap').each(function(i){ if($(this).find('video').length > 0) { $(this).find('video').css('visibility','visible'); } }); //tablet inherits small desktop $('.wpb_column[data-t-w-inherits]').each(function(){ if( $(this).is('[data-t-w-inherits="small_desktop"]') ) { $(this).parent().addClass('inherits-s-desktop-col'); } else { $(this).parent().removeClass('inherits-s-desktop-col'); } }); //full screen page rows if($('#nectar_fullscreen_rows').length > 0) { $fp_section_length = $('#nectar_fullscreen_rows > .vc_element').length; if( $('#nectar_fullscreen_rows > .vc_element').length == 0 ) { $('#nectar_fullscreen_rows').prepend('
'); } if( $('#nectar_fullscreen_rows > .vc_element:not(.empty_placeholder)').length > 0 ) { $('#nectar_fullscreen_rows >.vc_element.empty_placeholder').remove(); } setFPNames(); //first load if($('#fp-nav').length == 0) { initNectarFP(); var currentFPSectionIndex = ($('#nectar_fullscreen_rows > .vc_element.active').length > 0) ? $('#nectar_fullscreen_rows > .vc_element.active').index() + 1 : 1; setFPNavColoring(currentFPSectionIndex,'na'); } //after ////reinit if sections have been added/removed else if($fp_section_length != $fp_section_prev_length) { $.fn.fullpage.destroy('all'); initNectarFP(); var currentFPSectionIndex = ($('#nectar_fullscreen_rows > .vc_element.active').length > 0) ? $('#nectar_fullscreen_rows > .vc_element.active').index() + 1 : 1; setFPNavColoring(currentFPSectionIndex,'na'); } //keep tooltip active status var $nectarFPindex = 0; var nectarFPOffsets = [{el: '', offset: 0}]; ////create list of offsets $('#nectar_fullscreen_rows > div.vc_element').each(function(i){ nectarFPOffsets[i] = { el: $(this), offset: $(this).offset().top } }); ////loop to find lowest for(var x in nectarFPOffsets) { if(nectarFPOffsets[x].offset < $(window).height()){ $nectarFPindex = x; } } ////start active on that index //$('#fp-nav ul > li:nth-child(' + (parseInt($nectarFPindex)+1) + ')').find('> a').trigger('click'); //move back to first section when all have been deleted but one if($('#nectar_fullscreen_rows > div.vc_element').length === 1) { $('#nectar_fullscreen_rows').css({'transform' : 'translate3d(0,0,0)'}); } $('body').scrollTo(0,0); //update prev section length $fp_section_prev_length = $fp_section_length; } else { //remove container wrap padding/margin when needded if($('body .main-content > .row > .vc_element:first > .wpb_row[class*="full-width-"]').length > 0 || $('body .main-content > .row > .vc_element:first .nectar-slider-wrap[data-full-width="true"]').length > 0 ) { $('.container-wrap').css({ 'padding-top': '0', 'margin-top' : '0'}); } else { $('.container-wrap').css({ 'padding-top': '40px'}); } } //reset svg icon arr $svg_icons = []; $('.svg-icon-holder').removeClass('animated-in').removeClass('bound'); //gmap if($('.vc_nectar_gmap').length > 0) { setTimeout(function(){ if(typeof google === 'object' && typeof google.maps === 'object') { mapAPI_Loaded(); } else { if(nectarLove.mapApiKey.length > 0) { $.getScript('https://maps.google.com/maps/api/js?sensor=false&key='+nectarLove.mapApiKey+'&callback=mapAPI_Loaded'); } } },100); } if( $().theiaStickySidebar ) { blogStickySS(); } if(typeof window.Waypoint != 'undefined') { Waypoint.destroyAll(); waypoints(); } }); /***************** Lightbox Init ******************/ function fancyBoxInit() { //convert old pp links $('a.pp').removeClass('pp').attr('data-fancybox',''); $("a[rel^='prettyPhoto']:not([rel*='_gal']):not([rel*='product-gallery']):not([rel*='prettyPhoto['])").removeAttr('rel').attr('data-fancybox',''); //image gallery nectar $('.wpb_gallery .wpb_gallery_slidesnectarslider_style').each(function(){ var $unique_id = Math.floor(Math.random()*10000); $(this).find('.swiper-slide a:not(.ext-url-link)').attr('data-fancybox','group_'+$unique_id); }); //flex $('.wpb_gallery_slides.wpb_flexslider').each(function(){ var $unique_id = Math.floor(Math.random()*10000); $(this).find('.slides > li > a').attr('data-fancybox','group_'+$unique_id); }); //touch enabled gal $('.wpb_gallery_slidesflickity_style').each(function(){ var $unique_id = Math.floor(Math.random()*10000); $(this).find('.cell > a:not(.ext-url-link)').attr('data-fancybox','group_'+$unique_id); }); //add galleries to portfolios $('.portfolio-items, .wpb_gallery .parallax-grid-item').each(function(){ var $unique_id = Math.floor(Math.random()*10000); if($(this).find('.pretty_photo').length > 0) { $(this).find('.pretty_photo').removeClass('pretty_photo').attr('data-fancybox','group_'+$unique_id); } else if($(this).find('a[rel*="prettyPhoto["]').length > 0){ $(this).find('a[rel*="prettyPhoto["]').removeAttr('rel').attr('data-fancybox','group_'+$unique_id); } }); //nectar auto lightbox if($('body').hasClass('nectar-auto-lightbox')){ $('.gallery').each(function(){ if($(this).find('.gallery-icon a[rel^="prettyPhoto"]').length == 0) { var $unique_id = Math.floor(Math.random()*10000); $(this).find('.gallery-item .gallery-icon a[href*=".jpg"], .gallery-item .gallery-icon a[href*=".png"], .gallery-item .gallery-icon a[href*=".gif"], .gallery-item .gallery-icon a[href*=".jpeg"]').attr('data-fancybox','group_'+$unique_id).removeClass('pretty_photo'); } }); $('.main-content img').each(function(){ if($(this).parent().is("[href]") && !$(this).parent().is(".magnific-popup") && $(this).parents('.tiled-gallery').length == 0 && $(this).parents('.product-image').length == 0 && $(this).parents('.iosSlider.product-slider').length == 0) { var match = $(this).parent().attr('href').match(/\.(jpg|png|gif)\b/); if(match) $(this).parent().attr('data-fancybox',''); } }); } //regular fbMarginArr = ($('body.admin-bar').length > 0) ? [60,100] : [60,100]; if(window.innerWidth < 1000) { fbMarginArr = [0,0]; } $("[data-fancybox]").fancybox({ animationEffect : "zoom-in-out", animationDuration : 350, buttons : [ //'slideShow', 'fullScreen', //'thumbs', //'share', //'download', 'zoom', 'close' ], margin : fbMarginArr, loop : true, caption : function( instance, item ) { return $(this).attr('title'); }, beforeLoad: function(instance,current) { //when there's nothing to load if(typeof instance.current.src !== 'string') { $.fancybox.close(true); } }, mobile : { margin : 0 } }); } function magnificInit() { //convert old pp links $('a.pp').removeClass('pp').addClass('magnific-popup'); $("a[rel^='prettyPhoto']:not([rel*='_gal']):not([rel*='product-gallery']):not([rel*='prettyPhoto['])").removeAttr('rel').addClass('magnific-popup'); //image gallery nectar $('.wpb_gallery .wpb_gallery_slidesnectarslider_style').each(function(){ var $unique_id = Math.floor(Math.random()*10000); $(this).find('.swiper-slide a:not(.ext-url-link)').addClass('pretty_photo'); }); //flex $('.wpb_gallery_slides.wpb_flexslider').each(function(){ var $unique_id = Math.floor(Math.random()*10000); $(this).find('.slides > li > a').addClass('pretty_photo'); }); //touch enabled gal $('.wpb_gallery_slidesflickity_style').each(function(){ var $unique_id = Math.floor(Math.random()*10000); $(this).find('.cell > a:not(.ext-url-link)').addClass('pretty_photo'); }); //add galleries to portfolios $('.portfolio-items, .wpb_gallery .swiper-slide, .wpb_gallery_slidesflickity_style .cell, .wpb_gallery_slides.wpb_flexslider ul > li, .wpb_gallery .parallax-grid-item').each(function(){ if($(this).find('.pretty_photo').length > 0) { $(this).find('.pretty_photo').removeClass('pretty_photo').addClass('gallery').addClass('magnific'); } else if($(this).find('a[rel*="prettyPhoto["]').length > 0){ $(this).find('a[rel*="prettyPhoto["]').removeAttr('rel').addClass('gallery').addClass('magnific'); } }); $("a[data-rel='prettyPhoto[product-gallery]']").each(function(){ $(this).removeAttr('data-rel').addClass('magnific').addClass('gallery'); }); //nectar auto lightbox if($('body').hasClass('nectar-auto-lightbox')){ $('.gallery').each(function(){ if($(this).find('.gallery-icon a[rel^="prettyPhoto"]').length == 0) { var $unique_id = Math.floor(Math.random()*10000); $(this).find('.gallery-item .gallery-icon a[href*=".jpg"], .gallery-item .gallery-icon a[href*=".png"], .gallery-item .gallery-icon a[href*=".gif"], .gallery-item .gallery-icon a[href*=".jpeg"]').addClass('magnific').addClass('gallery').removeClass('pretty_photo'); } }); $('.main-content img').each(function(){ if($(this).parent().is("[href]") && !$(this).parent().is(".magnific-popup") && $(this).parents('.tiled-gallery').length == 0 && $(this).parents('.product-image').length == 0 && $(this).parents('.iosSlider.product-slider').length == 0) { var match = $(this).parent().attr('href').match(/\.(jpg|png|gif)\b/); if(match) $(this).parent().addClass('magnific-popup').addClass('image-link'); } }); } //regular $('a.magnific-popup:not(.gallery):not(.nectar_video_lightbox)').magnificPopup({ type: 'image', callbacks: { imageLoadComplete: function() { var $that = this; setTimeout( function() { $that.wrap.addClass('mfp-image-loaded'); }, 10); }, beforeOpen: function() { this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); }, open: function() { $.magnificPopup.instance.next = function() { var $that = this; this.wrap.removeClass('mfp-image-loaded'); setTimeout( function() { $.magnificPopup.proto.next.call($that); }, 100); } $.magnificPopup.instance.prev = function() { var $that = this; this.wrap.removeClass('mfp-image-loaded'); setTimeout( function() { $.magnificPopup.proto.prev.call($that); }, 100); } } }, fixedContentPos: false, mainClass: 'mfp-zoom-in', removalDelay: 400 }); //video $('a.magnific-popup.nectar_video_lightbox, .magnific_nectar_video_lightbox a.link_text, .swiper-slide a[href*=youtube], .swiper-slide a[href*=vimeo], .nectar-video-box a.full-link.magnific-popup').magnificPopup({ type: 'iframe', fixedContentPos: false, mainClass: 'mfp-zoom-in', removalDelay: 400 }); //galleries $('a.magnific.gallery').each(function(){ var $parentRow = ($(this).closest('.wpb_column').length > 0) ? $(this).closest('.wpb_column') : $(this).parents('.row'); if($parentRow.length > 0 && !$parentRow.hasClass('lightbox-col')) { $parentRow.magnificPopup({ type: 'image', delegate: 'a.magnific', mainClass: 'mfp-zoom-in', fixedContentPos: false, callbacks: { elementParse: function(item) { if($(item.el.context).is('[href]') && $(item.el.context).attr('href').indexOf('iframe=true') != -1 || $(item.el.context).is('[href]') && $(item.el.context).attr('href').indexOf('https://www.youtube.com/watch') != -1 ) { item.type = 'iframe'; } else if ($(item.el.context).is('[href]') && $(item.el.context).attr('href').indexOf('video-popup-') != -1) { item.type = 'inline'; } else { item.type = 'image'; } }, imageLoadComplete: function() { var $that = this; setTimeout( function() { $that.wrap.addClass('mfp-image-loaded'); }, 10); }, beforeOpen: function() { this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); }, open: function() { //self hosted video if($(this.content).find('.mejs-video video').length > 0 && $().mediaelementplayer ) { $(this.content).find('.mejs-video video')[0].player.remove(); var $that = this; setTimeout(function(){ $($that.content).find('video').mediaelementplayer(); $($that.content).find('.mejs-video video')[0].player.play(); },50); } $.magnificPopup.instance.next = function() { var $that = this; this.wrap.removeClass('mfp-image-loaded'); setTimeout( function() { $.magnificPopup.proto.next.call($that); //self hosted video if($($that.content).find('.mejs-video video').length > 0) { $($that.content).find('.mejs-video video')[0].play(); } }, 100); } $.magnificPopup.instance.prev = function() { var $that = this; this.wrap.removeClass('mfp-image-loaded'); setTimeout( function() { $.magnificPopup.proto.prev.call($that); //self hosted video if($($that.content).find('.mejs-video video').length > 0) { $($that.content).find('.mejs-video video')[0].play(); } }, 100); } }, close: function() { //self hosted video if($(this.content).find('.mejs-video video').length > 0) { $(this.content).find('.mejs-video video')[0].load(); } } }, removalDelay: 400, gallery: { enabled:true } }); $parentRow.addClass('lightbox-col'); } }); } function lightBoxInit() { if($('body[data-ls="magnific"]').length > 0 || $('body[data-ls="pretty_photo"]').length > 0 ) { magnificInit(); } else if($('body[data-ls="fancybox"]').length > 0) { fancyBoxInit(); } } lightBoxInit(); //check for late links setTimeout(lightBoxInit,500); /*nectar liquid*/ function NectarLiquid(bgIMG, type, el_type) { this.canvasContainer = bgIMG[0]; this.rowBG = bgIMG; this.animationType = type; this.elType = el_type; this.bgDivWidth = $(this.rowBG).width(); this.bgDivHeight = $(this.rowBG).height(); this.bgDivRatio = this.bgDivHeight / this.bgDivWidth; this.app = new PIXI.Application({ width: this.bgDivWidth, height: this.bgDivHeight, transparent: true, sharedTicker: true }); this.app.stage = new window.PIXI.Container(); this.imgContainer = new window.PIXI.Container(); //grab displacement filter from css $(this.canvasContainer).remove('.nectar-displacement'); $(this.canvasContainer).append('
'); this.displacementIMG_URL = $(this.canvasContainer).find('.nectar-displacement').css('background-image'); this.displacementIMG_URL = this.displacementIMG_URL.replace(/(url\(|\)|")/g, ''); //get row BG img this.bgIMG_SRC = bgIMG.css('background-image'); this.bgIMG_SRC = this.bgIMG_SRC.replace(/(url\(|\)|")/g, ''); //init everything once loaded this.loader = new PIXI.loaders.Loader(); this.loader.add('rowBG',this.bgIMG_SRC); this.loader.add('displaceBG', this.displacementIMG_URL); this.loader.load(this.initialize.bind(this)); } NectarLiquid.prototype.initialize = function() { this.settings = { animationStrength: 1, animationStrengthSpeed: 1, displacementScaleX: 30, displacementScaleY: 90, time: Math.random()*20, filterMultX: 200, filterMultY: 350, shouldAnimate: true }; if(this.animationType == 'displace-filter-fade') { if(this.elType == 'row') { this.settings.filterMultX = 150; this.settings.filterMultY = 375; this.settings.displacementScaleX = 80; this.settings.displacementScaleY = 170; this.settings.animationStrengthSpeed = 2; } else { this.settings.filterMultX = 55; this.settings.filterMultY = 150; this.settings.displacementScaleX = 50; this.settings.displacementScaleY = 160; this.settings.animationStrengthSpeed = 1; } } else { if(this.elType != 'row') { this.settings.displacementScaleY = 70; } } //displacement this.filterSprite = new window.PIXI.Sprite( this.loader.resources.displaceBG.texture ); this.filterSprite.texture.baseTexture.wrapMode = PIXI.WRAP_MODES.REPEAT; this.filter = new window.PIXI.filters.DisplacementFilter( this.filterSprite ); //bg this.bg = new PIXI.Sprite( this.loader.resources.rowBG.texture ); ////store actual img height/ratio this.imgHeight = this.loader.resources.rowBG.texture.orig.height; this.imgWidth = this.loader.resources.rowBG.texture.orig.width; this.imgRatio = this.imgWidth/this.imgHeight; // Set image anchor to the center of the image this.bg.anchor.x = 0.5; this.bg.anchor.y = 0.5; //sim background-size cover this.bg.height = $(this.rowBG).height(); this.bg.width = this.imgRatio * this.bg.height; if( this.bg.width <= $(this.rowBG).width() ) { this.bg.width = $(this.rowBG).width() + 100; this.bg.height = this.bg.width / this.imgRatio; } else { this.bg.height = $(this.rowBG).height() + 100; this.bg.width = this.imgRatio * this.bg.height; } //reset the dimensions for the renderer incase the row height has changed inbetween loading the bg resouce this.app.renderer.resize( $(this.rowBG).width(), $(this.rowBG).height() ); this.buildStage(); this.createFilters(); this.app.view.setAttribute( "class", "nectar-liquid-bg" ); this.canvasContainer.appendChild( this.app.view ); if(this.animationType == 'displace-filter-loop') { if($('#nectar_fullscreen_rows').length == 0) { this.animateFilters(); $liquidBGOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '105%'; var self = this; var $parentSelector = (self.elType == 'row') ? '.row-bg-wrap' : '.column-image-bg-wrap'; var waypoint = new Waypoint({ element: $(this.canvasContainer).parents($parentSelector), handler: function(direction) { //add bg to container self.imgContainer.addChild( self.bg ); }, offset: $liquidBGOffsetPos }); } else { this.animateFilters(); this.imgContainer.addChild( this.bg ); } } //end displace loop else if(this.animationType == 'displace-filter-fade') { this.animateFilters(); this.settings.shouldAnimate = false; $liquidBGOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '85%'; var self = this; var $parentSelector = (self.elType == 'row') ? '.row-bg-wrap' : '.column-image-bg-wrap'; if($('#nectar_fullscreen_rows').length == 0 || $('#nectar_fullscreen_rows').length > 0 && $(this.canvasContainer).parents('.wpb_row.fp-section').index() == 0 || $disableFPonMobile == 'on') { var waypoint = new Waypoint({ element: $(this.canvasContainer).parents($parentSelector), handler: function(direction) { if($(self.canvasContainer).parents('.wpb_tab').length > 0 && $(self.canvasContainer).parents('.wpb_tab').css('visibility') == 'hidden' || $(self.canvasContainer).hasClass('animated-in')) { waypoint.destroy(); return; } //add bg to container self.imgContainer.addChild( self.bg ); //animate down self.animateProps(self); waypoint.destroy(); }, offset: $liquidBGOffsetPos }); //waypoint end } } // end fade in displace //resize logic $(window).resize(this.resize.bind(this)); $(window).smartresize(this.resize.bind(this)); } NectarLiquid.prototype.animateProps = function(self) { setTimeout(function(){ $(self.canvasContainer).find('.nectar-liquid-bg').addClass('animated-in'); self.settings.shouldAnimate = true; self.settings.animationStrength = 1; self.settings.animationStrengthSpeed = 2.5; self.animateFilters(); //animate displacement down anime({ targets: self.settings, animationStrength: 0, duration: 1900, easing: [.36,.42,.3,1], complete: function(anim) { self.settings.shouldAnimate = false } }); anime({ targets: self.settings, animationStrengthSpeed: 0.8, duration: 1900, easing: [.36,.42,.3,1], complete: function(anim) { self.settings.shouldAnimate = false } }); },100); } NectarLiquid.prototype.resize = function(){ var self = this; self.bgDivRatio = $(self.rowBG).height() / $(self.rowBG).width(); self.imgContainer.position.x = $(self.rowBG).width() / 2; self.imgContainer.position.y = $(self.rowBG).height() / 2; //sim background-size cover self.bg.height = $(self.rowBG).height(); self.bg.width = self.imgRatio * self.bg.height; if( self.bg.width <= $(self.rowBG).width() ) { self.bg.width = $(self.rowBG).width() + 100; self.bg.height = self.bg.width / self.imgRatio; } else { self.bg.height = $(self.rowBG).height() + 100; self.bg.width = self.imgRatio * self.bg.height; } self.app.stage.scale.x = self.app.stage.scale.y = 1; self.app.renderer.resize( $(self.rowBG).width(), $(self.rowBG).height() ); } NectarLiquid.prototype.createFilters = function() { this.app.stage.addChild( this.filterSprite ); this.filter.scale.x = this.filter.scale.y = 1; this.imgContainer.filters = [ this.filter ]; } NectarLiquid.prototype.buildStage = function() { this.imgContainer.position.x = $(this.rowBG).width() / 2; this.imgContainer.position.y = $(this.rowBG).height() / 2; this.app.stage.scale.x = this.app.stage.scale.y = 1; this.app.stage.addChild( this.imgContainer ); } NectarLiquid.prototype.animateFilters = function() { this.filterSprite.rotation = this.settings.time * 0.01; this.filterSprite.x = Math.sin(this.settings.time * 0.1) * this.settings.filterMultX; this.filterSprite.y = Math.cos(this.settings.time * 0.1) * this.settings.filterMultY; this.filter.scale.x = this.settings.displacementScaleX * this.settings.animationStrength; this.filter.scale.y = this.settings.displacementScaleY * this.settings.animationStrength; this.settings.time += 0.05 * this.settings.animationStrengthSpeed; if(this.animationType == 'displace-filter-loop') { requestAnimationFrame(function(){ this.animateFilters(); }.bind(this)); } else if(this.animationType == 'displace-filter-fade' && this.settings.shouldAnimate) { requestAnimationFrame(function(){ this.animateFilters(); }.bind(this)); } } function nectarLiquidBGs() { $liquidBG_EL = []; $('.row-bg-wrap[data-bg-animation*="displace-filter"] .row-bg.using-image, .column-image-bg-wrap[data-bg-animation*="displace-filter"] .column-image-bg').each(function(i){ var $that_el = $(this); if( $(this).is('.row-bg') ) { var $type = $(this).parents('.row-bg-wrap').attr('data-bg-animation'); var $el_type = 'row'; } else if( $(this).is('.column-image-bg') ) { var $type = $(this).parents('.column-image-bg-wrap').attr('data-bg-animation'); var $el_type = 'col'; } $liquidBG_EL[i] = new NectarLiquid($that_el, $type, $el_type); }); } /***************** Global vars ******************/ var $standAnimatedColTimeout = []; var $animatedSVGIconTimeout = []; var $svg_icons = []; var $nectarCustomSliderRotate = []; var $flickitySliders = []; var $wooFlickityCarousels = []; var $liquidBG_EL = []; /***************** Smooth Scrolling ******************/ function niceScrollInit(){ //removed since 9.0. } var $smoothActive = 0; var $smoothCache = false; //chrome ss if($smoothCache == false && $('body.material').length == 0 && navigator.platform.toUpperCase().indexOf('MAC') === -1 && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/) && $(window).width() > 690 && $('#nectar_fullscreen_rows').length == 0) { !function(){function e(){var e=!1;e&&c("keydown",r),v.keyboardSupport&&!e&&u("keydown",r)}function t(){if(document.body){var t=document.body,n=document.documentElement,o=window.innerHeight,r=t.scrollHeight;if(S=document.compatMode.indexOf("CSS")>=0?n:t,w=t,e(),x=!0,top!=self)y=!0;else if(r>o&&(t.offsetHeight<=o||n.offsetHeight<=o)){var a=!1,i=function(){a||n.scrollHeight==document.height||(a=!0,setTimeout(function(){n.style.height=document.height+"px",a=!1},500))};if(n.style.height="auto",setTimeout(i,10),S.offsetHeight<=o){var l=document.createElement("div");l.style.clear="both",t.appendChild(l)}}v.fixedBackground||b||(t.style.backgroundAttachment="scroll",n.style.backgroundAttachment="scroll")}}function n(e,t,n,o){if(o||(o=1e3),d(t,n),1!=v.accelerationMax){var r=+new Date,a=r-C;if(a1&&(i=Math.min(i,v.accelerationMax),t*=i,n*=i)}C=+new Date}if(M.push({x:t,y:n,lastX:0>t?.99:-.99,lastY:0>n?.99:-.99,start:+new Date}),!T){var l=e===document.body,u=function(){for(var r=+new Date,a=0,i=0,c=0;c=v.animationTime,h=f?1:d/v.animationTime;v.pulseAlgorithm&&(h=p(h));var m=s.x*h-s.lastX>>0,w=s.y*h-s.lastY>>0;a+=m,i+=w,s.lastX+=m,s.lastY+=w,f&&(M.splice(c,1),c--)}l?window.scrollBy(a,i):(a&&(e.scrollLeft+=a),i&&(e.scrollTop+=i)),t||n||(M=[]),M.length?N(u,e,o/v.frameRate+1):T=!1};N(u,e,0),T=!0}}function o(e){x||t();var o=e.target,r=l(o);if(!r||e.defaultPrevented||s(w,"embed")||s(o,"embed")&&/\.pdf/i.test(o.src))return!0;var a=e.wheelDeltaX||0,i=e.wheelDeltaY||0;return a||i||(i=e.wheelDelta||0),!v.touchpadSupport&&f(i)?!0:(Math.abs(a)>1.2&&(a*=v.stepSize/120),Math.abs(i)>1.2&&(i*=v.stepSize/120),n(r,-a,-i),void e.preventDefault())}function r(e){var t=e.target,o=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==H.spacebar;if(/input|textarea|select|embed/i.test(t.nodeName)||t.isContentEditable||e.defaultPrevented||o)return!0;if(s(t,"button")&&e.keyCode===H.spacebar)return!0;var r,a=0,i=0,u=l(w),c=u.clientHeight;switch(u==document.body&&(c=window.innerHeight),e.keyCode){case H.up:i=-v.arrowScroll;break;case H.down:i=v.arrowScroll;break;case H.spacebar:r=e.shiftKey?1:-1,i=-r*c*.9;break;case H.pageup:i=.9*-c;break;case H.pagedown:i=.9*c;break;case H.home:i=-u.scrollTop;break;case H.end:var d=u.scrollHeight-u.scrollTop-c;i=d>0?d+10:0;break;case H.left:a=-v.arrowScroll;break;case H.right:a=v.arrowScroll;break;default:return!0}n(u,a,i),e.preventDefault()}function a(e){w=e.target}function i(e,t){for(var n=e.length;n--;)E[A(e[n])]=t;return t}function l(e){var t=[],n=S.scrollHeight;do{var o=E[A(e)];if(o)return i(t,o);if(t.push(e),n===e.scrollHeight){if(!y||S.clientHeight+100?1:-1,t=t>0?1:-1,(k.x!==e||k.y!==t)&&(k.x=e,k.y=t,M=[],C=0)}function f(e){if(e){e=Math.abs(e),D.push(e),D.shift(),clearTimeout(z);var t=h(D[0],120)&&h(D[1],120)&&h(D[2],120);return!t}}function h(e,t){return Math.floor(e/t)==e/t}function m(e){var t,n,o;return e*=v.pulseScale,1>e?t=e-(1-Math.exp(-e)):(n=Math.exp(-1),e-=1,o=1-Math.exp(-e),t=n+o*(1-n)),t*v.pulseNormalize}function p(e){return e>=1?1:0>=e?0:(1==v.pulseNormalize&&(v.pulseNormalize/=m(1)),m(e))}var w,g={frameRate:150,animationTime:500,stepSize:120,pulseAlgorithm:!0,pulseScale:8,pulseNormalize:1,accelerationDelta:20,accelerationMax:1,keyboardSupport:!0,arrowScroll:50,touchpadSupport:!0,fixedBackground:!0,excluded:""},v=g,b=!1,y=!1,k={x:0,y:0},x=!1,S=document.documentElement,D=[120,120,120],H={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},v=g,M=[],T=!1,C=+new Date,E={};setInterval(function(){E={}},1e4);var z,A=function(){var e=0;return function(t){return t.uniqueID||(t.uniqueID=e++)}}(),N=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(e,t,n){window.setTimeout(e,n||1e3/60)}}(),K=/chrome/i.test(window.navigator.userAgent),L=null;"onwheel"in document.createElement("div")?L="wheel":"onmousewheel"in document.createElement("div")&&(L="mousewheel"),L&&K&&(u(L,o),u("mousedown",a),u("load",t))}(); } /***************** Sliders ******************/ //gallery function flexsliderInit(){ $('.flex-gallery').each(function(){ var $that = $(this); imagesLoaded($(this),function(instance){ $that.flexslider({ animation: 'fade', smoothHeight: false, animationSpeed: 500, useCSS: false, touch: true }); ////gallery slider add arrows $('.flex-gallery .flex-direction-nav li a.flex-next').html(''); $('.flex-gallery .flex-direction-nav li a.flex-prev').html(''); }); }); } flexsliderInit(); function flickityInit() { if($('.nectar-flickity:not(.masonry)').length == 0) return false; $flickitySliders = []; $('.nectar-flickity:not(.masonry)').each(function(i){ $(this).removeClass(function (index, className) { return (className.match (/(^|\s)instance-\S+/g) || []).join(' '); }); $(this).addClass('instance-'+i); var $freeScrollBool = ($(this).is('[data-free-scroll]') && $(this).attr('data-free-scroll') == 'true') ? true : false; var $groupCellsBool = true; var $flickContainBool = true; var $flcikAttr = 0.025; var $flickCellAlign = 'center'; if( $(this).is('[data-format="fixed_text_content_fullwidth"]') ) { $flickCellAlign = 'left'; $groupCellsBool = false; $flickContainBool = false; $flcikAttr = 0.02; } if($freeScrollBool == true) { $groupCellsBool = false; } if($(this).attr('data-controls').length > 0 && $(this).attr('data-controls') == 'next_prev_arrows') { var $paginationBool = false; var $nextPrevArrowBool = true; } else { var $paginationBool = true; var $nextPrevArrowBool = false; } if($(this).attr('data-controls').length > 0 && $(this).attr('data-controls') == 'none') { var $paginationBool = false; var $nextPrevArrowBool = false; } var $flickity_autoplay = false; var $selectedAttraction = 0.025; if($(this).is('[data-autoplay]') && $(this).attr('data-autoplay') == 'true') { $flickity_autoplay = true; $selectedAttraction = 0.019; if($(this).is('[data-autoplay-dur]') && $(this).attr('data-autoplay-dur').length > 0) { if(parseInt($(this).attr('data-autoplay-dur')) > 100 && parseInt($(this).attr('data-autoplay-dur')) < 30000) { $flickity_autoplay = parseInt($(this).attr('data-autoplay-dur')); } } } var $that = $(this); var $frontEndEditorDrag = ($('body.vc_editor').length > 0) ? false: true; var $frontEndEditorPause = ($('body.vc_editor').length > 0) ? true: false; $flickitySliders[i] = new Flickity('.nectar-flickity.instance-'+i, { contain: $flickContainBool, draggable:$frontEndEditorDrag, lazyLoad: false, imagesLoaded: true, percentPosition: true, cellAlign: $flickCellAlign, selectedAttraction: $selectedAttraction, groupCells: $groupCellsBool, prevNextButtons: $nextPrevArrowBool, freeScroll: $freeScrollBool, pageDots: $paginationBool, resize: true, selectedAttraction: $flcikAttr, autoPlay: $flickity_autoplay, pauseAutoPlayOnHover: $frontEndEditorPause, setGallerySize: true, wrapAround: true, accessibility: false, arrowShape: { x0: 20, x1: 70, y1: 30, x2: 70, y2: 25, x3: 70 } }); if($(this).is('[data-format="fixed_text_content_fullwidth"]') && !nectarDOMInfo.usingFrontEndEditor) { var $onMobileBrowser = navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/); $flickitySliders[i].on( 'scroll', function() { if($onMobileBrowser) { return; } var $curFlkSlid = $flickitySliders[i]; var $flkSlideWidth = $that.find('.cell').outerWidth() + 25; var $leftHeaderSize = ($('body[data-header-format="left-header"]').length > 0 && $(window).width() > 1000) ? 275 : 0; var $extraWindowSpace = ( ($(window).width() + $leftHeaderSize) - $that.parents('.main-content').width())/2; $extraWindowSpace += parseInt($that.css('margin-left')) + 2; $flickitySliders[i].slides.forEach( function( slide, j ) { var $scaleAmt = 1; var $translateXAmt = 0; var $rotateAmt = 0; var $slideZIndex = 10; var $opacityAmt = 1; var $slideOffset = $(slide.cells[0].element).offset().left; var flkInstanceSlide = $('.nectar-flickity.instance-'+i+' .cell:nth-child('+ (j+1) +')'); if($slideOffset - $extraWindowSpace < 0 && $slideOffset - $extraWindowSpace > $flkSlideWidth*-1 ) { $scaleAmt = 1 + ( ($slideOffset - $extraWindowSpace) / 1500); $opacityAmt = 1 + ( ($slideOffset - $extraWindowSpace + 70) / 550); $translateXAmt = ( ($slideOffset - $extraWindowSpace)) * -1; $rotateAmt = ( ($slideOffset - $extraWindowSpace) / 25) * -1; } else { $scaleAmt = 1; $opacityAmt = 1; $translateXAmt = 0; $rotateAmt = 0; } //handle z separately for an extra cushion of 5px in case if($slideOffset + 5 - $extraWindowSpace < 0 && $slideOffset - $extraWindowSpace > $flkSlideWidth*-1 ) { $slideZIndex = 5; } else { $slideZIndex = 10; } flkInstanceSlide.css({ 'z-index' : $slideZIndex }); flkInstanceSlide.find('.inner-wrap-outer').css({ 'transform': 'perspective(800px) translateX('+ $translateXAmt +'px) rotateY('+$rotateAmt+'deg) translateZ(0)', 'opacity' : $opacityAmt }); flkInstanceSlide.find('.inner-wrap').css({ 'transform': 'scale('+ $scaleAmt +') translateZ(0)' }); }); }); } var $removeHiddenTimeout; $flickitySliders[i].on( 'dragStart', function() { clearTimeout($removeHiddenTimeout); $that.addClass('is-dragging'); $that.find('.flickity-prev-next-button').addClass('hidden'); }); $flickitySliders[i].on( 'dragEnd', function() { $that.removeClass('is-dragging'); $removeHiddenTimeout = setTimeout(function(){ $that.find('.flickity-prev-next-button').removeClass('hidden'); },600); }); $('.flickity-prev-next-button').on( 'click', function() { clearTimeout($removeHiddenTimeout); $(this).parents('.nectar-flickity').find('.flickity-prev-next-button').addClass('hidden'); $removeHiddenTimeout = setTimeout(function(){ $that.find('.flickity-prev-next-button').removeClass('hidden'); },600); }); //imgs loaded if($that.hasClass('nectar-carousel')) { imagesLoaded($that,function(instance){ nectarCarouselFlkEH($that); }); } }); } setTimeout(flickityInit,100); //nectar carousel flickity equal height ////loop function setNectarCarouselFlkEH() { $('.nectar-carousel.nectar-flickity:not(.masonry)').each(function(){ nectarCarouselFlkEH($(this)); }); } function nectarCarouselFlkEH($slider_instance) { var $tallestSlideCol = 0; $slider_instance.find('.flickity-slider > .cell').css('height','auto'); $slider_instance.find('.flickity-slider > .cell').each(function(){ ($(this).height() > $tallestSlideCol) ? $tallestSlideCol = $(this).height() : $tallestSlideCol = $tallestSlideCol; }); //safety net incase height couldn't be determined if($tallestSlideCol < 10) $tallestSlideCol = 'auto'; //set even height $slider_instance.find('.flickity-slider > .cell').css('height',$tallestSlideCol+'px'); } function flickityBlogInit() { if($('.nectar-flickity.masonry.not-initialized').length == 0) return false; $('.nectar-flickity.masonry.not-initialized').each(function(){ //move pos for large_featured if($(this).parents('article').hasClass('large_featured')) $(this).insertBefore( $(this).parents('article').find('.content-inner') ); }); $('.nectar-flickity.masonry.not-initialized').flickity({ contain: true, draggable: false, lazyLoad: false, imagesLoaded: true, percentPosition: true, prevNextButtons: true, pageDots: false, resize: true, setGallerySize: true, wrapAround: true, accessibility: false }); $('.nectar-flickity.masonry').removeClass('not-initialized'); //add count $('.nectar-flickity.masonry:not(.not-initialized)').each(function(){ if($(this).find('.item-count').length == 0) { $('
').insertBefore($(this).find('.flickity-prev-next-button.next')); $(this).find('.item-count').html('1/' + $(this).find('.flickity-slider .cell').length + ''); $(this).find('.flickity-prev-next-button, .item-count').wrapAll('
'); //move pos for wide_tall if($(this).parents('article').hasClass('wide_tall') && $(this).parents('.masonry.material').length == 0) $(this).find('.control-wrap').insertBefore( $(this) ); } }); //update count $('.masonry .flickity-prev-next-button.previous, .masonry .flickity-prev-next-button.next').on('click',function(){ if($(this).parents('.wide_tall').length > 0) $(this).parent().find('.item-count .current').html($(this).parents('article').find('.nectar-flickity .cell.is-selected').index()+1); else $(this).parent().find('.item-count .current').html($(this).parents('.nectar-flickity').find('.cell.is-selected').index()+1); }); $('body').on('mouseover','.flickity-prev-next-button.next',function(){ $(this).parent().find('.flickity-prev-next-button.previous, .item-count').addClass('next-hovered'); }); $('body').on('mouseleave','.flickity-prev-next-button.next',function(){ $(this).parent().find('.flickity-prev-next-button.previous, .item-count').removeClass('next-hovered'); }); } /****************twenty twenty******************/ function twentytwentyInit() { $('.twentytwenty-container').each(function(){ var $that = $(this); if($that.find('.twentytwenty-handle').length == 0) { $(this).imagesLoaded(function(){ $that.twentytwenty(); }); } }); } twentytwentyInit(); /****************split line text******************/ if($('.nectar-recent-posts-single_featured.multiple_featured').length > 0) { splitLineText(); } /****************full page******************/ var $frontEndEditorFPRDiv = ''; var $usingFullScreenRows = false; var $fullscreenSelector = ''; var $disableFPonMobile = ($('#nectar_fullscreen_rows[data-mobile-disable]').length > 0) ? $('#nectar_fullscreen_rows').attr('data-mobile-disable') : 'off'; var $onMobileBrowser = navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/); if(!$onMobileBrowser) { $disableFPonMobile = 'off'; } //change anchor link IDs for when disabled on mobile if($disableFPonMobile == 'on' && $('#nectar_fullscreen_rows').length > 0) { $('#nectar_fullscreen_rows > .wpb_row[data-fullscreen-anchor-id]').each(function(){ if($(this).attr('data-fullscreen-anchor-id').length > 0) $(this).attr('id',$(this).attr('data-fullscreen-anchor-id')); }); //remove main content row padding $('.container-wrap .main-content > .row').css({'padding-bottom':'0'}); //extra padding for first row is using transparent header if( $('#nectar_fullscreen_rows > .wpb_row:nth-child(1)').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0 && !$('#nectar_fullscreen_rows > .wpb_row:nth-child(1)').hasClass('full-width-content') ) { $('#nectar_fullscreen_rows > .wpb_row:nth-child(1)').addClass('extra-top-padding'); } } if($('#nectar_fullscreen_rows').length > 0 && $disableFPonMobile != 'on' || $().fullpage && $disableFPonMobile != 'on') { function setFPNavColoring(index,direction) { if($('#boxed').length > 0 && overallWidth > 750) return; if($('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv+':nth-child('+index+')').find('.span_12.light').length > 0) { $('#fp-nav').addClass('light-controls'); if(direction == 'up') $('#header-outer.dark-slide').removeClass('dark-slide'); else setTimeout(function(){ $('#header-outer.dark-slide').removeClass('dark-slide'); },520); } else { $('#fp-nav.light-controls').removeClass('light-controls'); if(direction == 'up') $('#header-outer').addClass('dark-slide'); else setTimeout(function(){ $('#header-outer').addClass('dark-slide'); },520); } //handle n slider coloring if($('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv+':nth-child('+index+')').find('.nectar-slider-wrap[data-fullscreen="true"]').length > 0) { var $currentSlider = $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv+':nth-child('+index+')').find('.nectar-slider-wrap[data-fullscreen="true"]'); if( $currentSlider.is('[data-overall_style="directional"]') && $('#header-outer #logo span.dark').length > 0 ){ $('#header-outer').addClass('directional-nav-effect').removeClass('dne-disabled'); } if($currentSlider.find('.swiper-slide-active[data-color-scheme="light"]').length > 0) { $('#header-outer').removeClass('dark-slide'); } else if($currentSlider.find('.swiper-slide-active[data-color-scheme="dark"]').length > 0) { $('#header-outer').addClass('dark-slide'); } } else { $('#header-outer').removeClass('directional-nav-effect').addClass('dne-disabled'); } } var $anchors = []; var $names = []; function setFPNames() { $anchors = []; $names = []; $frontEndEditorFPRDiv = (window.vc_iframe) ? '> .vc_element': '> .wpb_row'; $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv).each(function(i){ var $id = ($(this).is('[data-fullscreen-anchor-id]')) ? $(this).attr('data-fullscreen-anchor-id') : ''; //anchor checks if($('#nectar_fullscreen_rows[data-anchors="on"]').length > 0) { if($id.indexOf('fws_') == -1) $anchors.push($id); else $anchors.push('section-'+(i+1)); } //name checks if($(this).find('.full-page-inner-wrap[data-name]').length > 0) $names.push($(this).find('.full-page-inner-wrap').attr('data-name')); else $names.push(' '); }); } setFPNames(); function initFullPageFooter() { var $footerPos = $('#nectar_fullscreen_rows').attr('data-footer'); if($footerPos == 'default') { $('#footer-outer').appendTo('#nectar_fullscreen_rows').addClass('fp-auto-height').addClass('fp-section').addClass('wpb_row').attr('data-anchor',' ').wrapInner('
').wrapInner('
').wrapInner('
').wrapInner('
').wrapInner('
'); } else if($footerPos == 'last_row') { $('#footer-outer').remove(); $('#nectar_fullscreen_rows > .wpb_row:last-child').attr('id','footer-outer').addClass('fp-auto-height'); } else { $('#footer-outer').remove(); } } if($('#nectar_fullscreen_rows').length > 0) initFullPageFooter(); //fullscreen row logic function fullscreenRowLogic() { $('.full-page-inner-wrap .full-page-inner > .span_12 > .wpb_column').each(function(){ if($(this).find('> .vc_column-inner > .wpb_wrapper').find('> .wpb_row').length > 0) { //add class for css $(this).find('> .vc_column-inner > .wpb_wrapper').addClass('only_rows'); //set number of rows for css var $rowNum = $(this).find('> .vc_column-inner > .wpb_wrapper').find('> .wpb_row').length; $(this).find('> .vc_column-inner > .wpb_wrapper').attr('data-inner-row-num',$rowNum); } else if($(this).find('> .column-inner-wrap > .column-inner > .wpb_wrapper').find('> .wpb_row').length > 0) { //add class for css $(this).find('> .column-inner-wrap > .column-inner > .wpb_wrapper').addClass('only_rows'); //set number of rows for css var $rowNum = $(this).find('> .column-inner-wrap > .column-inner > .wpb_wrapper').find('> .wpb_row').length; $(this).find('> .column-inner-wrap > .column-inner > .wpb_wrapper').attr('data-inner-row-num',$rowNum); } }); } fullscreenRowLogic(); function fullHeightRowOverflow() { //handle rows with full height that are larger than viewport if($(window).width() >= 1000) { $('#nectar_fullscreen_rows > .wpb_row .full-page-inner-wrap[data-content-pos="full_height"]').each(function(){ //reset mobile calcs incase user plays with window resize $(this).find('> .full-page-inner').css('height','100%'); var maxHeight = overallHeight; var columnPaddingTop = 0; var columnPaddingBottom = 0; if($('#nectar_fullscreen_rows').attr('data-animation') == 'none') $(this).find('> .full-page-inner > .span_12 ').css('height','100%'); else $(this).find('> .full-page-inner > .span_12 ').css('height',overallHeight); $(this).find('> .full-page-inner > .span_12 > .wpb_column > .vc_column-inner > .wpb_wrapper').each(function(){ columnPaddingTop = parseInt($(this).parents('.wpb_column').css('padding-top')); columnPaddingBottom = parseInt($(this).parents('.wpb_column').css('padding-bottom')); maxHeight = maxHeight > $(this).height() + columnPaddingTop + columnPaddingBottom ? maxHeight : $(this).height() + columnPaddingTop + columnPaddingBottom; }); if(maxHeight > overallHeight) $(this).find('> .full-page-inner > .span_12').height(maxHeight).css('float','none'); }); } else { //mobile min height set $('#nectar_fullscreen_rows > .wpb_row').each(function(){ $totalColHeight = 0; $(this).find('.fp-scrollable > .fp-scroller > .full-page-inner-wrap-outer > .full-page-inner-wrap[data-content-pos="full_height"] > .full-page-inner > .span_12 > .wpb_column').each(function(){ $totalColHeight += $(this).outerHeight(true); }); $(this).find('.fp-scrollable > .fp-scroller > .full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner').css('height','100%'); if($totalColHeight > $(this).find('.fp-scrollable > .fp-scroller > .full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner').height()) $(this).find('.fp-scrollable > .fp-scroller > .full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner').height($totalColHeight); }); } } function fullscreenElementSizing() { //nectar slider var $nsSelector = '.nectar-slider-wrap[data-fullscreen="true"][data-full-width="true"], .nectar-slider-wrap[data-fullscreen="true"][data-full-width="boxed-full-width"]'; if($('.nectar-slider-wrap[data-fullscreen="true"][data-full-width="true"]').length > 0 || $('.nectar-slider-wrap[data-fullscreen="true"][data-full-width="boxed-full-width"]').length > 0) { if($('#nectar_fullscreen_rows .wpb_row').length > 0) $($nsSelector).find('.swiper-container').attr('data-height',$('#nectar_fullscreen_rows .wpb_row').height()+1); $(window).trigger('resize.nsSliderContent'); $($nsSelector).parents('.full-page-inner').addClass('only-nectar-slider'); } } //kenburns first slide fix $('#nectar_fullscreen_rows[data-row-bg-animation="ken_burns"] > .wpb_row:first-child .row-bg.using-image').addClass('kenburns'); setTimeout(function(){ //ken burns first slide fix $('#nectar_fullscreen_rows[data-row-bg-animation="ken_burns"] > .wpb_row:first-child .row-bg.using-image').removeClass('kenburns'); },500); //remove kenburns from safari if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) $('#nectar_fullscreen_rows[data-row-bg-animation="ken_burns"]').attr('data-row-bg-animation','none'); var overallHeight = $(window).height(); var overallWidth = $(window).width(); var $fpAnimation = $('#nectar_fullscreen_rows').attr('data-animation'); var $fpAnimationSpeed; var $svgResizeTimeout; switch($('#nectar_fullscreen_rows').attr('data-animation-speed')) { case 'slow': $fpAnimationSpeed = 1150; break; case 'medium': $fpAnimationSpeed = 850; break; case 'fast': $fpAnimationSpeed = 650; break; default: $fpAnimationSpeed = 850; } function heyFirefoxDrawTheEl(){ var $drawTheEl = $('#nectar_fullscreen_rows > div:first-child').height(); if($('#nectar_fullscreen_rows.trans-animation-active').length > 0){ requestAnimationFrame(heyFirefoxDrawTheEl); } } function initNectarFP() { $frontEndEditorFPRDiv = (window.vc_iframe) ? '> .vc_element': '> .wpb_row'; if(window.vc_iframe) { setTimeout(function(){ $('html,body').css({ 'height':'100%', 'overflow-y':'hidden' }); },100); //remove scrolling to help performance of FE editor $('body,html').on("mousewheel.removeScroll", function() { return false; }); } //move row IDs onto parents for front end editor if($('body.vc_editor').length > 0) { $('#nectar_fullscreen_rows > .vc_empty-placeholder').remove(); $('#nectar_fullscreen_rows > .vc_element').each(function(){ var innerRowID = $(this).find('> .wpb_row').attr('id'); $(this).attr('id',innerRowID); }); } $usingFullScreenRows = true; $fullscreenSelector = (window.vc_iframe) ? '.vc_element.vc_vc_row.active ' : '.wpb_row.active '; $('.container-wrap, .container-wrap .main-content > .row').css({'padding-bottom':'0', 'margin-bottom': '0'}); $('#nectar_fullscreen_rows').fullpage({ sectionSelector: '#nectar_fullscreen_rows '+$frontEndEditorFPRDiv, navigation: true, css3: true, scrollingSpeed: $fpAnimationSpeed, anchors: $anchors, scrollOverflow: true, navigationPosition: 'right', navigationTooltips: $names, afterLoad: function(anchorLink, index, slideAnchor, slideIndex){ if($('#nectar_fullscreen_rows').hasClass('afterLoaded')) { //ensure no scrolling body occurs if(nectarDOMInfo.scrollTop != 0) { window.scrollTo(0,0); } //reset slim scroll to top $('.wpb_row:not(.last-before-footer):not(:nth-child('+index+')) .fp-scrollable').each(function(){ var $scrollable = $(this).data('iscrollInstance'); $scrollable.scrollTo(0,0); }); //reset carousel $('.wpb_row:not(:nth-child('+index+')) .owl-carousel').trigger('to.owl.carousel',[0]); var $row_id = $('#nectar_fullscreen_rows > .wpb_row:nth-child('+index+')').attr('id'); $('#nectar_fullscreen_rows '+$frontEndEditorFPRDiv).removeClass('transition-out').removeClass('trans'); $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':nth-child('+index+')').removeClass('next-current'); $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':nth-child('+index+') .full-page-inner-wrap-outer').css({'height': '100%'}); $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +' .full-page-inner-wrap-outer').css({'transform':'none'}); //take care of nav/control coloring //setFPNavColoring(index,'na'); //handle waypoints if($row_id != 'footer-outer' && $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':nth-child('+index+').last-before-footer').length == 0) { waypoints(); if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) && !nectarDOMInfo.usingFrontEndEditor) { resetWaypoints(); Waypoint.destroyAll(); startMouseParallax(); } if(!nectarDOMInfo.usingFrontEndEditor) { nectarLiquidBGFP(); } responsiveTooltips(); } if($row_id !='footer-outer') { $('#nectar_fullscreen_rows ' + $frontEndEditorFPRDiv).removeClass('last-before-footer').css('transform','initial'); //reset animation attrs if(!window.vc_iframe) { $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':not(.active):not(#footer-outer)').css({'transform':'translateY(0)','left':'-9999px', 'transition': 'none', 'opacity':'1', 'will-change':'auto'}); $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':not(#footer-outer)').find('.full-page-inner-wrap-outer').css({'transition': 'none', 'transform':'none', 'will-change':'auto'}); $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':not(#footer-outer)').find('.fp-tableCell').css({'transition': 'none', 'transform':'none', 'will-change':'auto'}); } //stacking fix $('#nectar_fullscreen_rows '+ $frontEndEditorFPRDiv +':not(#footer-outer)').find('.full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner > .container').css({'backface-visibility':'visible', 'z-index':'auto'}); } } else { fullHeightRowOverflow(); overallHeight = $('#nectar_fullscreen_rows').height(); $('#nectar_fullscreen_rows').addClass('afterLoaded'); //for users that have scrolled down prior to turning on full page setTimeout(function(){ window.scrollTo(0,0); },1800); //ken burns first slide fix $('#nectar_fullscreen_rows[data-row-bg-animation="ken_burns"] '+ $frontEndEditorFPRDiv +':first-child .row-bg.using-image').removeClass('kenburns'); //handle fullscreen elements fullscreenElementSizing(); } $('#nectar_fullscreen_rows').removeClass('nextSectionAllowed'); }, onLeave: function(index, nextIndex, direction){ $('#nectar_fullscreen_rows').addClass('trans-animation-active'); var $row_id = $('#nectar_fullscreen_rows ' + $frontEndEditorFPRDiv + ':nth-child('+nextIndex+')').attr('id'); var $indexRow = $('#nectar_fullscreen_rows ' + $frontEndEditorFPRDiv + ':nth-child('+index+')'); var $nextIndexRow = $('#nectar_fullscreen_rows ' + $frontEndEditorFPRDiv + ':nth-child('+nextIndex+')'); var $nextIndexRowInner = $nextIndexRow.find('.full-page-inner-wrap-outer'); var $nextIndexRowFpTable = $nextIndexRow.find('.fp-tableCell'); //mobile/safari fix var $transformProp = (!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) ? 'transform' : 'all'; //if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) $transformProp = 'all'; if( $row_id == 'footer-outer') { $indexRow.addClass('last-before-footer'); $('#footer-outer').css('opacity','1'); } else { $('#nectar_fullscreen_rows '+$frontEndEditorFPRDiv+'.last-before-footer').css('transform','translateY(0px)'); $('#footer-outer').css('opacity','0'); } if($indexRow.attr('id') == 'footer-outer') { $('#footer-outer').css({'transition': $transformProp+' 460ms cubic-bezier(0.60, 0.23, 0.2, 0.93)', 'backface-visibility': 'hidden'}); $('#footer-outer').css({'transform': 'translateY(45%) translateZ(0)'}); } //stacking fix if($nextIndexRow.attr('id') != 'footer-outer') { $nextIndexRowFpTable.find('.full-page-inner-wrap-outer > .full-page-inner-wrap > .full-page-inner > .container').css({'backface-visibility':'hidden', 'z-index':'110'}); } //animation if($nextIndexRow.attr('id') != 'footer-outer' && $indexRow.attr('id') != 'footer-outer' && $('#nectar_fullscreen_rows[data-animation="none"]').length == 0 ) { //scrolling down if(direction == 'down') { if($fpAnimation == 'parallax') { $indexRow.css({'transition': $transformProp+' '+$fpAnimationSpeed+'ms cubic-bezier(.29,.23,.13,1)', 'will-change':'transform', 'transform':'translateZ(0)' ,'z-index': '100'}); setTimeout(function() { $indexRow.css({'transform': 'translateY(-50%) translateZ(0)'}); }, 60); $nextIndexRow.css({'z-index':'1000','top':'0','left':'0'}); $nextIndexRowFpTable.css({'transform':'translateY(100%) translateZ(0)', 'will-change':'transform'}); $nextIndexRowInner.css({'transform':'translateY(-50%) translateZ(0)', 'will-change':'transform'}); } else if($fpAnimation == 'zoom-out-parallax') { $indexRow.css({'transition': 'opacity '+$fpAnimationSpeed+'ms cubic-bezier(0.37, 0.31, 0.2, 0.85), transform '+$fpAnimationSpeed+'ms cubic-bezier(0.37, 0.31, 0.2, 0.85)', 'z-index': '100', 'will-change':'transform'}); setTimeout(function() { $indexRow.css({'transform': 'scale(0.77) translateZ(0)', 'opacity': '0'}); }, 60); $nextIndexRow.css({'z-index':'1000','top':'0','left':'0'}); $nextIndexRowFpTable.css({'transform':'translateY(100%) translateZ(0)', 'will-change':'transform'}); $nextIndexRowInner.css({'transform':'translateY(-50%) translateZ(0)', 'will-change':'transform'}); } } //scrolling up else { if($fpAnimation == 'parallax') { $indexRow.css({'transition': $transformProp+' '+$fpAnimationSpeed+'ms cubic-bezier(.29,.23,.13,1)', 'z-index': '100', 'will-change':'transform'}); setTimeout(function() { $indexRow.css({'transform': 'translateY(50%) translateZ(0)'}); }, 60); $nextIndexRow.css({'z-index':'1000','top':'0','left':'0'}); $nextIndexRowFpTable.css({'transform':'translateY(-100%) translateZ(0)','will-change':'transform'}); $nextIndexRowInner.css({'transform':'translateY(50%) translateZ(0)','will-change':'transform'}); } else if($fpAnimation == 'zoom-out-parallax') { $indexRow.css({'transition': 'opacity '+$fpAnimationSpeed+'ms cubic-bezier(0.37, 0.31, 0.2, 0.85), transform '+$fpAnimationSpeed+'ms cubic-bezier(0.37, 0.31, 0.2, 0.85)', 'z-index': '100', 'will-change':'transform'}); setTimeout(function() { $indexRow.css({'transform': 'scale(0.77) translateZ(0)', 'opacity': '0'}); }, 60); $nextIndexRow.css({'z-index':'1000','top':'0','left':'0'}); $nextIndexRowFpTable.css({'transform':'translateY(-100%) translateZ(0)', 'will-change':'transform'}); $nextIndexRowInner.css({'transform':'translateY(50%) translateZ(0)', 'will-change':'transform'}); } } setTimeout(function() { $nextIndexRowFpTable.css({'transition':$transformProp+' '+$fpAnimationSpeed+'ms cubic-bezier(.29,.23,.13,1) 0ms', 'transform':'translateY(0%) translateZ(0)'}); if($fpAnimation != 'none') { $nextIndexRowInner.css({'transition':$transformProp+' '+$fpAnimationSpeed+'ms cubic-bezier(.29,.23,.13,1) 0ms', 'transform':'translateY(0%) translateZ(0)'}); if(navigator.userAgent.indexOf('Firefox') != -1) { requestAnimationFrame(heyFirefoxDrawTheEl); } } },60); } //adjust transform if larger than row height for parallax if($('#nectar_fullscreen_rows[data-animation="none"]').length == 0 && $nextIndexRow.find('.fp-scrollable').length > 0) { $nextIndexRow.find('.full-page-inner-wrap-outer').css('height',overallHeight); } setTimeout(function() { if( $row_id == 'footer-outer') { $indexRow.css('transform','translateY(-'+($('#footer-outer').height()-1)+'px)'); $('#footer-outer').css({'transform': 'translateY(45%) translateZ(0)'}); $('#footer-outer').css({'transition-duration': '0s', 'backface-visibility': 'hidden'}); setTimeout(function() { $('#footer-outer').css({'transition': $transformProp+' 500ms cubic-bezier(0.60, 0.23, 0.2, 0.93)', 'backface-visibility': 'hidden'}); $('#footer-outer').css({'transform': 'translateY(0%) translateZ(0)'}); },30); } },30); if($row_id!='footer-outer') { stopMouseParallax(); //take care of nav/control coloring setFPNavColoring(nextIndex,direction); //handle main nav link highlight setTimeout(function(){ FPActiveMenuItems(nextIndex); },50); } }, afterResize: function(){ overallHeight = $('#nectar_fullscreen_rows').height(); overallWidth = $(window).width(); fullHeightRowOverflow(); fullscreenElementSizing(); fullscreenFooterCalcs(); if( $('#footer-outer.active').length > 0) { setTimeout(function(){ $('.last-before-footer').css('transform','translateY(-'+$('#footer-outer').height()+'px)'); },200); } //fix for svg animations when resizing and iscroll wraps/unwraps clearTimeout($svgResizeTimeout); $svgResizeTimeout = setTimeout(function(){ if($svg_icons.length > 0) { $('.svg-icon-holder.animated-in').each(function(i){ $(this).css('opacity','1'); $svg_icons[$(this).find('svg').attr('id').slice(-1)].finish(); }); } },300); } }); } if(window.vc_iframe) { //do nothing } else { if($('#nectar_fullscreen_rows').length > 0) initNectarFP(); } $(window).smartresize(function(){ if($('#nectar_fullscreen_rows').length > 0) { setTimeout(function(){ $('.wpb_row:not(.last-before-footer) .fp-scrollable').each(function(){ var $scrollable = $(this).data('iscrollInstance'); $scrollable.refresh(); }); },200); fullHeightRowOverflow(); } }); function fullscreenFooterCalcs() { if($('#footer-outer.active').length > 0) { $('.last-before-footer').addClass('fp-notransition').css('transform','translateY(-'+$('#footer-outer').height()+'px)'); setTimeout(function(){ $('.last-before-footer').removeClass('fp-notransition'); },10); } } function stopMouseParallax(){ $.each($mouseParallaxScenes,function(k,v){ v.parallax('disable'); }); } function startMouseParallax(){ if($('#nectar_fullscreen_rows > .wpb_row.active .nectar-parallax-scene').length > 0) { $.each($mouseParallaxScenes,function(k,v){ v.parallax('enable'); }); } } if($('#nectar_fullscreen_rows').length > 0) { if(window.vc_iframe) { setTimeout(function(){ setFPNavColoring(1,'na'); },500); } else { setFPNavColoring(1,'na'); } fullscreenElementSizing(); //slide out right OCM material nav compat if($('body[data-slide-out-widget-area-style="slide-out-from-right"].material').length > 0) { $('#slide-out-widget-area .off-canvas-menu-container').find("a[href*='#']").on('click',function(e){ var $link_hash = $(this).prop("hash"); if($link_hash != '#' && $link_hash.indexOf("#") != -1 && $('div[data-fullscreen-anchor-id="'+$link_hash.substr($link_hash.indexOf("#")+1)+'"]').length > 0) { if($('body.material-ocm-open').length > 0) { $('body > .slide_out_area_close').addClass('non-human-allowed').trigger('click'); setTimeout(function(){ $('body > .slide_out_area_close').removeClass('non-human-allowed'); },100); } } // if a section has been found }); //click } } function FPActiveMenuItems(index) { if(!$('#nectar_fullscreen_rows[data-anchors="on"]').length > 0 || !index) return; var $hash = window.location.hash; var $hashSubstrng = ($hash && $hash.length > 0) ? $hash.substring(1,$hash.length) : ''; if($('body:not(.mobile) #header-outer[data-has-menu="true"]').length > 0 && $('#nectar_fullscreen_rows > .wpb_row:nth-child('+index+')[data-fullscreen-anchor-id]').length > 0 && $('header#top nav > ul.sf-menu > li').find('> a[href$="#'+$hashSubstrng+'"]').length > 0 ) { $('header#top nav > ul.sf-menu > li').removeClass('current-menu-item'); $('header#top nav > ul.sf-menu > li').find('> a[href$="'+$hashSubstrng+'"]').parent().addClass('current-menu-item'); } } function resetWaypoints() { //animated columns / imgs $('img.img-with-animation.animated-in:not([data-animation="none"])').css({'transition':'none'}); $('img.img-with-animation.animated-in:not([data-animation="none"])').css({'opacity':'0','transform':'none'}).removeClass('animated-in'); $('.col.has-animation.animated-in:not([data-animation*="reveal"]), .wpb_column.has-animation.animated-in:not([data-animation*="reveal"])').css({'transition':'none'}); $('.col.has-animation.animated-in:not([data-animation*="reveal"]), .wpb_column.has-animation.animated-in:not([data-animation*="reveal"]), .nectar_cascading_images .cascading-image:not([data-animation="none"]) .inner-wrap').css({'opacity':'0','transform':'none','left':'auto','right':'auto'}).removeClass('animated-in'); $('.col.has-animation.boxed:not([data-animation*="reveal"]), .wpb_column.has-animation.boxed:not([data-animation*="reveal"])').addClass('no-pointer-events'); //row BG animations $('.row-bg-wrap[data-bg-animation]:not([data-bg-animation="none"]):not([data-bg-animation*="displace-filter"]) .inner-wrap.using-image').removeClass('animated-in'); $('.column-image-bg-wrap[data-bg-animation]:not([data-bg-animation="none"]):not([data-bg-animation*="displace-filter"]) .inner-wrap').removeClass('animated-in'); //reveal columns $('.wpb_column.has-animation[data-animation*="reveal"], .nectar_cascading_images').removeClass('animated-in'); if(overallWidth > 1000 && $('.using-mobile-browser').length == 0) { $('.wpb_column.has-animation[data-animation="reveal-from-bottom"] > .column-inner-wrap').css({'transition':'none','transform':'translate(0, 100%)'}); $('.wpb_column.has-animation[data-animation="reveal-from-bottom"] > .column-inner-wrap > .column-inner').css({'transition':'none','transform':'translate(0, -90%)'}); $('.wpb_column.has-animation[data-animation="reveal-from-top"] > .column-inner-wrap').css({'transition':'none','transform':'translate(0, -100%)'}); $('.wpb_column.has-animation[data-animation="reveal-from-top"] > .column-inner-wrap > .column-inner').css({'transition':'none','transform':'translate(0, 90%)'}); $('.wpb_column.has-animation[data-animation="reveal-from-left"] > .column-inner-wrap').css({'transition-duration':'0s','transform':'translate(-100%, 0)'}); $('.wpb_column.has-animation[data-animation="reveal-from-left"] > .column-inner-wrap > .column-inner').css({'transition-duration':'0s','transform':'translate(90%, 0)'}); $('.wpb_column.has-animation[data-animation="reveal-from-right"] > .column-inner-wrap').css({'transition-duration':'0s','transform':'translate(100%, 0)'}); $('.wpb_column.has-animation[data-animation="reveal-from-right"] > .column-inner-wrap > .column-inner').css({'transition-duration':'0s','transform':'translate(-90%, 0)'}); } $('.wpb_column.has-animation[data-animation*="reveal"] > .column-inner-wrap, .wpb_column.has-animation[data-animation*="reveal"] > .column-inner-wrap > .column-inner').removeClass('no-transform'); //vcwaypoints $('.wpb_animate_when_almost_visible.animated').removeClass('wpb_start_animation').removeClass('animated'); //column borders $('.wpb_column[data-border-animation="true"] .border-wrap.animation').removeClass('animation').removeClass('completed'); //milestone $('.nectar-milestone.animated-in').removeClass('animated-in').removeClass('in-sight'); $('.nectar-milestone .symbol').removeClass('in-sight'); //fancy ul $('.nectar-fancy-ul[data-animation="true"]').removeClass('animated-in'); $('.nectar-fancy-ul[data-animation="true"] ul li').css({'opacity':'0','left':'-20px'}); //progress bars $('.nectar-progress-bar').parent().removeClass('completed'); $('.nectar-progress-bar .bar-wrap > span').css({'width':'0px'}); $('.nectar-progress-bar .bar-wrap > span > strong').css({'opacity':'0'}); //$('.nectar-progress-bar .bar-wrap').css({'opacity':'0'}); //clients $('.clients.fade-in-animation').removeClass('animated-in'); $('.clients.fade-in-animation > div').css('opacity','0'); //carousel $('.owl-carousel[data-enable-animation="true"]').removeClass('animated-in'); $('.owl-carousel[data-enable-animation="true"] .owl-stage > .owl-item').css({'transition':'none','opacity':'0','transform':'translate(0, 70px)'}); //dividers $('.divider-small-border[data-animate="yes"], .divider-border[data-animate="yes"]').removeClass('completed').css({'transition':'none','transform':'scale(0,1)'}); //icon list $('.nectar-icon-list').removeClass('completed'); $('.nectar-icon-list-item').removeClass('animated'); //portfolio $('.portfolio-items .col').removeClass('animated-in'); //split line $('.nectar-split-heading').removeClass('animated-in'); $('.nectar-split-heading .heading-line > div').transit({'y':'200%'},0); //image with hotspots $('.nectar_image_with_hotspots[data-animation="true"]').removeClass('completed'); $('.nectar_image_with_hotspots[data-animation="true"] .nectar_hotspot_wrap').removeClass('animated-in'); //animated titles $('.nectar-animated-title').removeClass('completed'); //highlighted text $('.nectar-highlighted-text em').removeClass('animated'); if($('.vc_pie_chart').length > 0) { vc_pieChart(); } $('.col.has-animation:not([data-animation*="reveal"]), .wpb_column.has-animation:not([data-animation*="reveal"])').each(function(i) { //clear previous timeout (needed for fullscreen rows) clearTimeout($standAnimatedColTimeout[i]); }); } } else if($('#nectar_fullscreen_rows').length > 0 && $disableFPonMobile == 'on' || $().fullpage && $disableFPonMobile == 'on') { //remove markup $('html,body').css({'height':'auto','overflow-y':'auto'}); } function nectarLiquidBGFP(){ $('.nectar-liquid-bg').removeClass('animated-in'); for(var k=0; k<$liquidBG_EL.length;k++) { if($liquidBG_EL[k].animationType == 'displace-filter-fade' && $($liquidBG_EL[k].canvasContainer).parents('.fp-section.active').length > 0) { //add bg to container if($($liquidBG_EL[k].canvasContainer).find('.image-added-to-stage').length == 0) { $liquidBG_EL[k].imgContainer.addChild( $liquidBG_EL[k].bg ); } $($liquidBG_EL[k].canvasContainer).find('.nectar-liquid-bg').addClass('image-added-to-stage'); $liquidBG_EL[k].animateProps($liquidBG_EL[k]); } } } /***************** Superfish ******************/ function initSF(){ if($('body[data-header-format="left-header"]').length == 0) { var $disableHI = ($('body[data-dropdown-style="minimal"]').length > 0 && !($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0) ) ? true : false; $(".sf-menu").superfish({ delay: 650, speed: 'fast', disableHI: $disableHI, speedOut: 'fast', animation: {opacity:'show'} }); //handle initial show on left class for minimal styling $('#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul').each(function(){ if($(this).offset().left + $(this).outerWidth() > $(window).width()) { $(this).addClass('on-left-side'); $(this).find('ul').addClass('on-left-side'); } }); //megamenu multi section per column title support $('body:not([data-header-format="left-header"]) header#top nav > ul > li.megamenu > ul > li > ul > li:has("> ul")').addClass('has-ul'); //fullwidth megamenu if($('body[data-megamenu-width="full-width"]').length > 0 && $('ul.sub-menu').length > 0) { megamenuFullwidth(); $(window).on('smartresize',megamenuFullwidth); $('header#top nav > ul > li.megamenu > .sub-menu').css('box-sizing','content-box'); } //extra hover class for megamenu check $('header#top nav > ul.sf-menu > li').on('mouseenter',function(){ $(this).addClass('menu-item-over'); }); $('header#top nav > ul.sf-menu > li').on('mouseleave',function(){ $(this).removeClass('menu-item-over'); }); //remove arrows on mega menu item $('header#top nav .megamenu .sub-menu a.sf-with-ul .sf-sub-indicator, header#top .megamenu .sub-menu a .sf-sub-indicator').remove(); //blank title megamenu columns ////desktop $('header#top nav > ul > li.megamenu > ul.sub-menu > li > a').each(function(){ if( $(this).text() == '–' ) { $(this).remove(); } }); } } function megamenuFullwidth() { var $windowWidth = $(window).width(); var $headerContainerWidth = $('header#top > .container').width(); $('header#top nav > ul > li.megamenu > .sub-menu').css({ 'padding-left' : ($windowWidth - $headerContainerWidth)/2 + 'px', 'padding-right' : ($windowWidth+2 - $headerContainerWidth)/2 + 'px', 'width' : $headerContainerWidth, 'left' : '-' + ($windowWidth - $headerContainerWidth)/2 + 'px' }); } var $navLeave; function addOrRemoveSF(){ if( window.innerWidth < 1000 && $('body').attr('data-responsive') == '1'){ $('body').addClass('mobile'); $('header#top nav').css('display','none'); } else { $('body').removeClass('mobile'); $('header#top nav').css('display',''); $('#mobile-menu').hide(); $('.slide-out-widget-area-toggle #toggle-nav .lines-button').removeClass('close'); //recalc height of dropdown arrow $('.sf-sub-indicator').css('height',$('a.sf-with-ul').height()); } //add specific class if on device for better tablet tracking if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) { $('body').addClass('using-mobile-browser'); } } function showOnLeftSubMenu() { //show on left class for minimal styling $('#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul').each(function(){ $(this).removeClass('on-left-side'); if($(this).offset().left + $(this).outerWidth() > $(window).width()) { $(this).addClass('on-left-side'); $(this).find('ul').addClass('on-left-side'); } else { $(this).removeClass('on-left-side'); $(this).find('ul').removeClass('on-left-side'); } }); } addOrRemoveSF(); initSF(); $(window).resize(addOrRemoveSF); function SFArrows(){ //set height of dropdown arrow $('.sf-sub-indicator').css('height',$('a.sf-with-ul').height()); } SFArrows(); //deactivate hhun on phone if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) $('body').attr('data-hhun','0'); /***************** Caroufredsel ******************/ function standardCarouselInit() { $('ul.carousel:not(".clients")').each(function(){ var $that = $(this); var maxCols = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 'auto' : 3 ; var scrollNum = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 'auto' : '' ; var colWidth = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 500 : 453 ; var scrollSpeed, easing; var $autoplayBool = ($(this).attr('data-autorotate') == 'true') ? true : false; if($('body.ascend').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true' || $('body.material').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true') { if($(this).find('li').length % 3 === 0) { var $themeSkin = true; var $themeSkin2 = true; } else { var $themeSkin = false; var $themeSkin2 = true; } } else { var $themeSkin = true; var $themeSkin2 = true; } (parseInt($(this).attr('data-scroll-speed'))) ? scrollSpeed = parseInt($(this).attr('data-scroll-speed')) : scrollSpeed = 700; ($(this).is('[data-easing]')) ? easing = $(this).attr('data-easing') : easing = 'linear'; var $element = $that; if($that.find('img').length == 0) $element = $('body'); imagesLoaded($element,function(instance){ $that.carouFredSel({ circular: $themeSkin, infinite: $themeSkin2, height : 'auto', responsive: true, items : { width : colWidth, visible : { min : 1, max : maxCols } }, swipe : { onTouch : true, onMouse : true, options : { excludedElements: "button, input, select, textarea, .noSwipe", tap: function(event, target){ if($(target).attr('href') && !$(target).is('[target="_blank"]') && !$(target).is('[rel^="prettyPhoto"]') && !$(target).is('.magnific-popup') && !$(target).is('.magnific')) window.open($(target).attr('href'), '_self'); } }, onBefore : function(){ //hover effect fix $that.find('.work-item').trigger('mouseleave'); $that.find('.work-item .work-info a').trigger('mouseup'); } }, scroll: { items : scrollNum, easing : easing, duration : scrollSpeed, onBefore : function( data ) { if($('body.ascend').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true' || $('body.material').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true') { $that.parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($that.find('> li').length / $that.triggerHandler("currentVisible").length)); } }, onAfter : function( data ) { if($('body.ascend').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true' || $('body.material').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true') { $that.parents('.carousel-wrap').find('.item-count .current').html( $that.triggerHandler('currentPage') +1); $that.parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($that.find('> li').length / $that.triggerHandler("currentVisible").length)); } } }, prev : { button : function() { return $that.parents('.carousel-wrap').find('.carousel-prev'); } }, next : { button : function() { return $that.parents('.carousel-wrap').find('.carousel-next'); } }, auto : { play: $autoplayBool } }, { transition: true }).animate({'opacity': 1},1300); $that.parents('.carousel-wrap').wrap('