forked from dmotz/oriDomi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oridomi.min.js
1 lines (1 loc) · 21.4 KB
/
oridomi.min.js
1
(function(){var t,e,n,i,s,r,o,a,h,l,u,c,p,f,d,_,g,y,m,v,b,T,w,O,E,k,S,x,C,L=function(t,e){return function(){return t.apply(e,arguments)}},A=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},P=[].slice;m="OriDomi",g=!0,k=function(t){return"undefined"!=typeof console&&null!==console&&console.warn(m+": Missing support for `"+t+"`."),g=!1},x=function(t){var e,n,i,s;for(n=0,i=b.length;i>n;n++)if(s=b[n],(e=s+a(t))in S.style)return e;return t in S.style?t:!1},n=function(t,e){var n,i,s;i="."+t+"{";for(n in e)s=e[n],n in u&&(n=u[n],n.match(/^(webkit|moz|ms)/i)&&(n="-"+n)),i+=n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()+":"+s+";";return E+=i+"}"},d=function(t){return u.gradientProp+"("+t+", rgba(0, 0, 0, .5) 0%, rgba(255, 255, 255, .35) 100%)"},a=function(t){return t[0].toUpperCase()+t.slice(1)},l=function(t){var e;return e=document.createElement("div"),e.className=f[t],e},h=function(t,e,n){var i;return i=t.cloneNode(e),i.classList.add(f[n]),i},_=function(t){return t.style[u.transform]="translate3d(-99999px, 0, 0)"},O=function(t){return t.style[u.transform]="translate3d(0, 0, 0)"},T=function(t){return function(){var e,n,i,s,r,o;if(this._touchStarted)return t.apply(this,arguments);switch(e=arguments[0],n=arguments[1],i=arguments[2],o={},r=s=null,t.length){case 1:o.callback=e;break;case 2:"function"==typeof e?o.callback=e:(s=e,o.callback=n);break;case 3:r=e,2===arguments.length?"object"==typeof n?o=n:"function"==typeof n?o.callback=n:s=n:3===arguments.length&&(s=n,"object"==typeof i?o=i:"function"==typeof i&&(o.callback=i))}return null==r&&(r=this._lastOp.angle||0),s||(s=this._lastOp.anchor),this._queue.push([t,this._normalizeAngle(r),this._getLonghandAnchor(s),o]),this._step(),this}},p=function(t){return setTimeout(t,0)},v=function(){},t=("undefined"!=typeof window&&null!==window&&null!=(w=window.$)?w.data:void 0)?window.$:null,i=["left","right","top","bottom"],r=i.slice(0,2),s=i.slice(2),S=document.createElement("div"),E="",b=["Webkit","Moz","ms"],o=m.toLowerCase(),f={active:"active",clone:"clone",holder:"holder",stage:"stage",stageLeft:"stage-left",stageRight:"stage-right",stageTop:"stage-top",stageBottom:"stage-bottom",content:"content",mask:"mask",maskH:"mask-h",maskV:"mask-v",panel:"panel",panelH:"panel-h",panelV:"panel-v",shader:"shader",shaderLeft:"shader-left",shaderRight:"shader-right",shaderTop:"shader-top",shaderBottom:"shader-bottom"};for(y in f)C=f[y],f[y]=o+"-"+C;u=new function(){var t,e,n,i;for(i=["transform","transformOrigin","transformStyle","transitionProperty","transitionDuration","transitionDelay","transitionTimingFunction","perspective","perspectiveOrigin","backfaceVisibility","boxSizing","mask"],t=0,n=i.length;n>t;t++)e=i[t],this[e]=e;return this},function(){var t,e,s,r,o,h;for(t in u)if(h=u[t],u[t]=x(h),!u[t])return k(h);return e="preserve-3d",S.style[u.transformStyle]=e,S.style[u.transformStyle]!==e?k(e):(u.gradientProp=function(){var t,e,n,i;for(e=0,n=b.length;n>e;e++)if(i=b[e],t="-"+i.toLowerCase()+"-linear-gradient",S.style.backgroundImage=t+"(left, #000, #fff)",-1!==S.style.backgroundImage.indexOf("gradient"))return t;return"linear-gradient"}(),r=function(){var t,e,n,i,s;for(e=0,n=b.length;n>e;e++)if(s=b[e],i="grab",S.style.cursor=t="-"+s.toLowerCase()+"-"+i,S.style.cursor===t)return[t,"-"+s.toLowerCase()+"-grabbing"];return S.style.cursor=i,S.style.cursor===i?[i,"grabbing"]:["move","move"]}(),u.grab=r[0],u.grabbing=r[1],u.transformProp=(s=u.transform.match(/(\w+)Transform/i))?"-"+s[1].toLowerCase()+"-transform":"transform",u.transitionEnd=function(){switch(u.transitionProperty.toLowerCase()){case"transitionproperty":return"transitionEnd";case"webkittransitionproperty":return"webkitTransitionEnd";case"moztransitionproperty":return"transitionend";case"mstransitionproperty":return"msTransitionEnd"}}(),function(t){var s,r,o,h;n(f.active,{backgroundColor:t("transparent"),backgroundImage:t("none"),boxSizing:t("border-box"),border:t("none"),outline:t("none"),padding:t("0"),transformStyle:t(e),mask:t("none"),position:"relative"}),n(f.clone,{margin:t("0"),boxSizing:t("border-box"),overflow:t("hidden"),display:t("block")}),n(f.holder,{width:"100%",position:"absolute",top:"0",bottom:"0",transformStyle:e}),n(f.stage,{width:"100%",height:"100%",position:"absolute",transform:"translate3d(-9999px, 0, 0)",margin:"0",padding:"0",transformStyle:e}),h={Left:"0% 50%",Right:"100% 50%",Top:"50% 0%",Bottom:"50% 100%"};for(y in h)C=h[y],n(f["stage"+y],{perspectiveOrigin:C});for(n(f.shader,{width:"100%",height:"100%",position:"absolute",opacity:"0",top:"0",left:"0",pointerEvents:"none",transitionProperty:"opacity"}),r=0,o=i.length;o>r;r++)s=i[r],n(f["shader"+a(s)],{background:d(s)});return n(f.content,{margin:t("0"),position:t("relative"),float:t("none"),boxSizing:t("border-box"),overflow:t("hidden")}),n(f.mask,{width:"100%",height:"100%",position:"absolute",overflow:"hidden",transform:"translate3d(0, 0, 0)",outline:"1px solid transparent"}),n(f.panel,{width:"100%",height:"100%",padding:"0",position:"absolute",transitionProperty:u.transformProp,transformOrigin:"left",transformStyle:e}),n(f.panelH,{transformOrigin:"top"}),n(f.stageRight+" ."+f.panel,{transformOrigin:"right"}),n(f.stageBottom+" ."+f.panel,{transformOrigin:"bottom"})}(function(t){return t+" !important"}),o=document.createElement("style"),o.type="text/css",o.styleSheet?o.styleSheet.cssText=E:o.appendChild(document.createTextNode(E)),document.head.appendChild(o))}(),c={vPanels:3,hPanels:3,perspective:1e3,shading:"hard",speed:700,maxAngle:90,ripple:0,oriDomiClass:m.toLowerCase(),shadingIntensity:1,easingMethod:"",gapNudge:1.5,touchEnabled:!0,touchSensitivity:.25,touchStartCallback:v,touchMoveCallback:v,touchEndCallback:v},e=function(){function e(t,n){var o,p,d,v,b,T,w,E,k,S,x,P,M,z,D,F,H,N,R,U,I,q,V,B,$,X,Y,j,Q,Z,W,G,J,K,tt,et,nt,it,st,rt,ot,at,ht,lt,ut,ct,pt;if(this.el=t,null==n&&(n={}),this._onMouseOut=L(this._onMouseOut,this),this._onTouchLeave=L(this._onTouchLeave,this),this._onTouchEnd=L(this._onTouchEnd,this),this._onTouchMove=L(this._onTouchMove,this),this._onTouchStart=L(this._onTouchStart,this),this._stageReset=L(this._stageReset,this),this._conclude=L(this._conclude,this),this._onTransitionEnd=L(this._onTransitionEnd,this),this._step=L(this._step,this),g){if(!(this instanceof e))return new e(this.el,n);if("string"==typeof this.el&&(this.el=document.querySelector(this.el)),!this.el||1!==this.el.nodeType)return void("undefined"!=typeof console&&null!==console&&console.warn(m+": First argument must be a DOM element"));this._config=new function(){for(y in c)C=c[y],y in n?this[y]=n[y]:this[y]=C;return this},this._config.ripple=Number(this._config.ripple),this._queue=[],this._panels={},this._stages={},this._lastOp={anchor:i[0]},this._shading=this._config.shading,this._shading===!0&&(this._shading="hard"),this._shading&&(this._shaders={},at={},ot=l("shader"),ot.style[u.transitionDuration]=this._config.speed+"ms",ot.style[u.transitionTimingFunction]=this._config.easingMethod),lt=l("stage"),lt.style[u.perspective]=this._config.perspective+"px";for(x=0,M=i.length;M>x;x++)if(p=i[x],this._panels[p]=[],this._stages[p]=h(lt,!1,"stage"+a(p)),this._shading){if(this._shaders[p]={},A.call(r,p)>=0)for(P=0,z=r.length;z>P;P++)ht=r[P],this._shaders[p][ht]=[];else for(I=0,D=s.length;D>I;I++)ht=s[I],this._shaders[p][ht]=[];at[p]=h(ot,!1,"shader"+a(p))}for(w=h(this.el,!0,"content"),V=l("mask"),V.appendChild(w),W=l("panel"),W.style[u.transitionDuration]=this._config.speed+"ms",W.style[u.transitionTimingFunction]=this._config.easingMethod,X={left:[],top:[]},nt=["x","y"],$=0,F=nt.length;F>$;$++){if(v=nt[$],"x"===v?(d=r,B="width",b="V"):(d=s,B="height",b="H"),j=this._config[Q=b.toLowerCase()+"Panels"],"number"==typeof j)E=Math.abs(parseInt(j,10)),G=100/E,j=this._config[Q]=function(){var t,e,n;for(n=[],t=0,e=E;e>=0?e>t:t>e;e>=0?t++:t--)n.push(G);return n}();else if(E=j.length,!(99<=(it=j.reduce(function(t,e){return t+e}))&&100.1>=it))throw new Error(m+": Panel percentages do not sum to 100");if(q=h(V,!0,"mask"+b),this._shading)for(tt=0,H=d.length;H>tt;tt++)p=d[tt],q.appendChild(at[p]);for(K=h(W,!1,"panel"+b),K.appendChild(q),rt=et=0,N=d.length;N>et;rt=++et){for(p=d[rt],Z=ut=0,st=E;st>=0?st>ut:ut>st;Z=st>=0?++ut:--ut){if(Y=K.cloneNode(!0),T=Y.children[0].children[0],T.style.width=T.style.height="100%",rt?(Y.style[u.origin]=p,S=j.length-Z-1,J=S+1):(S=Z,J=S-1,0===Z?X[p].push(0):X[p].push((X[p][J]-100)*(j[J]/j[S]))),0===Z?(Y.style[p]="0",Y.style[B]=j[S]+"%"):(Y.style[p]="100%",Y.style[B]=j[S]/j[J]*100+"%"),this._shading)for(k=ct=0,R=d.length;R>ct;k=++ct)o=d[k],this._shaders[p][o][Z]=Y.children[0].children[k+1];T.style[B]=T.style["max"+a(B)]=E/j[S]*1e4/E+"%",T.style[d[0]]=X[d[0]][S]+"%",this._transformPanel(Y,0,p),this._panels[p][Z]=Y,0!==Z&&this._panels[p][Z-1].appendChild(Y)}this._stages[p].appendChild(this._panels[p][0])}}for(this._stageHolder=l("holder"),this._stageHolder.setAttribute("aria-hidden","true"),pt=0,U=i.length;U>pt;pt++)p=i[pt],this._stageHolder.appendChild(this._stages[p]);"absolute"===window.getComputedStyle(this.el).position&&(this.el.style.position="absolute"),this.el.classList.add(f.active),O(this._stages.left),this._cloneEl=h(this.el,!0,"clone"),this._cloneEl.classList.remove(f.active),_(this._cloneEl),this.el.innerHTML="",this.el.appendChild(this._cloneEl),this.el.appendChild(this._stageHolder),this.el.parentNode.style[u.transformStyle]="preserve-3d",this.accordion(0),this._config.ripple&&this.setRipple(this._config.ripple),this._config.touchEnabled&&this.enableTouch()}}return e.prototype._step=function(){var t,e,n,i,s,r;if(!this._inTrans&&this._queue.length)return this._inTrans=!0,r=this._queue.shift(),n=r[0],e=r[1],t=r[2],s=r[3],this.isFrozen&&this.unfreeze(),i=function(i){return function(){var r;return i._setCallback({angle:e,anchor:t,options:s,fn:n}),r=[e,t,s],n.length<3&&r.shift(),n.apply(i,r)}}(this),this.isFoldedUp?2===n.length?i():this._unfold(i):t!==this._lastOp.anchor?this._stageReset(t,i):i()},e.prototype._isIdenticalOperation=function(t){var e,n,i,s,r;if(!this._lastOp.fn)return!0;if(this._lastOp.reset)return!1;for(s=["angle","anchor","fn"],e=0,i=s.length;i>e;e++)if(n=s[e],this._lastOp[n]!==t[n])return!1;r=t.options;for(y in r)if(C=r[y],C!==this._lastOp.options[y]&&"callback"!==y)return!1;return!0},e.prototype._setCallback=function(t){return!this._config.speed||this._isIdenticalOperation(t)?this._conclude(t.options.callback):this._panels[this._lastOp.anchor][0].addEventListener(u.transitionEnd,this._onTransitionEnd,!1),(this._lastOp=t).reset=!1},e.prototype._onTransitionEnd=function(t){return t.currentTarget.removeEventListener(u.transitionEnd,this._onTransitionEnd,!1),this._conclude(this._lastOp.options.callback,t)},e.prototype._conclude=function(t,e){return p(function(n){return function(){return n._inTrans=!1,n._step(),"function"==typeof t?t(e,n):void 0}}(this))},e.prototype._transformPanel=function(t,e,n,i){var s,r,o,a;switch(r=o=a=0,n){case"left":o=e,s="X(-";break;case"right":o=-e,s="X(";break;case"top":r=-e,s="Y(-";break;case"bottom":r=e,s="Y("}return i&&(r=o=a=e),t.style[u.transform]="rotateX("+r+"deg) rotateY("+o+"deg) rotateZ("+a+"deg) translate"+s+this._config.gapNudge+"px)"},e.prototype._normalizeAngle=function(t){var e;return t=parseFloat(t,10),e=this._config.maxAngle,isNaN(t)?0:t>e?e:-e>t?-e:t},e.prototype._setTrans=function(t,e,n){return null==n&&(n=this._lastOp.anchor),this._iterate(n,function(i){return function(s,r,o){return i._setPanelTrans.apply(i,[n].concat(P.call(arguments),[t],[e]))}}(this))},e.prototype._setPanelTrans=function(t,e,n,i,o,a){var h,l,c,p,f,d;if(h=function(){switch(a){case 0:return 0;case 1:return this._config.speed/i*n;case 2:return this._config.speed/i*(i-n-1)}}.call(this),e.style[u.transitionDuration]=o+"ms",e.style[u.transitionDelay]=h+"ms",this._shading)for(p=A.call(r,t)>=0?r:s,l=0,c=p.length;c>l;l++)d=p[l],f=this._shaders[t][d][n],f.style[u.transitionDuration]=o+"ms",f.style[u.transitionDelay]=h+"ms";return h},e.prototype._setShader=function(t,e,n){var i,s,o,a;return s=Math.abs(n),a=s/90*this._config.shadingIntensity,"hard"===this._shading?(a*=.15,n=this._lastOp.angle<0?s:-s):a*=.4,A.call(r,e)>=0?(0>n?(i=a,o=0):(i=0,o=a),this._shaders[e].left[t].style.opacity=i,this._shaders[e].right[t].style.opacity=o):(0>n?(i=0,o=a):(i=a,o=0),this._shaders[e].top[t].style.opacity=i,this._shaders[e].bottom[t].style.opacity=o)},e.prototype._showStage=function(t){return t!==this._lastOp.anchor?(_(this._stages[this._lastOp.anchor]),this._lastOp.anchor=t,this._lastOp.reset=!0,this._stages[t].style[u.transform]="translate3d("+function(){switch(t){case"left":return"0, 0, 0)";case"right":return"-"+this._config.vPanels.length+"px, 0, 0)";case"top":return"0, 0, 0)";case"bottom":return"0, -"+this._config.hPanels.length+"px, 0)"}}.call(this)):void 0},e.prototype._stageReset=function(t,e){var n;return n=function(i){return function(s){return s&&s.currentTarget.removeEventListener(u.transitionEnd,n,!1),i._showStage(t),p(e)}}(this),0===this._lastOp.angle?n():(this._panels[this._lastOp.anchor][0].addEventListener(u.transitionEnd,n,!1),this._iterate(this._lastOp.anchor,function(t){return function(e,n){return t._transformPanel(e,0,t._lastOp.anchor),t._shading?t._setShader(n,t._lastOp.anchor,0):void 0}}(this)))},e.prototype._getLonghandAnchor=function(t){switch(t.toString()){case"left":case"l":case"4":return"left";case"right":case"r":case"2":return"right";case"top":case"t":case"1":return"top";case"bottom":case"b":case"3":return"bottom";default:return"left"}},e.prototype._setCursor=function(t){return null==t&&(t=this._touchEnabled),t?this.el.style.cursor=u.grab:this.el.style.cursor="default"},e.prototype._setTouch=function(t){var e,n,i,s,r,o,a,h,l;if(t){if(this._touchEnabled)return this;h="addEventListener"}else{if(!this._touchEnabled)return this;h="removeEventListener"}this._touchEnabled=t,this._setCursor(),i=[["TouchStart","MouseDown"],["TouchEnd","MouseUp"],["TouchMove","MouseMove"],["TouchLeave","MouseLeave"]],l="onmouseleave"in window;for(s=0,o=i.length;o>s;s++)for(n=i[s],r=0,a=n.length;a>r;r++){if(e=n[r],"TouchLeave"===e&&!l){this.el[h]("mouseout",this._onMouseOut,!1);break}this.el[h](e.toLowerCase(),this["_on"+n[0]],!1)}return this},e.prototype._onTouchStart=function(t){var e,n;if(this._touchEnabled&&!this.isFoldedUp)return t.preventDefault(),this.emptyQueue(),this._touchStarted=!0,this.el.style.cursor=u.grabbing,this._setTrans(0,0),this._touchAxis=(n=this._lastOp.anchor,A.call(r,n)>=0?"x":"y"),this["_"+this._touchAxis+"Last"]=this._lastOp.angle,e="_"+this._touchAxis+"1","mousedown"===t.type?this[e]=t["page"+this._touchAxis.toUpperCase()]:this[e]=t.targetTouches[0]["page"+this._touchAxis.toUpperCase()],this._config.touchStartCallback(this[e],t)},e.prototype._onTouchMove=function(t){var e,n,i;if(this._touchEnabled&&this._touchStarted)return t.preventDefault(),e="mousemove"===t.type?t["page"+this._touchAxis.toUpperCase()]:t.targetTouches[0]["page"+this._touchAxis.toUpperCase()],i=(e-this["_"+this._touchAxis+"1"])*this._config.touchSensitivity,this._lastOp.angle<0?(n="right"===this._lastOp.anchor||"bottom"===this._lastOp.anchor?this["_"+this._touchAxis+"Last"]-i:this["_"+this._touchAxis+"Last"]+i,n>0&&(n=0)):(n="right"===this._lastOp.anchor||"bottom"===this._lastOp.anchor?this["_"+this._touchAxis+"Last"]+i:this["_"+this._touchAxis+"Last"]-i,0>n&&(n=0)),this._lastOp.angle=n=this._normalizeAngle(n),this._lastOp.fn.call(this,n,this._lastOp.anchor,this._lastOp.options),this._config.touchMoveCallback(n,t)},e.prototype._onTouchEnd=function(t){return this._touchEnabled?(this._touchStarted=this._inTrans=!1,this.el.style.cursor=u.grab,this._setTrans(this._config.speed,this._config.ripple),this._config.touchEndCallback(this["_"+this._touchAxis+"Last"],t)):void 0},e.prototype._onTouchLeave=function(t){return this._touchEnabled&&this._touchStarted?this._onTouchEnd(t):void 0},e.prototype._onMouseOut=function(t){return this._touchEnabled&&this._touchStarted&&t.toElement&&!this.el.contains(t.toElement)?this._onTouchEnd(t):void 0},e.prototype._unfold=function(t){var e;return this._inTrans=!0,e=this._lastOp.anchor,this._iterate(e,function(n){return function(i,s,r){var o;return o=n._setPanelTrans.apply(n,[e].concat(P.call(arguments),[n._config.speed],[1])),function(i,s,o){return p(function(){return n._transformPanel(i,0,e),n._shading&&n._setShader(s,e,0),setTimeout(function(){return O(i.children[0]),s===r-1&&(n._inTrans=n.isFoldedUp=!1,"function"==typeof t&&t(),n._lastOp.fn=n.accordion,n._lastOp.angle=0),p(function(){return i.style[u.transitionDuration]=n._config.speed})},o+.25*n._config.speed)})}(i,s,o)}}(this))},e.prototype._iterate=function(t,e){var n,i,s,r,o,a,h;for(a=o=this._panels[t],h=[],n=i=0,s=a.length;s>i;n=++i)r=a[n],h.push(e.call(this,r,n,o.length));return h},e.prototype.enableTouch=function(){return this._setTouch(!0)},e.prototype.disableTouch=function(){return this._setTouch(!1)},e.prototype.setSpeed=function(t){var e,n,s;for(n=0,s=i.length;s>n;n++)e=i[n],this._setTrans(this._config.speed=t,this._config.ripple,e);return this},e.prototype.freeze=function(t){return this.isFrozen?"function"==typeof t&&t():this._stageReset(this._lastOp.anchor,function(e){return function(){return e.isFrozen=!0,_(e._stageHolder),O(e._cloneEl),e._setCursor(!1),"function"==typeof t?t():void 0}}(this)),this},e.prototype.unfreeze=function(){return this.isFrozen&&(this.isFrozen=!1,_(this._cloneEl),O(this._stageHolder),this._setCursor(),this._lastOp.angle=0),this},e.prototype.destroy=function(e){return this.freeze(function(n){return function(){return n._setTouch(!1),t&&t.data(n.el,o,null),n.el.innerHTML=n._cloneEl.innerHTML,n.el.classList.remove(f.active),"function"==typeof e?e():void 0}}(this)),null},e.prototype.emptyQueue=function(){return this._queue=[],p(function(t){return function(){return t._inTrans=!1}}(this)),this},e.prototype.setRipple=function(t){return null==t&&(t=1),this._config.ripple=Number(t),this.setSpeed(this._config.speed),this},e.prototype.constrainAngle=function(t){return this._config.maxAngle=parseFloat(t,10)||c.maxAngle,this},e.prototype.wait=function(t){var e;return e=function(e){return function(){return setTimeout(e._conclude,t)}}(this),this._inTrans?this._queue.push([e,this._lastOp.angle,this._lastOp.anchor,this._lastOp.options]):e(),this},e.prototype.modifyContent=function(t){var e,n,s,r,o,a,h,l,u,c;for("function"!=typeof t&&(u=t,c=function(t,e,n){var i,s;if(e&&(t.innerHTML=e),n){for(i in n)s=n[i],t.style[i]=s;return null}},t=function(t){var e,n,i,s,r,o,a,h;for(o in u)if(h=u[o],e=a=null,"string"==typeof h?e=h:(e=h.content,a=h.style),""!==o)for(r=t.querySelectorAll(o),n=0,i=r.length;i>n;n++)s=r[n],c(s,e,a);else c(t,e,a);return null}),s=0,o=i.length;o>s;s++)for(e=i[s],l=this._panels[e],n=r=0,a=l.length;a>r;n=++r)h=l[n],t(h.children[0].children[0],n,e);return this},e.prototype.accordion=T(function(t,e,n){return this._iterate(e,function(i){return function(s,r){var o;if(o=r%2===0||n.twist?t:-t,n.sticky?0===r?o=0:(r>1||n.stairs)&&(o*=2):0!==r&&(o*=2),n.stairs&&(o*=-1),i._transformPanel(s,o,e,n.fracture),i._shading){if(n.twist||n.fracture||0===r&&n.sticky)return i._setShader(r,e,0);if(180!==Math.abs(o))return i._setShader(r,e,o)}}}(this))}),e.prototype.curl=T(function(t,e,n){return t/=A.call(r,e)>=0?this._config.vPanels.length:this._config.hPanels.length,this._iterate(e,function(n){return function(i,s){return n._transformPanel(i,t,e),n._shading?n._setShader(s,e,0):void 0}}(this))}),e.prototype.ramp=T(function(t,e,n){return this._transformPanel(this._panels[e][1],t,e),this._iterate(e,function(t){return function(n,i){return 1!==i&&t._transformPanel(n,0,e),t._shading?t._setShader(i,e,0):void 0}}(this))}),e.prototype.foldUp=T(function(t,e){return this.isFoldedUp?"function"==typeof e?e():void 0:this._stageReset(t,function(n){return function(){return n._inTrans=n.isFoldedUp=!0,n._iterate(t,function(i,s,r){var o,a;return a=n._config.speed,0===s&&(a/=2),o=n._setPanelTrans.apply(n,[t].concat(P.call(arguments),[a],[2])),function(i,s,r){return p(function(){return n._transformPanel(i,0===s?90:170,t),setTimeout(function(){return 0===s?(n._inTrans=!1,"function"==typeof e?e():void 0):_(i.children[0])},r+.25*n._config.speed)})}(i,s,o)})}}(this))}),e.prototype.unfold=T(e.prototype._unfold),e.prototype.map=function(t){return T(function(e){return function(n,i,s){return e._iterate(i,function(r,o,a){return e._transformPanel(r,t(n,o,a),i,s.fracture)})}}(this)).bind(this)},e.prototype.reset=function(t){return this.accordion(0,{callback:t})},e.prototype.reveal=function(t,e,n){return null==n&&(n={}),n.sticky=!0,this.accordion(t,e,n)},e.prototype.stairs=function(t,e,n){return null==n&&(n={}),n.stairs=n.sticky=!0,this.accordion(t,e,n)},e.prototype.fracture=function(t,e,n){return null==n&&(n={}),n.fracture=!0,this.accordion(t,e,n)},e.prototype.twist=function(t,e,n){return null==n&&(n={}),n.fracture=n.twist=!0,this.accordion(t/10,e,n)},e.prototype.collapse=function(t,e){return null==e&&(e={}),e.sticky=!1,this.accordion(-this._config.maxAngle,t,e)},e.prototype.collapseAlt=function(t,e){return null==e&&(e={}),e.sticky=!1,this.accordion(this._config.maxAngle,t,e)},e.VERSION="1.1.5",e.isSupported=g,e}(),("undefined"!=typeof module&&null!==module?module.exports:void 0)?module.exports=e:("undefined"!=typeof define&&null!==define?define.amd:void 0)?define(function(){return e}):window.OriDomi=e,t&&(t.prototype.oriDomi=function(n){var i,s,r,a,h,l,u,c;if(!g)return this;if(n===!0)return t.data(this[0],o);if("string"==typeof n){if(c=n,"function"!=typeof(u=e.prototype[c]))return"undefined"!=typeof console&&null!==console&&console.warn(m+": No such method `"+c+"`"),this;for(r=0,h=this.length;h>r;r++)i=this[r],(s=t.data(i,o))||(s=t.data(i,o,new e(i,n))),u.apply(s,Array.prototype.slice.call(arguments).slice(1))}else for(a=0,l=this.length;l>a;a++)i=this[a],(s=t.data(i,o))||t.data(i,o,new e(i,n));return this})}).call(this);