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,E=function(t){return"undefined"!=typeof console&&null!==console&&console.warn(""+m+": Missing support for `"+t+"`."),g=!1},S=function(t){var e,n,i,s;for(i=0,s=b.length;s>i;i++)if(n=b[i],(e=n+a(t))in k.style)return e;return t in k.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 O+=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)"},w=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!=(C=window.$)?C.data:void 0)?window.$:null,i=["left","right","top","bottom"],r=i.slice(0,2),s=i.slice(2),k=document.createElement("div"),O="",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)x=f[y],f[y]=""+o+"-"+x;u=new function(){var t,e,n,i;for(i=["transform","transformOrigin","transformStyle","transitionProperty","transitionDuration","transitionDelay","transitionTimingFunction","perspective","perspectiveOrigin","backfaceVisibility","boxSizing","mask"],e=0,n=i.length;n>e;e++)t=i[e],this[t]=t;return this},function(){var t,e,s,r,o,h;for(t in u)if(o=u[t],u[t]=S(o),!u[t])return E(o);return e="preserve-3d",k.style[u.transformStyle]=e,k.style[u.transformStyle]!==e?E(e):(u.gradientProp=function(){var t,e,n,i;for(n=0,i=b.length;i>n;n++)if(e=b[n],t="-"+e.toLowerCase()+"-linear-gradient",k.style.backgroundImage=""+t+"(left, #000, #fff)",-1!==k.style.backgroundImage.indexOf("gradient"))return t;return"linear-gradient"}(),h=function(){var t,e,n,i,s;for(i=0,s=b.length;s>i;i++)if(n=b[i],e="grab",k.style.cursor=t="-"+n.toLowerCase()+"-"+e,k.style.cursor===t)return[t,"-"+n.toLowerCase()+"-grabbing"];return k.style.cursor=e,k.style.cursor===e?[e,"grabbing"]:["move","move"]}(),u.grab=h[0],u.grabbing=h[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)x=h[y],n(f["stage"+y],{perspectiveOrigin:x});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"}),r=document.createElement("style"),r.type="text/css",r.styleSheet?r.styleSheet.cssText=O:r.appendChild(document.createTextNode(O)),document.head.appendChild(r))}(),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,O,E,k,S,C,P,M,z,D,F,H,N,R,U,I,q,V,B,$,X,Y,j,Q,Z,W,G,J,K,te,ee,ne,ie,se,re,oe,ae,he,le,ue,ce;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)x=c[y],this[y]=y in n?n[y]:x;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={},$={},B=l("shader"),B.style[u.transitionDuration]=this._config.speed+"ms",B.style[u.transitionTimingFunction]=this._config.easingMethod),Y=l("stage"),Y.style[u.perspective]=this._config.perspective+"px";for(j=0,G=i.length;G>j;j++)if(p=i[j],this._panels[p]=[],this._stages[p]=h(Y,!1,"stage"+a(p)),this._shading){if(this._shaders[p]={},A.call(r,p)>=0)for(Q=0,J=r.length;J>Q;Q++)X=r[Q],this._shaders[p][X]=[];else for(Z=0,K=s.length;K>Z;Z++)X=s[Z],this._shaders[p][X]=[];$[p]=h(B,!1,"shader"+a(p))}for(O=h(this.el,!0,"content"),P=l("mask"),P.appendChild(O),R=l("panel"),R.style[u.transitionDuration]=this._config.speed+"ms",R.style[u.transitionTimingFunction]=this._config.easingMethod,z={left:[],top:[]},ue=["x","y"],W=0,te=ue.length;te>W;W++){if(v=ue[W],"x"===v?(d=r,M="width",b="V"):(d=s,M="height",b="H"),F=this._config[H=b.toLowerCase()+"Panels"],"number"==typeof F)E=Math.abs(parseInt(F,10)),U=100/E,F=this._config[H]=function(){var t,e;for(e=[],t=0;E>=0?E>t:t>E;E>=0?t++:t--)e.push(U);return e}();else if(E=F.length,!(99<=(ce=F.reduce(function(t,e){return t+e}))&&100.1>=ce))throw new Error(""+m+": Panel percentages do not sum to 100");if(C=h(P,!0,"mask"+b),this._shading)for(re=0,ee=d.length;ee>re;re++)p=d[re],C.appendChild($[p]);for(q=h(R,!1,"panel"+b),q.appendChild(C),V=oe=0,ne=d.length;ne>oe;V=++oe){for(p=d[V],N=ae=0;E>=0?E>ae:ae>E;N=E>=0?++ae:--ae){if(D=q.cloneNode(!0),T=D.children[0].children[0],T.style.width=T.style.height="100%",V?(D.style[u.origin]=p,S=F.length-N-1,I=S+1):(S=N,I=S-1,z[p].push(0===N?0:(z[p][I]-100)*(F[I]/F[S]))),0===N?(D.style[p]="0",D.style[M]=F[S]+"%"):(D.style[p]="100%",D.style[M]=F[S]/F[I]*100+"%"),this._shading)for(k=he=0,ie=d.length;ie>he;k=++he)o=d[k],this._shaders[p][o][N]=D.children[0].children[k+1];T.style[M]=T.style["max"+a(M)]=E/F[S]*1e4/E+"%",T.style[d[0]]=z[d[0]][S]+"%",this._transformPanel(D,0,p),this._panels[p][N]=D,0!==N&&this._panels[p][N-1].appendChild(D)}this._stages[p].appendChild(this._panels[p][0])}}for(this._stageHolder=l("holder"),this._stageHolder.setAttribute("aria-hidden","true"),le=0,se=i.length;se>le;le++)p=i[le],this._stageHolder.appendChild(this._stages[p]);"absolute"===window.getComputedStyle(this.el).position&&(this.el.style.position="absolute"),this.el.classList.add(f.active),w(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"],n=0,i=s.length;i>n;n++)if(e=s[n],this._lastOp[e]!==t[e])return!1;r=t.options;for(y in r)if(x=r[y],x!==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(d=A.call(r,t)>=0?r:s,p=0,f=d.length;f>p;p++)c=d[p],l=this._shaders[t][c][n],l.style[u.transitionDuration]=o+"ms",l.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),this.el.style.cursor=t?u.grab:"default"},e.prototype._setTouch=function(t){var e,n,i,s,r,o,a,h,l;if(t){if(this._touchEnabled)return this;s="addEventListener"}else{if(!this._touchEnabled)return this;s="removeEventListener"}this._touchEnabled=t,this._setCursor(),i=[["TouchStart","MouseDown"],["TouchEnd","MouseUp"],["TouchMove","MouseMove"],["TouchLeave","MouseLeave"]],r="onmouseleave"in window;for(o=0,h=i.length;h>o;o++)for(n=i[o],a=0,l=n.length;l>a;a++){if(e=n[a],"TouchLeave"===e&&!r){this.el[s]("mouseout",this._onMouseOut,!1);break}this.el[s](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",this[e]="mousedown"===t.type?t["page"+this._touchAxis.toUpperCase()]: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 w(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=s=this._panels[t],h=[],n=r=0,o=a.length;o>r;n=++r)i=a[n],h.push(e.call(this,i,n,s.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),w(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),w(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&&(r=t,o=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,a,h,l,u;for(i in r)if(a=r[i],e=s=null,"string"==typeof a?e=a:(e=a.content,s=a.style),""!==i)for(u=t.querySelectorAll(i),h=0,l=u.length;l>h;h++)n=u[h],o(n,e,s);else o(t,e,s);return null}),a=0,l=i.length;l>a;a++)for(e=i[a],c=this._panels[e],n=h=0,u=c.length;u>h;n=++h)s=c[n],t(s.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(a=n,"function"!=typeof(r=e.prototype[a]))return"undefined"!=typeof console&&null!==console&&console.warn(""+m+": No such method `"+a+"`"),this;for(h=0,u=this.length;u>h;h++)i=this[h],(s=t.data(i,o))||(s=t.data(i,o,new e(i,n))),r.apply(s,Array.prototype.slice.call(arguments).slice(1))}else for(l=0,c=this.length;c>l;l++)i=this[l],(s=t.data(i,o))||t.data(i,o,new e(i,n));return this})}).call(this);