!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).parallax=t()}}(function(){return function t(e,i,n){function o(r,a){if(!i[r]){if(!e[r]){var l="function"==typeof require&&require;if(!a&&l)return l(r,!0);if(s)return s(r,!0);var h=new error("cannot find module '"+r+"'");throw h.code="module_not_found",h}var u=i[r]={exports:{}};e[r][0].call(u.exports,function(t){var i=e[r][1][t];return o(i||t)},u,u.exports,t,e,i,n)}return i[r].exports}for(var s="function"==typeof require&&require,r=0;r1)for(var i=1;ii?i:t:te?e:t},data:function(t,e){return a.deserialize(t.getattribute("data-"+e))},deserialize:function(t){return"true"===t||"false"!==t&&("null"===t?null:!isnan(parsefloat(t))&&isfinite(t)?parsefloat(t):t)},camelcase:function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.touppercase():""})},accelerate:function(t){a.css(t,"transform","translate3d(0,0,0) rotate(0.0001deg)"),a.css(t,"transform-style","preserve-3d"),a.css(t,"backface-visibility","hidden")},transformsupport:function(t){for(var e=document.createelement("div"),i=!1,n=null,o=!1,s=null,r=null,l=0,h=a.vendors.length;l0&&"none"!==n,c.style.overflow=d,u.removechild(e),m&&(u.removeattribute("style"),u.parentnode.removechild(u))}}return o},css:function(t,e,i){var n=a.propertycache[e];if(!n)for(var o=0,s=a.vendors.length;othis.calibrationthreshold||math.abs(e)>this.calibrationthreshold)&&this.queuecalibration(0),this.portrait?(this.motionx=this.calibratex?e:this.inputy,this.motiony=this.calibratey?t:this.inputx):(this.motionx=this.calibratex?t:this.inputx,this.motiony=this.calibratey?e:this.inputy),this.motionx*=this.elementwidth*(this.scalarx/100),this.motiony*=this.elementheight*(this.scalary/100),isnan(parsefloat(this.limitx))||(this.motionx=a.clamp(this.motionx,-this.limitx,this.limitx)),isnan(parsefloat(this.limity))||(this.motiony=a.clamp(this.motiony,-this.limity,this.limity)),this.velocityx+=(this.motionx-this.velocityx)*this.frictionx,this.velocityy+=(this.motiony-this.velocityy)*this.frictiony;for(var i=0;ithis.windowwidth;this.portrait!==o&&(this.portrait=o,this.calibrationflag=!0),this.calibrationflag&&(this.calibrationflag=!1,this.calibrationx=i,this.calibrationy=n),this.inputx=i,this.inputy=n}},{key:"ondeviceorientation",value:function(t){var e=t.beta,i=t.gamma;null!==e&&null!==i&&(this.orientationstatus=1,this.rotate(e,i))}},{key:"ondevicemotion",value:function(t){var e=t.rotationrate.beta,i=t.rotationrate.gamma;null!==e&&null!==i&&(this.motionstatus=1,this.rotate(e,i))}},{key:"onmousemove",value:function(t){var e=t.clientx,i=t.clienty;if(this.hoveronly&&(ethis.elementpositionx+this.elementwidth||ithis.elementpositiony+this.elementheight))return this.inputx=0,void(this.inputy=0);this.relativeinput?(this.cliprelativeinput&&(e=math.max(e,this.elementpositionx),e=math.min(e,this.elementpositionx+this.elementwidth),i=math.max(i,this.elementpositiony),i=math.min(i,this.elementpositiony+this.elementheight)),this.elementrangex&&this.elementrangey&&(this.inputx=(e-this.elementpositionx-this.elementcenterx)/this.elementrangex,this.inputy=(i-this.elementpositiony-this.elementcentery)/this.elementrangey)):this.windowradiusx&&this.windowradiusy&&(this.inputx=(e-this.windowcenterx)/this.windowradiusx,this.inputy=(i-this.windowcentery)/this.windowradiusy)}},{key:"destroy",value:function(){this.disable(),cleartimeout(this.calibrationtimer),cleartimeout(this.detectiontimer),this.element.removeattribute("style");for(var t=0;t