/*! https://artpolikarpov.github.io/responsivr.js/ * © 2014 Artem Polikarpov, MIT license */ !function(a){function b(){}function c(a,b,d){a()?b.call(this):0>d?c(a,b,d):setTimeout(function(){c(a,b,d)},d||10)}function d(a){r.styleSheet?r.styleSheet.cssText=a:r.innerHTML=a}function e(){var a;c(function(){return n?a=Math.round(Math.random()*(m.length-1)):(a=p.labelIndex+1,a>=m.length&&(a=0)),a!==p.labelIndex||1===m.length},function(){i=m[a],p.labelIndex=a},-1)}function f(){o.log("Ah, resize!"),clearTimeout(f.t),f.t=setTimeout(p.hide,k),p.show(),j&&(p.label.innerHTML=i())}var g,h,i,j,k,l,m,n,o=a.console||{log:b},p={},q=a.document,r=q.createElement("style");p.overlay=q.createElement("div"),p.label=q.createElement("div"),p.overlay.className="responsivr",p.label.className="responsivr__label",p.overlay.appendChild(p.label);var s=function(){o.log("Make responsive!"),k=isNaN(a.RESPONSIVR_HIDE_DELAY)?500:a.RESPONSIVR_HIDE_DELAY,l=isNaN(a.RESPONSIVR_HIDE_DURATION)?250:a.RESPONSIVR_HIDE_DURATION,m="[object Array]"===Object.prototype.toString.call(a.RESPONSIVR_LABELS)?a.RESPONSIVR_LABELS:["This is responsive!"],n="undefined"!=typeof a.RESPONSIVR_RANDOM?a.RESPONSIVR_RANDOM:!0,p.labelIndex=-1;var b="opacity "+l+"ms linear;";d(".responsivr {position: fixed;z-index: 2147483647;top: 0;right: 0;bottom: 0;left: 0;width: 100%;height: 100%;color: #000;background-color: #fff;text-align: center;opacity: 0;display: none;-webkit-transition: "+b+"transition: "+b+'}.responsivr--visible {opacity: 1;-webkit-transition: none;transition: none;}.responsivr:before {content: "";display: inline-block;width: 1px;height: 100%;vertical-align: middle;margin-right: -1px;}.responsivr__label {display: inline-block;vertical-align: middle;font-size: 24px;line-height: 1.5;padding: .4em 1.2em;margin: 0 auto;}'),g.appendChild(r),g.appendChild(p.overlay),a.addEventListener&&a.addEventListener("resize",f,!1)},t=function(){return h?void 0:(h=!0,p.overlay.style.display="block",setTimeout(function(){p.overlay.className="responsivr responsivr--visible"},0),e(),(j="function"==typeof i)||(p.label.innerHTML=i),!0)};p.show=function(){return t()?(j&&(p.label.innerHTML=i()),(a.RESPONSIVR_ON_SHOW||b)(),p):p},p.hide=function(){return!h||p.isHiding?p:(p.isHiding=!0,p.overlay.className="responsivr",setTimeout(function(){h=!1,p.isHiding=!1,p.overlay.style.display="none"},l),(a.RESPONSIVR_ON_HIDE||b)(),p)},p.destroy=function(){return p.isWatching&&g?(o.log("Bye-bye, brave :-*"),p.isWatching=!1,g.removeChild(r),g.removeChild(p.overlay),a.removeEventListener&&a.removeEventListener("resize",f,!1),p):p},p.initialize=function(){return p.isWatching?p:(p.isWatching=!0,c(function(){return(g=q.getElementsByTagName("body")[0])||o.log("Wait for body...")&&!1},function(){s.call(this)}),p)},a.RESPONSIVR_MANUAL_START||p.initialize(),a.Responsivr=p}(window);