Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minified changes

commit 2163ac8990012cccf083833ecdd9e5014d3ae9f4 1 parent 2248f63
Justin Windle authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  js/makisu.min.js
View
3  js/makisu.min.js
@@ -18,4 +18,5 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
- */(function(e){var t=!1,n=document.createElement("div"),r=/^(Moz|(w|W)ebkit|O|ms)(?=[A-Z])/,i=function(){for(var e in n.style)if(r.test(e))return e.match(r)[0]}()||"",s=i+"Perspective"in n.style,o="-"+i.toLowerCase()+"-",u,a,f,l,c,h,p,d,v,m,g,y={toggle:function(){u=e(this),u.makisu(u.hasClass("open")?"close":"open")},open:function(t,n,r){u=e(this),a=u.find(".root"),l=u.find(".node").not(a),t=b.resolve(u,"speed",t),r=b.resolve(u,"easing",r),n=b.resolve(u,"overlap",n),l.each(function(i,s){m="unfold"+(i?"":"-first"),g=i===l.length-1,time=t*(1-n),v=i*time,h=e(s),p=h.find(".over"),h.css(b.prefix({transform:"rotateX(180deg)",animation:m+" "+t+"s "+r+" "+v+"s 1 normal forwards"})),g||(v=(i+1)*time),p.css(b.prefix({animation:"unfold-over "+t*.45+"s "+r+" "+v+"s 1 normal forwards"}))}),a.css(b.prefix({animation:"swing-out "+l.length*time*1.4+"s ease-in-out 0s 1 normal forwards"})),u.addClass("open")},close:function(t,n,r){u=e(this),a=u.find(".root"),l=u.find(".node").not(a),t=b.resolve(u,"speed",t)*.66,r=b.resolve(u,"easing",r),n=b.resolve(u,"overlap",n),l.each(function(i,s){m="fold"+(i?"":"-first"),g=i===0,time=t*(1-n),v=(l.length-i-1)*time,h=e(s),p=h.find(".over"),h.css(b.prefix({transform:"rotateX(0deg)",animation:m+" "+t+"s "+r+" "+v+"s 1 normal forwards"})),g||(v=(l.length-i-2)*time+t*.35),p.css(b.prefix({animation:"fold-over "+t*.45+"s "+r+" "+v+"s 1 normal forwards"}))}),a.css(b.prefix({animation:"swing-in "+l.length*time*1+"s ease-in-out 0s 1 normal forwards"})),u.removeClass("open")}},b={resolve:function(e,t,n){return typeof n=="undefined"?e.data(t):n},prefix:function(e){for(var t in e)e[o+t]=e[t];return e},inject:function(e){try{var t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}catch(n){}}},w={node:'<span class="node"/>',back:'<span class="face back"/>',over:'<span class="face over"/>'};e.fn.makisu=function(n){if(!s){var r="Failed to detect CSS 3D support";console&&console.warn&&(console.warn(r),this.each(function(){e(this).trigger("error",r)}));return}t||(t=!0,b.inject("@"+o+"keyframes unfold {"+"0% {"+o+"transform: rotateX(180deg); }"+"50% {"+o+"transform: rotateX(-30deg); }"+"100% {"+o+"transform: rotateX(0deg); }"+"}"),b.inject("@"+o+"keyframes unfold-first {"+"0% {"+o+"transform: rotateX(-90deg); }"+"50% {"+o+"transform: rotateX(60deg); }"+"100% {"+o+"transform: rotateX(0deg); }"+"}"),b.inject("@"+o+"keyframes fold {"+"0% {"+o+"transform: rotateX(0deg); }"+"100% {"+o+"transform: rotateX(180deg); }"+"}"),b.inject("@"+o+"keyframes fold-first {"+"0% {"+o+"transform: rotateX(0deg); }"+"100% {"+o+"transform: rotateX(-180deg); }"+"}"),b.inject("@"+o+"keyframes swing-out {"+"0% {"+o+"transform: rotateX(0deg); }"+"30% {"+o+"transform: rotateX(-30deg); }"+"60% {"+o+"transform: rotateX(15deg); }"+"100% {"+o+"transform: rotateX(0deg); }"+"}"),b.inject("@"+o+"keyframes swing-in {"+"0% {"+o+"transform: rotateX(0deg); }"+"50% {"+o+"transform: rotateX(-10deg); }"+"90% {"+o+"transform: rotateX(15deg); }"+"100% {"+o+"transform: rotateX(0deg); }"+"}"),b.inject("@"+o+"keyframes unfold-over {"+"0% { opacity: 1.0; }"+"100% { opacity: 0.0; }"+"}"),b.inject("@"+o+"keyframes fold-over {"+"0% { opacity: 0.0; }"+"100% { opacity: 1.0; }"+"}"),b.inject(".node {position: relative;display: block;}"),b.inject(".face {pointer-events: none;position: absolute;display: block;height: 100%;width: 100%;left: 0;top: 0;}"));var i=e.extend({},e.fn.makisu.defaults,n),v=Array.prototype.slice.call(arguments,1);return this.each(function(){if(y[n])return y[n].apply(this,v);u=e(this).data(i),u.data("initialized")||(u.data("initialized",!0),l=u.children(i.selector),a=e(w.node).addClass("root"),f=a,l.each(function(t,n){h=e(n),m="fold"+(t?"":"-first"),h.css("position","relative"),h.css(b.prefix({"transform-style":"preserve-3d",transform:"translateZ(-0.1px)"})),d=e(w.back),d.css("background",h.css("background")),d.css(b.prefix({transform:"translateZ(-0.1px)"})),p=e(w.over),p.css(b.prefix({transform:"translateZ(0.1px)"})),p.css({background:i.shading,opacity:0}),c=e(w.node).append(h),c.css(b.prefix({"transform-origin":"50% 0%","transform-style":"preserve-3d",animation:m+" 1ms linear 0s 1 normal forwards"})),h.append(p),h.append(d),f.append(c),f=c}),a.css(b.prefix({"transform-origin":"50% 0%","transform-style":"preserve-3d"})),u.css(b.prefix({transform:"perspective("+i.perspective+"px)"})),u.append(a))})},e.fn.makisu.defaults={perspective:1200,shading:"rgba(0,0,0,0.12)",selector:null,overlap:.6,speed:.8,easing:"ease-in-out"},e.fn.makisu.enabled=s})(jQuery);
+ */
+ !function(e){for(var r,t,o=!1,a=document.createElement("div"),n="moz ms o webkit".split(" "),s=function(e){return e.toUpperCase()},i=0;i<n.length&&(t=(r=n[i])+"Perspective",!(t in a.style||t.replace(/^(\w)/,s)in a.style));i++);var f,d,l,c,m,p,u,g,v,y,h,k=!!r,X="-"+r+"-",x={toggle:function(){f=e(this),f.makisu(f.hasClass("open")?"close":"open")},open:function(r,t,o){f=e(this),d=f.find(".root"),c=f.find(".node").not(d),r=w.resolve(f,"speed",r),o=w.resolve(f,"easing",o),t=w.resolve(f,"overlap",t),c.each(function(a,n){y="unfold"+(a?"":"-first"),h=a===c.length-1,time=r*(1-t),v=a*time,p=e(n),u=p.find(".over"),p.css(w.prefix({transform:"rotateX(180deg)",animation:y+" "+r+"s "+o+" "+v+"s 1 normal forwards"})),h||(v=(a+1)*time),u.css(w.prefix({animation:"unfold-over "+.45*r+"s "+o+" "+v+"s 1 normal forwards"}))}),d.css(w.prefix({animation:"swing-out "+1.4*c.length*time+"s ease-in-out 0s 1 normal forwards"})),f.addClass("open")},close:function(r,t,o){f=e(this),d=f.find(".root"),c=f.find(".node").not(d),r=.66*w.resolve(f,"speed",r),o=w.resolve(f,"easing",o),t=w.resolve(f,"overlap",t),c.each(function(a,n){y="fold"+(a?"":"-first"),h=0===a,time=r*(1-t),v=(c.length-a-1)*time,p=e(n),u=p.find(".over"),p.css(w.prefix({transform:"rotateX(0deg)",animation:y+" "+r+"s "+o+" "+v+"s 1 normal forwards"})),h||(v=(c.length-a-2)*time+.35*r),u.css(w.prefix({animation:"fold-over "+.45*r+"s "+o+" "+v+"s 1 normal forwards"}))}),d.css(w.prefix({animation:"swing-in "+1*c.length*time+"s ease-in-out 0s 1 normal forwards"})),f.removeClass("open")}},w={resolve:function(e,r,t){return"undefined"==typeof t?e.data(r):t},prefix:function(e){for(var r in e)e[X+r]=e[r];return e},inject:function(e){try{var r=document.createElement("style");r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r)}catch(t){}},keyframes:function(e,r){var t="@"+X+"keyframes "+e+"{";for(var o in r)t+=o+"%"+"{"+X+r[o]+";}";w.inject(t+"}")}},b={node:'<span class="node"/>',back:'<span class="face back"/>',over:'<span class="face over"/>'};e.fn.makisu=function(r){if(!k){var t="Failed to detect CSS 3D support";return console&&console.warn&&(console.warn(t),this.each(function(){e(this).trigger("error",t)})),void 0}o||(o=!0,w.keyframes("unfold",{0:"transform: rotateX(180deg)",50:"transform: rotateX(-30deg)",100:"transform: rotateX(0deg)"}),w.keyframes("unfold-first",{0:"transform: rotateX(-90deg)",50:"transform: rotateX(60deg)",100:"transform: rotateX(0deg)"}),w.keyframes("fold",{0:"transform: rotateX(0deg)",100:"transform: rotateX(180deg)"}),w.keyframes("fold-first",{0:"transform: rotateX(0deg)",100:"transform: rotateX(-180deg)"}),w.keyframes("swing-out",{0:"transform: rotateX(0deg)",30:"transform: rotateX(-30deg)",60:"transform: rotateX(15deg)",100:"transform: rotateX(0deg)"}),w.keyframes("swing-in",{0:"transform: rotateX(0deg)",50:"transform: rotateX(-10deg)",90:"transform: rotateX(15deg)",100:"transform: rotateX(0deg)"}),w.keyframes("unfold-over",{0:"opacity: 1.0",100:"opacity: 0.0"}),w.keyframes("fold-over",{0:"opacity: 0.0",100:"opacity: 1.0"}),w.inject(".node {position: relative;display: block;}"),w.inject(".face {pointer-events: none;position: absolute;display: block;height: 100%;width: 100%;left: 0;top: 0;}"));var a=e.extend({},e.fn.makisu.defaults,r),n=Array.prototype.slice.call(arguments,1);return this.each(function(){return x[r]?x[r].apply(this,n):(f=e(this).data(a),f.data("initialized")||(f.data("initialized",!0),c=f.children(a.selector),d=e(b.node).addClass("root"),l=d,c.each(function(r,t){p=e(t),y="fold"+(r?"":"-first"),p.css("position","relative"),p.css(w.prefix({"transform-style":"preserve-3d",transform:"translateZ(-0.1px)"})),g=e(b.back),g.css("background",p.css("background")),g.css(w.prefix({transform:"translateZ(-0.1px)"})),u=e(b.over),u.css(w.prefix({transform:"translateZ(0.1px)"})),u.css({background:a.shading,opacity:0}),m=e(b.node).append(p),m.css(w.prefix({"transform-origin":"50% 0%","transform-style":"preserve-3d",animation:y+" 1ms linear 0s 1 normal forwards"})),p.append(u),p.append(g),l.append(m),l=m}),d.css(w.prefix({"transform-origin":"50% 0%","transform-style":"preserve-3d"})),f.css(w.prefix({transform:"perspective("+a.perspective+"px)"})),f.append(d)),void 0)})},e.fn.makisu.defaults={perspective:1200,shading:"rgba(0,0,0,0.12)",selector:null,overlap:.6,speed:.8,easing:"ease-in-out"},e.fn.makisu.enabled=k}(jQuery);

1 comment on commit 2163ac8

@FrankMillers

gracias

Please sign in to comment.
Something went wrong with that request. Please try again.