]> _ Git - fluidbook-html5.git/commitdiff
wip #5221 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 8 Apr 2022 15:11:14 +0000 (17:11 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 8 Apr 2022 15:11:14 +0000 (17:11 +0200)
js/libs/fluidbook/fluidbook.parallax.js
js/libs/modernizr/modernizr.min.js

index 0e95dc74de21029a23952b25d47b62ae1da00ee8..e1a223c6707469d0f189a6ecde2d0bb06a12ac8a 100644 (file)
@@ -1,5 +1,8 @@
 function FluidbookParallax(fluidbook) {
     this.fluidbook = fluidbook;
+    this.calibrateBeta = null;
+    this.calibrateGamma = null;
+    this.orientationStatus = 0;
     this.init();
 }
 
@@ -37,8 +40,20 @@ FluidbookParallax.prototype = {
         this.y = 0;
         this.update();
 
-        if (Modernizr.hasEvent('deviceOrientation')) {
-
+        if (Modernizr.deviceorientation && !this.fluidbook.input.hasMouse) {
+            window.addEventListener("deviceorientation", function (e) {
+                let beta = e.beta
+                let gamma = e.gamma
+                if (beta !== null && gamma !== null) {
+                    if ($this.calibrateBeta === null) {
+                        $this.calibrateBeta = beta;
+                    }
+                    if ($this.calibrateGamma === null) {
+                        $this.calibrateGamma = null;
+                    }
+                    $this.rotate(beta - $this.calibrateBeta, gamma - $this.calibrateGamma)
+                }
+            }, true);
         } else {
             $(window).on('pointermove', function (e) {
                 $this.x = -1 * $this.normalize((e.clientX - $this.fluidbook.resize.ww / 2) / $this.fluidbook.resize.ww);
@@ -48,6 +63,30 @@ FluidbookParallax.prototype = {
         }
     },
 
+    rotate: function (beta, gamma) {
+        const MAGIC_NUMBER = 90;
+        // Extract Rotation
+        let x = (gamma || 0) / MAGIC_NUMBER, //  -90 :: 90
+            y = (beta || 0) / MAGIC_NUMBER // -180 :: 180
+
+        // Detect Orientation Change
+        let portrait = this.windowHeight > this.windowWidth
+        if (this.portrait !== portrait) {
+            this.portrait = portrait;
+            this.calibrationFlag = true;
+        }
+
+        if (this.calibrationFlag) {
+            this.calibrationFlag = false;
+            this.calibrationX = x;
+            this.calibrationY = y;
+        }
+
+        this.x = -1 * x;
+        this.y = -1 * y;
+        this.update();
+    },
+
     update: function () {
         var $this = this;
         $("[data-parallax]").each(function () {
index 5b8dd75bd1a83915fb8ced98465a176dbdb72ba1..19eacd2edbc9819dda767e974eec2acb5df93016 100644 (file)
@@ -1,3 +1,3 @@
 /*! modernizr 3.6.0 (Custom Build) | MIT *
- * https://modernizr.com/download/?-applicationcache-audio-csstransforms-csstransforms3d-csstransitions-fullscreen-localstorage-passiveeventlisteners-preserve3d-sessionstorage-svg-touchevents-video-webgl-addtest-atrule-domprefixes-hasevent-mq-prefixed-prefixedcss-prefixedcssvalue-prefixes-setclasses-testallprops-testprop-teststyles !*/
-!function(e,t,n){function r(e){var t=x.className,n=Modernizr._config.classPrefix||"";if(_&&(t=t.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(t+=" "+n+e.join(" "+n),_?x.className.baseVal=t:x.className=t)}function o(e,t){return typeof e===t}function a(){var e,t,n,r,a,i,s;for(var l in T)if(T.hasOwnProperty(l)){if(e=[],t=T[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(r=o(t.fn,"function")?t.fn():t.fn,a=0;a<e.length;a++)i=e[a],s=i.split("."),1===s.length?Modernizr[s[0]]=r:(!Modernizr[s[0]]||Modernizr[s[0]]instanceof Boolean||(Modernizr[s[0]]=new Boolean(Modernizr[s[0]])),Modernizr[s[0]][s[1]]=r),C.push((r?"":"no-")+s.join("-"))}}function i(e,t){if("object"==typeof e)for(var n in e)z(e,n)&&i(n,e[n]);else{e=e.toLowerCase();var o=e.split("."),a=Modernizr[o[0]];if(2==o.length&&(a=a[o[1]]),"undefined"!=typeof a)return Modernizr;t="function"==typeof t?t():t,1==o.length?Modernizr[o[0]]=t:(!Modernizr[o[0]]||Modernizr[o[0]]instanceof Boolean||(Modernizr[o[0]]=new Boolean(Modernizr[o[0]])),Modernizr[o[0]][o[1]]=t),r([(t&&0!=t?"":"no-")+o.join("-")]),Modernizr._trigger(e,t)}return Modernizr}function s(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):_?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function l(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function u(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function c(){var e=t.body;return e||(e=s(_?"svg":"body"),e.fake=!0),e}function p(e,n,r,o){var a,i,l,u,p="modernizr",d=s("div"),f=c();if(parseInt(r,10))for(;r--;)l=s("div"),l.id=o?o[r]:p+(r+1),d.appendChild(l);return a=s("style"),a.type="text/css",a.id="s"+p,(f.fake?f:d).appendChild(a),f.appendChild(d),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(t.createTextNode(e)),d.id=p,f.fake&&(f.style.background="",f.style.overflow="hidden",u=x.style.overflow,x.style.overflow="hidden",x.appendChild(f)),i=n(d,e),f.fake?(f.parentNode.removeChild(f),x.style.overflow=u,x.offsetHeight):d.parentNode.removeChild(d),!!i}function d(e,t){return!!~(""+e).indexOf(t)}function f(e,t){return function(){return e.apply(t,arguments)}}function v(e,t,n){var r;for(var a in e)if(e[a]in t)return n===!1?e[a]:(r=t[e[a]],o(r,"function")?f(r,n||t):r);return!1}function m(t,n,r){var o;if("getComputedStyle"in e){o=getComputedStyle.call(e,t,n);var a=e.console;if(null!==o)r&&(o=o.getPropertyValue(r));else if(a){var i=a.error?"error":"log";a[i].call(a,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else o=!n&&t.currentStyle&&t.currentStyle[r];return o}function y(t,r){var o=t.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(u(t[o]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var a=[];o--;)a.push("("+u(t[o])+":"+r+")");return a=a.join(" or "),p("@supports ("+a+") { #modernizr { position: absolute; } }",function(e){return"absolute"==m(e,null,"position")})}return n}function g(e,t,r,a){function i(){c&&(delete B.style,delete B.modElem)}if(a=o(a,"undefined")?!1:a,!o(r,"undefined")){var u=y(e,r);if(!o(u,"undefined"))return u}for(var c,p,f,v,m,g=["modernizr","tspan","samp"];!B.style&&g.length;)c=!0,B.modElem=s(g.shift()),B.style=B.modElem.style;for(f=e.length,p=0;f>p;p++)if(v=e[p],m=B.style[v],d(v,"-")&&(v=l(v)),B.style[v]!==n){if(a||o(r,"undefined"))return i(),"pfx"==t?v:!0;try{B.style[v]=r}catch(h){}if(B.style[v]!=m)return i(),"pfx"==t?v:!0}return i(),!1}function h(e,t,n,r,a){var i=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+A.join(i+" ")+i).split(" ");return o(t,"string")||o(t,"undefined")?g(s,t,r,a):(s=(e+" "+E.join(i+" ")+i).split(" "),v(s,t,n))}function S(e,t,r){return h(e,n,n,t,r)}var C=[],T=[],w={_version:"3.6.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){T.push({name:e,fn:t,options:n})},addAsyncTest:function(e){T.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=w,Modernizr=new Modernizr,Modernizr.addTest("applicationcache","applicationCache"in e),Modernizr.addTest("svg",!!t.createElementNS&&!!t.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),Modernizr.addTest("passiveeventlisteners",function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("test",null,n)}catch(r){}return t}),Modernizr.addTest("localstorage",function(){var e="modernizr";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(t){return!1}}),Modernizr.addTest("sessionstorage",function(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(t){return!1}});var b=w._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];w._prefixes=b;var x=t.documentElement,_="svg"===x.nodeName.toLowerCase(),P="Moz O ms Webkit",E=w._config.usePrefixes?P.toLowerCase().split(" "):[];w._domPrefixes=E;var z;!function(){var e={}.hasOwnProperty;z=o(e,"undefined")||o(e.call,"undefined")?function(e,t){return t in e&&o(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),w._l={},w.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},w._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e<n.length;e++)(r=n[e])(t)},0),delete this._l[e]}},Modernizr._q.push(function(){w.addTest=i});var $=function(){function e(e,t){var o;return e?(t&&"string"!=typeof t||(t=s(t||"div")),e="on"+e,o=e in t,!o&&r&&(t.setAttribute||(t=s("div")),t.setAttribute(e,""),o="function"==typeof t[e],t[e]!==n&&(t[e]=n),t.removeAttribute(e)),o):!1}var r=!("onblur"in t.documentElement);return e}();w.hasEvent=$;var j=function(e,t){var n=!1,r=s("div"),o=r.style;if(e in o){var a=E.length;for(o[e]=t,n=o[e];a--&&!n;)o[e]="-"+E[a]+"-"+t,n=o[e]}return""===n&&(n=!1),n};w.prefixedCSSValue=j,Modernizr.addTest("audio",function(){var e=s("audio"),t=!1;try{t=!!e.canPlayType,t&&(t=new Boolean(t),t.ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),t.mp3=e.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/,""),t.opus=e.canPlayType('audio/ogg; codecs="opus"')||e.canPlayType('audio/webm; codecs="opus"').replace(/^no$/,""),t.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),t.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(n){}return t}),Modernizr.addTest("webgl",function(){var t=s("canvas"),n="probablySupportsContext"in t?"probablySupportsContext":"supportsContext";return n in t?t[n]("webgl")||t[n]("experimental-webgl"):"WebGLRenderingContext"in e}),Modernizr.addTest("video",function(){var e=s("video"),t=!1;try{t=!!e.canPlayType,t&&(t=new Boolean(t),t.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),t.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),t.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""),t.vp9=e.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,""),t.hls=e.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,""))}catch(n){}return t}),Modernizr.addTest("preserve3d",function(){var t,n,r=e.CSS,o=!1;return r&&r.supports&&r.supports("(transform-style: preserve-3d)")?!0:(t=s("a"),n=s("a"),t.style.cssText="display: block; transform-style: preserve-3d; transform-origin: right; transform: rotateY(40deg);",n.style.cssText="display: block; width: 9px; height: 1px; background: #000; transform-origin: right; transform: rotateY(40deg);",t.appendChild(n),x.appendChild(t),o=n.getBoundingClientRect(),x.removeChild(t),o=o.width&&o.width<4)});var A=w._config.usePrefixes?P.split(" "):[];w._cssomPrefixes=A;var L=function(t){var r,o=b.length,a=e.CSSRule;if("undefined"==typeof a)return n;if(!t)return!1;if(t=t.replace(/^@/,""),r=t.replace(/-/g,"_").toUpperCase()+"_RULE",r in a)return"@"+t;for(var i=0;o>i;i++){var s=b[i],l=s.toUpperCase()+"_"+r;if(l in a)return"@-"+s.toLowerCase()+"-"+t}return!1};w.atRule=L;var N="CSS"in e&&"supports"in e.CSS,k="supportsCSS"in e;Modernizr.addTest("supports",N||k);var O=function(){var t=e.matchMedia||e.msMatchMedia;return t?function(e){var n=t(e);return n&&n.matches||!1}:function(t){var n=!1;return p("@media "+t+" { #modernizr { position: absolute; } }",function(t){n="absolute"==(e.getComputedStyle?e.getComputedStyle(t,null):t.currentStyle).position}),n}}();w.mq=O;var R=w.testStyles=p;Modernizr.addTest("touchevents",function(){var n;if("ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch)n=!0;else{var r=["@media (",b.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join("");R(r,function(e){n=9===e.offsetTop})}return n});var q={elem:s("modernizr")};Modernizr._q.push(function(){delete q.elem});var B={style:q.elem.style};Modernizr._q.unshift(function(){delete B.style});w.testProp=function(e,t,r){return g([e],n,t,r)};w.testAllProps=h;var I=w.prefixed=function(e,t,n){return 0===e.indexOf("@")?L(e):(-1!=e.indexOf("-")&&(e=l(e)),t?h(e,t,n):h(e,"pfx"))};w.prefixedCSS=function(e){var t=I(e);return t&&u(t)};Modernizr.addTest("fullscreen",!(!I("exitFullscreen",t,!1)&&!I("cancelFullScreen",t,!1))),w.testAllProps=S,Modernizr.addTest("csstransforms",function(){return-1===navigator.userAgent.indexOf("Android 2.")&&S("transform","scale(1)",!0)}),Modernizr.addTest("csstransforms3d",function(){return!!S("perspective","1px",!0)}),Modernizr.addTest("csstransitions",S("transition","all",!0)),a(),r(C),delete w.addTest,delete w.addAsyncTest;for(var U=0;U<Modernizr._q.length;U++)Modernizr._q[U]();e.Modernizr=Modernizr}(window,document);
\ No newline at end of file
+ * https://modernizr.com/download/?-applicationcache-audio-csstransforms-csstransforms3d-csstransitions-devicemotion_deviceorientation-fullscreen-localstorage-passiveeventlisteners-preserve3d-sessionstorage-svg-touchevents-video-webgl-addtest-atrule-domprefixes-hasevent-mq-prefixed-prefixedcss-prefixedcssvalue-prefixes-setclasses-testallprops-testprop-teststyles !*/
+!function(e,t,n){function r(e,t){return typeof e===t}function o(){var e,t,n,o,i,a,s;for(var l in T)if(T.hasOwnProperty(l)){if(e=[],t=T[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(o=r(t.fn,"function")?t.fn():t.fn,i=0;i<e.length;i++)a=e[i],s=a.split("."),1===s.length?Modernizr[s[0]]=o:(!Modernizr[s[0]]||Modernizr[s[0]]instanceof Boolean||(Modernizr[s[0]]=new Boolean(Modernizr[s[0]])),Modernizr[s[0]][s[1]]=o),C.push((o?"":"no-")+s.join("-"))}}function i(e){var t=x.className,n=Modernizr._config.classPrefix||"";if(_&&(t=t.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(t+=" "+n+e.join(" "+n),_?x.className.baseVal=t:x.className=t)}function a(e,t){if("object"==typeof e)for(var n in e)z(e,n)&&a(n,e[n]);else{e=e.toLowerCase();var r=e.split("."),o=Modernizr[r[0]];if(2==r.length&&(o=o[r[1]]),"undefined"!=typeof o)return Modernizr;t="function"==typeof t?t():t,1==r.length?Modernizr[r[0]]=t:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=t),i([(t&&0!=t?"":"no-")+r.join("-")]),Modernizr._trigger(e,t)}return Modernizr}function s(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):_?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function l(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function u(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function c(){var e=t.body;return e||(e=s(_?"svg":"body"),e.fake=!0),e}function d(e,n,r,o){var i,a,l,u,d="modernizr",p=s("div"),f=c();if(parseInt(r,10))for(;r--;)l=s("div"),l.id=o?o[r]:d+(r+1),p.appendChild(l);return i=s("style"),i.type="text/css",i.id="s"+d,(f.fake?f:p).appendChild(i),f.appendChild(p),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(t.createTextNode(e)),p.id=d,f.fake&&(f.style.background="",f.style.overflow="hidden",u=x.style.overflow,x.style.overflow="hidden",x.appendChild(f)),a=n(p,e),f.fake?(f.parentNode.removeChild(f),x.style.overflow=u,x.offsetHeight):p.parentNode.removeChild(p),!!a}function p(e,t){return!!~(""+e).indexOf(t)}function f(e,t){return function(){return e.apply(t,arguments)}}function v(e,t,n){var o;for(var i in e)if(e[i]in t)return n===!1?e[i]:(o=t[e[i]],r(o,"function")?f(o,n||t):o);return!1}function m(t,n,r){var o;if("getComputedStyle"in e){o=getComputedStyle.call(e,t,n);var i=e.console;if(null!==o)r&&(o=o.getPropertyValue(r));else if(i){var a=i.error?"error":"log";i[a].call(i,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else o=!n&&t.currentStyle&&t.currentStyle[r];return o}function y(t,r){var o=t.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(u(t[o]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var i=[];o--;)i.push("("+u(t[o])+":"+r+")");return i=i.join(" or "),d("@supports ("+i+") { #modernizr { position: absolute; } }",function(e){return"absolute"==m(e,null,"position")})}return n}function g(e,t,o,i){function a(){c&&(delete B.style,delete B.modElem)}if(i=r(i,"undefined")?!1:i,!r(o,"undefined")){var u=y(e,o);if(!r(u,"undefined"))return u}for(var c,d,f,v,m,g=["modernizr","tspan","samp"];!B.style&&g.length;)c=!0,B.modElem=s(g.shift()),B.style=B.modElem.style;for(f=e.length,d=0;f>d;d++)if(v=e[d],m=B.style[v],p(v,"-")&&(v=l(v)),B.style[v]!==n){if(i||r(o,"undefined"))return a(),"pfx"==t?v:!0;try{B.style[v]=o}catch(h){}if(B.style[v]!=m)return a(),"pfx"==t?v:!0}return a(),!1}function h(e,t,n,o,i){var a=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+$.join(a+" ")+a).split(" ");return r(t,"string")||r(t,"undefined")?g(s,t,o,i):(s=(e+" "+E.join(a+" ")+a).split(" "),v(s,t,n))}function S(e,t,r){return h(e,n,n,t,r)}var C=[],T=[],w={_version:"3.6.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){T.push({name:e,fn:t,options:n})},addAsyncTest:function(e){T.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=w,Modernizr=new Modernizr,Modernizr.addTest("applicationcache","applicationCache"in e),Modernizr.addTest("svg",!!t.createElementNS&&!!t.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),Modernizr.addTest("passiveeventlisteners",function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("test",null,n)}catch(r){}return t}),Modernizr.addTest("devicemotion","DeviceMotionEvent"in e),Modernizr.addTest("deviceorientation","DeviceOrientationEvent"in e),Modernizr.addTest("localstorage",function(){var e="modernizr";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(t){return!1}}),Modernizr.addTest("sessionstorage",function(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(t){return!1}});var b=w._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];w._prefixes=b;var x=t.documentElement,_="svg"===x.nodeName.toLowerCase(),P="Moz O ms Webkit",E=w._config.usePrefixes?P.toLowerCase().split(" "):[];w._domPrefixes=E;var z;!function(){var e={}.hasOwnProperty;z=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),w._l={},w.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},w._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e<n.length;e++)(r=n[e])(t)},0),delete this._l[e]}},Modernizr._q.push(function(){w.addTest=a});var $=w._config.usePrefixes?P.split(" "):[];w._cssomPrefixes=$;var j=function(t){var r,o=b.length,i=e.CSSRule;if("undefined"==typeof i)return n;if(!t)return!1;if(t=t.replace(/^@/,""),r=t.replace(/-/g,"_").toUpperCase()+"_RULE",r in i)return"@"+t;for(var a=0;o>a;a++){var s=b[a],l=s.toUpperCase()+"_"+r;if(l in i)return"@-"+s.toLowerCase()+"-"+t}return!1};w.atRule=j;var A=function(){function e(e,t){var o;return e?(t&&"string"!=typeof t||(t=s(t||"div")),e="on"+e,o=e in t,!o&&r&&(t.setAttribute||(t=s("div")),t.setAttribute(e,""),o="function"==typeof t[e],t[e]!==n&&(t[e]=n),t.removeAttribute(e)),o):!1}var r=!("onblur"in t.documentElement);return e}();w.hasEvent=A;var L=function(e,t){var n=!1,r=s("div"),o=r.style;if(e in o){var i=E.length;for(o[e]=t,n=o[e];i--&&!n;)o[e]="-"+E[i]+"-"+t,n=o[e]}return""===n&&(n=!1),n};w.prefixedCSSValue=L,Modernizr.addTest("audio",function(){var e=s("audio"),t=!1;try{t=!!e.canPlayType,t&&(t=new Boolean(t),t.ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),t.mp3=e.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/,""),t.opus=e.canPlayType('audio/ogg; codecs="opus"')||e.canPlayType('audio/webm; codecs="opus"').replace(/^no$/,""),t.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),t.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(n){}return t}),Modernizr.addTest("video",function(){var e=s("video"),t=!1;try{t=!!e.canPlayType,t&&(t=new Boolean(t),t.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),t.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),t.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""),t.vp9=e.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,""),t.hls=e.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,""))}catch(n){}return t}),Modernizr.addTest("webgl",function(){var t=s("canvas"),n="probablySupportsContext"in t?"probablySupportsContext":"supportsContext";return n in t?t[n]("webgl")||t[n]("experimental-webgl"):"WebGLRenderingContext"in e}),Modernizr.addTest("preserve3d",function(){var t,n,r=e.CSS,o=!1;return r&&r.supports&&r.supports("(transform-style: preserve-3d)")?!0:(t=s("a"),n=s("a"),t.style.cssText="display: block; transform-style: preserve-3d; transform-origin: right; transform: rotateY(40deg);",n.style.cssText="display: block; width: 9px; height: 1px; background: #000; transform-origin: right; transform: rotateY(40deg);",t.appendChild(n),x.appendChild(t),o=n.getBoundingClientRect(),x.removeChild(t),o=o.width&&o.width<4)});var N="CSS"in e&&"supports"in e.CSS,O="supportsCSS"in e;Modernizr.addTest("supports",N||O);var k=function(){var t=e.matchMedia||e.msMatchMedia;return t?function(e){var n=t(e);return n&&n.matches||!1}:function(t){var n=!1;return d("@media "+t+" { #modernizr { position: absolute; } }",function(t){n="absolute"==(e.getComputedStyle?e.getComputedStyle(t,null):t.currentStyle).position}),n}}();w.mq=k;var R=w.testStyles=d;Modernizr.addTest("touchevents",function(){var n;if("ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch)n=!0;else{var r=["@media (",b.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join("");R(r,function(e){n=9===e.offsetTop})}return n});var q={elem:s("modernizr")};Modernizr._q.push(function(){delete q.elem});var B={style:q.elem.style};Modernizr._q.unshift(function(){delete B.style});w.testProp=function(e,t,r){return g([e],n,t,r)};w.testAllProps=h;var I=w.prefixed=function(e,t,n){return 0===e.indexOf("@")?j(e):(-1!=e.indexOf("-")&&(e=l(e)),t?h(e,t,n):h(e,"pfx"))};w.prefixedCSS=function(e){var t=I(e);return t&&u(t)};Modernizr.addTest("fullscreen",!(!I("exitFullscreen",t,!1)&&!I("cancelFullScreen",t,!1))),w.testAllProps=S,Modernizr.addTest("csstransforms",function(){return-1===navigator.userAgent.indexOf("Android 2.")&&S("transform","scale(1)",!0)}),Modernizr.addTest("csstransforms3d",function(){return!!S("perspective","1px",!0)}),Modernizr.addTest("csstransitions",S("transition","all",!0)),o(),i(C),delete w.addTest,delete w.addAsyncTest;for(var M=0;M<Modernizr._q.length;M++)Modernizr._q[M]();e.Modernizr=Modernizr}(window,document);
\ No newline at end of file