File Manager

Current Directory: /home/astoriaah/www/templates/yootheme/vendor/assets/uikit/dist/js/components
Viewing File: /home/astoriaah/www/templates/yootheme/vendor/assets/uikit/dist/js/components/parallax.min.js
/*! UIkit 3.0.0-rc.8 | http://www.getuikit.com | (c) 2014 - 2017 YOOtheme | MIT License */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("uikit-util")):"function"==typeof define&&define.amd?define("uikitparallax",["uikit-util"],t):e.UIkitParallax=t(e.UIkit.util)}(this,function(b){"use strict";var e=["x","y","bgx","bgy","rotate","scale","color","backgroundColor","borderColor","opacity","blur","hue","grayscale","invert","saturate","sepia","fopacity"];function v(e,t){var r=e.length-1,i=Math.min(Math.floor(r*t),r-1),a=e.slice(i,i+2);return a.push(1===t?1:t%(1/r)*r),a}function k(e,t){var r=v(e,t),i=r[0],a=r[1],s=r[2];return(b.isNumber(i)?i+Math.abs(i-a)*s*(i<a?1:-1):+a).toFixed(2)}var t={mixins:[{props:e.reduce(function(e,t){return e[t]="list",e},{media:"media"}),data:e.reduce(function(e,t){return e[t]=void 0,e},{media:!1}),computed:{props:function(d,h){var g=this;return e.reduce(function(e,t){if(b.isUndefined(d[t]))return e;var r,i,a,s=t.match(/color/i),n=s||"opacity"===t,o=d[t].slice(0);n&&b.css(h,t,""),o.length<2&&o.unshift(("scale"===t?1:n?b.css(h,t):0)||0);var c=b.includes(o.join(""),"%")?"%":"px";if(s){var u=h.style.color;o=o.map(function(e){return t=h,r=e,b.css(b.css(t,"color",r),"color").split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(function(e){return b.toFloat(e)});var t,r}),h.style.color=u}else o=o.map(b.toFloat);if(t.match(/^bg/))if(b.css(h,"background-position-"+t[2],""),i=b.css(h,"backgroundPosition").split(" ")["x"===t[2]?0:1],g.covers){var l=Math.min.apply(Math,o),p=Math.max.apply(Math,o),f=o.indexOf(l)<o.indexOf(p);a=p-l,o=o.map(function(e){return e-(f?l:p)}),r=(f?-a:0)+"px"}else r=i;return e[t]={steps:o,unit:c,pos:r,bgPos:i,diff:a},e},{})},bgProps:function(){var t=this;return["bgx","bgy"].filter(function(e){return e in t.props})},covers:function(e,t){return i=(r=t).style.backgroundSize,a="cover"===b.css(b.css(r,"backgroundSize",""),"backgroundSize"),r.style.backgroundSize=i,a;var r,i,a}},disconnected:function(){delete this._image},update:[{read:function(t){var r=this;if(t.active=!this.media||window.matchMedia(this.media).matches,t.image&&(t.image.dimEl={width:this.$el.offsetWidth,height:this.$el.offsetHeight}),!("image"in t)&&this.covers&&this.bgProps.length){var e=b.css(this.$el,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");e&&(t.image=!1,b.getImage(e).then(function(e){t.image={width:e.naturalWidth,height:e.naturalHeight},r.$emit()}))}},write:function(e){var c=this,u=e.image,t=e.active;if(u)if(t){var l=u.dimEl,p=b.Dimensions.cover(u,l);this.bgProps.forEach(function(e){var t=c.props[e],r=t.diff,i=t.bgPos,a=t.steps,s="bgy"===e?"height":"width",n=p[s]-l[s];if(i.match(/%$|0px/)){if(n<r)l[s]=p[s]+r-n;else if(r<n){var o=parseFloat(i);o&&(c.props[e].steps=a.map(function(e){return e-(n-r)/(100/o)}))}p=b.Dimensions.cover(u,l)}}),b.css(this.$el,{backgroundSize:p.width+"px "+p.height+"px",backgroundRepeat:"no-repeat"})}else b.css(this.$el,{backgroundSize:"",backgroundRepeat:""})},events:["load","resize"]}],methods:{reset:function(){var r=this;b.each(this.getCss(0),function(e,t){return b.css(r.$el,t,"")})},getCss:function(h){var g=this.props,m=!1;return Object.keys(g).reduce(function(e,t){var r=g[t],i=r.steps,a=r.unit,s=r.pos,n=k(i,h);switch(t){case"x":case"y":if(m)break;var o=["x","y"].map(function(e){return t===e?n+a:g[e]?k(g[e].steps,h)+g[e].unit:0}),c=o[0],u=o[1];m=e.transform+=" translate3d("+c+", "+u+", 0)";break;case"rotate":e.transform+=" rotate("+n+"deg)";break;case"scale":e.transform+=" scale("+n+")";break;case"bgy":case"bgx":e["background-position-"+t[2]]="calc("+s+" + "+(n+a)+")";break;case"color":case"backgroundColor":case"borderColor":var l=v(i,h),p=l[0],f=l[1],d=l[2];e[t]="rgba("+p.map(function(e,t){return e+=d*(f[t]-e),3===t?b.toFloat(e):parseInt(e,10)}).join(",")+")";break;case"blur":e.filter+=" blur("+n+"px)";break;case"hue":e.filter+=" hue-rotate("+n+"deg)";break;case"fopacity":e.filter+=" opacity("+n+"%)";break;case"grayscale":case"invert":case"saturate":case"sepia":e.filter+=" "+t+"("+n+"%)";break;default:e[t]=n}return e},{transform:"",filter:""})}}}],props:{target:String,viewport:Number,easing:Number},data:{target:!1,viewport:1,easing:1},computed:{target:function(e,t){var r=e.target;return r&&b.query(r,t)||t}},update:[{read:function(e){var t,r;return{prev:e.percent,percent:(t=b.scrolledOver(this.target)/(this.viewport||1),r=this.easing,b.clamp(t*(1-(r-r*t))))}},write:function(e,t){var r=e.prev,i=e.percent,a=e.active;"scroll"!==t.type&&(r=!1),a?r!==i&&b.css(this.$el,this.getCss(i)):this.reset()},events:["scroll","load","resize"]}]};return"undefined"!=typeof window&&window.UIkit&&window.UIkit.component("parallax",t),t});