-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwow.min.js
1 lines (1 loc) · 7.24 KB
/
wow.min.js
1
(function(){var e,t,n,r,i,s=function(e,t){return function(){return e.apply(t,arguments)}},o=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++){if(t in this&&this[t]===e)return t}return-1};t=function(){function e(){}e.prototype.extend=function(e,t){var n,r;for(n in t){r=t[n];if(e[n]==null){e[n]=r}}return e};e.prototype.isMobile=function(e){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)};e.prototype.addEvent=function(e,t,n){if(e.addEventListener!=null){return e.addEventListener(t,n,false)}else if(e.attachEvent!=null){return e.attachEvent("on"+t,n)}else{return e[t]=n}};e.prototype.removeEvent=function(e,t,n){if(e.removeEventListener!=null){return e.removeEventListener(t,n,false)}else if(e.detachEvent!=null){return e.detachEvent("on"+t,n)}else{return delete e[t]}};e.prototype.innerHeight=function(){if("innerHeight"in window){return window.innerHeight}else{return document.documentElement.clientHeight}};return e}();n=this.WeakMap||this.MozWeakMap||(n=function(){function e(){this.keys=[];this.values=[]}e.prototype.get=function(e){var t,n,r,i,s;s=this.keys;for(t=r=0,i=s.length;r<i;t=++r){n=s[t];if(n===e){return this.values[t]}}};e.prototype.set=function(e,t){var n,r,i,s,o;o=this.keys;for(n=i=0,s=o.length;i<s;n=++i){r=o[n];if(r===e){this.values[n]=t;return}}this.keys.push(e);return this.values.push(t)};return e}());e=this.MutationObserver||this.WebkitMutationObserver||this.MozMutationObserver||(e=function(){function e(){if(typeof console!=="undefined"&&console!==null){console.warn("MutationObserver is not supported by your browser.")}if(typeof console!=="undefined"&&console!==null){console.warn("WOW.js cannot detect dom mutations, please call .sync() after loading new content.")}}e.notSupported=true;e.prototype.observe=function(){};return e}());r=this.getComputedStyle||function(e,t){this.getPropertyValue=function(t){var n;if(t==="float"){t="styleFloat"}if(i.test(t)){t.replace(i,function(e,t){return t.toUpperCase()})}return((n=e.currentStyle)!=null?n[t]:void 0)||null};return this};i=/(\-([a-z]){1})/g;this.WOW=function(){function i(e){if(e==null){e={}}this.scrollCallback=s(this.scrollCallback,this);this.scrollHandler=s(this.scrollHandler,this);this.start=s(this.start,this);this.scrolled=true;this.config=this.util().extend(e,this.defaults);this.animationNameCache=new n}i.prototype.defaults={boxClass:"wow",animateClass:"animated",offset:0,mobile:true,live:true};i.prototype.init=function(){var e;this.element=window.document.documentElement;if((e=document.readyState)==="interactive"||e==="complete"){this.start()}else{this.util().addEvent(document,"DOMContentLoaded",this.start)}return this.finished=[]};i.prototype.start=function(){var t,n,r,i;this.stopped=false;this.boxes=function(){var e,n,r,i;r=this.element.querySelectorAll("."+this.config.boxClass);i=[];for(e=0,n=r.length;e<n;e++){t=r[e];i.push(t)}return i}.call(this);this.all=function(){var e,n,r,i;r=this.boxes;i=[];for(e=0,n=r.length;e<n;e++){t=r[e];i.push(t)}return i}.call(this);if(this.boxes.length){if(this.disabled()){this.resetStyle()}else{i=this.boxes;for(n=0,r=i.length;n<r;n++){t=i[n];this.applyStyle(t,true)}}}if(!this.disabled()){this.util().addEvent(window,"scroll",this.scrollHandler);this.util().addEvent(window,"resize",this.scrollHandler);this.interval=setInterval(this.scrollCallback,50)}if(this.config.live){return(new e(function(e){return function(t){var n,r,i,s,o;o=[];for(i=0,s=t.length;i<s;i++){r=t[i];o.push(function(){var e,t,i,s;i=r.addedNodes||[];s=[];for(e=0,t=i.length;e<t;e++){n=i[e];s.push(this.doSync(n))}return s}.call(e))}return o}}(this))).observe(document.body,{childList:true,subtree:true})}};i.prototype.stop=function(){this.stopped=true;this.util().removeEvent(window,"scroll",this.scrollHandler);this.util().removeEvent(window,"resize",this.scrollHandler);if(this.interval!=null){return clearInterval(this.interval)}};i.prototype.sync=function(t){if(e.notSupported){return this.doSync(this.element)}};i.prototype.doSync=function(e){var t,n,r,i,s;if(e==null){e=this.element}if(e.nodeType!==1){return}e=e.parentNode||e;i=e.querySelectorAll("."+this.config.boxClass);s=[];for(n=0,r=i.length;n<r;n++){t=i[n];if(o.call(this.all,t)<0){this.boxes.push(t);this.all.push(t);if(this.stopped||this.disabled()){this.resetStyle()}else{this.applyStyle(t,true)}s.push(this.scrolled=true)}else{s.push(void 0)}}return s};i.prototype.show=function(e){this.applyStyle(e);return e.className=""+e.className+" "+this.config.animateClass};i.prototype.applyStyle=function(e,t){var n,r,i;r=e.getAttribute("data-wow-duration");n=e.getAttribute("data-wow-delay");i=e.getAttribute("data-wow-iteration");return this.animate(function(s){return function(){return s.customStyle(e,t,r,n,i)}}(this))};i.prototype.animate=function(){if("requestAnimationFrame"in window){return function(e){return window.requestAnimationFrame(e)}}else{return function(e){return e()}}}();i.prototype.resetStyle=function(){var e,t,n,r,i;r=this.boxes;i=[];for(t=0,n=r.length;t<n;t++){e=r[t];i.push(e.style.visibility="visible")}return i};i.prototype.customStyle=function(e,t,n,r,i){if(t){this.cacheAnimationName(e)}e.style.visibility=t?"hidden":"visible";if(n){this.vendorSet(e.style,{animationDuration:n})}if(r){this.vendorSet(e.style,{animationDelay:r})}if(i){this.vendorSet(e.style,{animationIterationCount:i})}this.vendorSet(e.style,{animationName:t?"none":this.cachedAnimationName(e)});return e};i.prototype.vendors=["moz","webkit"];i.prototype.vendorSet=function(e,t){var n,r,i,s;s=[];for(n in t){r=t[n];e[""+n]=r;s.push(function(){var t,s,o,u;o=this.vendors;u=[];for(t=0,s=o.length;t<s;t++){i=o[t];u.push(e[""+i+n.charAt(0).toUpperCase()+n.substr(1)]=r)}return u}.call(this))}return s};i.prototype.vendorCSS=function(e,t){var n,i,s,o,u,a;i=r(e);n=i.getPropertyCSSValue(t);a=this.vendors;for(o=0,u=a.length;o<u;o++){s=a[o];n=n||i.getPropertyCSSValue("-"+s+"-"+t)}return n};i.prototype.animationName=function(e){var t;try{t=this.vendorCSS(e,"animation-name").cssText}catch(n){t=r(e).getPropertyValue("animation-name")}if(t==="none"){return""}else{return t}};i.prototype.cacheAnimationName=function(e){return this.animationNameCache.set(e,this.animationName(e))};i.prototype.cachedAnimationName=function(e){return this.animationNameCache.get(e)};i.prototype.scrollHandler=function(){return this.scrolled=true};i.prototype.scrollCallback=function(){var e;if(this.scrolled){this.scrolled=false;this.boxes=function(){var t,n,r,i;r=this.boxes;i=[];for(t=0,n=r.length;t<n;t++){e=r[t];if(!e){continue}if(this.isVisible(e)){this.show(e);continue}i.push(e)}return i}.call(this);if(!(this.boxes.length||this.config.live)){return this.stop()}}};i.prototype.offsetTop=function(e){var t;while(e.offsetTop===void 0){e=e.parentNode}t=e.offsetTop;while(e=e.offsetParent){t+=e.offsetTop}return t};i.prototype.isVisible=function(e){var t,n,r,i,s;n=e.getAttribute("data-wow-offset")||this.config.offset;s=window.pageYOffset;i=s+Math.min(this.element.clientHeight,this.util().innerHeight())-n;r=this.offsetTop(e);t=r+e.clientHeight;return r<=i&&t>=s};i.prototype.util=function(){return this._util!=null?this._util:this._util=new t};i.prototype.disabled=function(){return!this.config.mobile&&this.util().isMobile(navigator.userAgent)};return i}()}).call(this);jQuery(document).ready(function(e){"use strict";var t=new WOW({boxClass:"much-wow",animateClass:"animated",offset:100,mobile:true,live:true});t.init()})