-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathfadeM.min.js
1 lines (1 loc) · 5.15 KB
/
fadeM.min.js
1
function cssTransitions(){var e=document.documentElement.style;if(e.webkitTransition!==undefined||e.MozTransition!==undefined||e.OTransition!==undefined||e.MsTransition!==undefined||e.transition!==undefined){return false}else{return true}}function startFadeM(e,t,n,r,i,s,o,u){if(isNaN(e)||isNaN(t)||isNaN(n)){alert("The FadeM settings require numbers. Looks like you typed "+e+" and "+t+" and "+n+". Oops!")}var a=parseInt(e);var f=parseInt(t);var l=parseInt(n);var c=parseInt(i);var h=parseInt(s);var p="0."+a;$("body").css("overflow-x","hidden");var d=$(".fadeM").toArray();for(var v=0;v<d.length;v++){$(d[v]).css("transition","all 0."+l+"s ease-in-out");$(d[v]).css("opacity","0."+a)}var m=$(".glideM").toArray();for(var v=0;v<m.length;v++){$(m[v]).css("transition","all 0."+l+"s cubic-bezier(0.785, 0.135, 0.15, 0.86)");if(u=="alt"){if(v%2==0){$(m[v]).css("transform","translate("+$(window).width()+"px,0px)");$(m[v]).css("-moz-transform","translate("+$(window).width()+"px,0px)");$(m[v]).css("-webkit-transform","translate("+$(window).width()+"px,0px)")}else if(v%2==1){$(m[v]).css("transform","translate(-"+$(window).width()+"px,0px)");$(m[v]).css("-moz-transform","translate(-"+$(window).width()+"px,0px)");$(m[v]).css("-webkit-transform","translate(-"+$(window).width()+"px,0px)")}}else if(u=="left"){$(m[v]).css("transform","translate("+$(window).width()+"px,0px)");$(m[v]).css("-moz-transform","translate("+$(window).width()+"px,0px)");$(m[v]).css("-webkit-transform","translate("+$(window).width()+"px,0px)")}else{$(m[v]).css("transform","translate(-"+$(window).width()+"px,0px)");$(m[v]).css("-moz-transform","translate(-"+$(window).width()+"px,0px)");$(m[v]).css("-webkit-transform","translate(-"+$(window).width()+"px,0px)")}}var g=$(".popM").toArray();for(var v=0;v<g.length;v++){$(g[v]).css("transition","all 0."+l+"s cubic-bezier(0.785, 0.135, 0.15, 0.86)");$(g[v]).css("transform","skew(90deg) scale(0.1)")}var y=$(".zooM").toArray();for(var v=0;v<y.length;v++){$(y[v]).css("transition","all 0."+l+"s ease-in-out");$(y[v]).css("transform","scale("+o+")");$(y[v]).css("-moz-transform","scale("+o+")");$(y[v]).css("-webkit-transform","scale("+o+")")}var b=$(".stickM").toArray();var w=[];for(var v=0;v<b.length;v++){$(b[v]).css("position","relative");$(b[v]).css("z-index","100000");w.push($(b[v]).offset().top)}$(window).scroll(function(){var e=document.documentElement,t=document.body;var n=e&&e.scrollTop||t&&t.scrollTop||0;var i=$(".fadeM").toArray();for(var s=0;s<i.length;s++){posF=$(i[s]).offset().top-f;if(n>posF){if(!cssTransitions()==false){$(i[s]).fadeTo(100,1)}else if(!cssTransitions()==true){$(i[s]).css("opacity","1.0")}}else{if(!cssTransitions()==false){$(i[s]).fadeTo(100,p)}else if(!cssTransitions()==true){$(i[s]).css("opacity","0."+a)}}}var l=$(".glideM").toArray();for(var s=0;s<l.length;s++){posG=$(l[s]).offset().top-f;if(n>posG){$(l[s]).css("transform","translate(0px,0px)");$(l[s]).css("-moz-transform","translate(0px,0px)");$(l[s]).css("-webkit-transform","translate(0px,0px)")}else{if(u=="alt"){if(s%2==0){$(l[s]).css("transform","translate("+$(window).width()+"px,0px)");$(l[s]).css("-moz-transform","translate("+$(window).width()+"px,0px)");$(l[s]).css("-webkit-transform","translate("+$(window).width()+"px,0px)")}else if(s%2==1){$(l[s]).css("transform","translate(-"+$(window).width()+"px,0px)");$(l[s]).css("-moz-transform","translate(-"+$(window).width()+"px,0px)");$(l[s]).css("-webkit-transform","translate(-"+$(window).width()+"px,0px)")}}else if(u=="left"){$(l[s]).css("transform","translate("+$(window).width()+"px,0px)");$(l[s]).css("-moz-transform","translate("+$(window).width()+"px,0px)");$(l[s]).css("-webkit-transform","translate("+$(window).width()+"px,0px)")}else{$(l[s]).css("transform","translate(-"+$(window).width()+"px,0px)");$(l[s]).css("-moz-transform","translate(-"+$(window).width()+"px,0px)");$(l[s]).css("-webkit-transform","translate(-"+$(window).width()+"px,0px)")}}}var d=$(".popM").toArray();for(var s=0;s<d.length;s++){posP=$(d[s]).offset().top-f;if(n>posP){$(d[s]).css("transform","skew(0deg) scale(1.0)");$(d[s]).css("-moz-transform","skew(0deg) scale(1.0)");$(d[s]).css("-webkit-transform","skew(0deg) scale(1.0)")}else{$(d[s]).css("transform","skew(90deg) scale(0.1)");$(d[s]).css("-moz-transform","skew(90deg) scale(0.1)");$(d[s]).css("-webkit-transform","skew(90deg) scale(0.1)")}}var v=$(".zooM").toArray();for(var s=0;s<v.length;s++){posZ=$(v[s]).offset().top-f;if(n>posZ){$(v[s]).css("transform","scale(1.0)");$(v[s]).css("-moz-transform","scale(1.0)");$(v[s]).css("-webkit-transform","scale(1.0)")}else{$(v[s]).css("transform","scale("+o+")");$(y[s]).css("-moz-transform","scale("+o+")");$(y[s]).css("-webkit-transform","scale("+o+")")}}for(var s=0;s<b.length;s++){if(r=="on"){if(n>=w[s]-h&&n<=w[s]+c-h){$(b[s]).css("position","fixed");$(b[s]).css("top",h+"px")}else if(n>=w[s]+c-h){$(b[s]).css("position","relative");$(b[s]).css("top",n-n+c+"px")}else{$(b[s]).css("position","relative");$(b[s]).css("top","0px")}}else{if(n>=w[s]-h){$(b[s]).css("position","fixed");$(b[s]).css("top",h+"px")}else{$(b[s]).css("position","absolute");$(b[s]).css("top","0px")}}}})}document.write('<style type="text/css">body{display:none}</style>');jQuery(function(e){e("body").css("display","block")})