diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-04 15:40:37 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-04 15:40:37 +0100 |
commit | 6f5d5569ef1042bd3a643f341d938761d5a397e1 (patch) | |
tree | ccf9c9b813b994c00391d5ad2021057418cf8eff | |
parent | 32da7948bed6da8fba51eb4220cbf35fe3234f5f (diff) | |
download | puszcza-6f5d5569ef1042bd3a643f341d938761d5a397e1.tar.gz puszcza-6f5d5569ef1042bd3a643f341d938761d5a397e1.zip |
Add modernizr
-rw-r--r-- | app.html | 1 | ||||
-rw-r--r-- | components/JoinUs.vue | 5 | ||||
-rw-r--r-- | components/ObozWidget.vue | 5 | ||||
-rw-r--r-- | modernizr.config.json | 9 | ||||
-rw-r--r-- | static/modernizr.js | 3 |
5 files changed, 15 insertions, 8 deletions
diff --git a/app.html b/app.html index 90f5368..e1236b9 100644 --- a/app.html +++ b/app.html @@ -3,6 +3,7 @@ <head {{ HEAD_ATTRS }}> {{ HEAD }} <meta property="fb:pages" content="496021544115239" /> + <script src="/modernizr.js"></script> </head> <body {{ BODY_ATTRS }}> {{ APP }} diff --git a/components/JoinUs.vue b/components/JoinUs.vue index 4359a82..65431fa 100644 --- a/components/JoinUs.vue +++ b/components/JoinUs.vue @@ -25,15 +25,12 @@ export default { background-image: url('/assets/bg.webp'); } -.no-webp .joinus { - background-image: url('/assets/bg.jpg'); -} - .joinus { width: 100%; padding: 80px 20%; + background-image: url('/assets/bg.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; diff --git a/components/ObozWidget.vue b/components/ObozWidget.vue index 887fd13..084feab 100644 --- a/components/ObozWidget.vue +++ b/components/ObozWidget.vue @@ -17,16 +17,13 @@ export default { background-image: url('/assets/oboz.webp'); } -.no-webp .oboz-widget { - background-image: url('/assets/oboz.jpg'); -} - .oboz-widget { width: 100%; margin-top: 50px; padding: 80px 20%; + background-image: url('/assets/oboz.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; diff --git a/modernizr.config.json b/modernizr.config.json new file mode 100644 index 0000000..69deea9 --- /dev/null +++ b/modernizr.config.json @@ -0,0 +1,9 @@ +{ + "minify": true, + "options": [ + "setClasses" + ], + "feature-detects": [ + "test/img/webp" + ] +} diff --git a/static/modernizr.js b/static/modernizr.js new file mode 100644 index 0000000..30fc39e --- /dev/null +++ b/static/modernizr.js @@ -0,0 +1,3 @@ +/*! modernizr 3.8.0 (Custom Build) | MIT * + * https://modernizr.com/download/?-webp-setclasses !*/ +!function(n,e,A){function o(n,e){return typeof n===e}function t(n){var e=f.className,A=Modernizr._config.classPrefix||"";if(u&&(e=e.baseVal),Modernizr._config.enableJSClass){var o=new RegExp("(^|\\s)"+A+"no-js(\\s|$)");e=e.replace(o,"$1"+A+"js$2")}Modernizr._config.enableClasses&&(n.length>0&&(e+=" "+A+n.join(" "+A)),u?f.className.baseVal=e:f.className=e)}function a(n,e){if("object"==typeof n)for(var A in n)r(n,A)&&a(A,n[A]);else{n=n.toLowerCase();var o=n.split("."),i=Modernizr[o[0]];if(2===o.length&&(i=i[o[1]]),void 0!==i)return Modernizr;e="function"==typeof e?e():e,1===o.length?Modernizr[o[0]]=e:(!Modernizr[o[0]]||Modernizr[o[0]]instanceof Boolean||(Modernizr[o[0]]=new Boolean(Modernizr[o[0]])),Modernizr[o[0]][o[1]]=e),t([(e&&!1!==e?"":"no-")+o.join("-")]),Modernizr._trigger(n,e)}return Modernizr}var i=[],s={_version:"3.8.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(n,e){var A=this;setTimeout(function(){e(A[n])},0)},addTest:function(n,e,A){i.push({name:n,fn:e,options:A})},addAsyncTest:function(n){i.push({name:null,fn:n})}},Modernizr=function(){};Modernizr.prototype=s,Modernizr=new Modernizr;var r,l=[],f=e.documentElement,u="svg"===f.nodeName.toLowerCase();!function(){var n={}.hasOwnProperty;r=o(n,"undefined")||o(n.call,"undefined")?function(n,e){return e in n&&o(n.constructor.prototype[e],"undefined")}:function(e,A){return n.call(e,A)}}(),s._l={},s.on=function(n,e){this._l[n]||(this._l[n]=[]),this._l[n].push(e),Modernizr.hasOwnProperty(n)&&setTimeout(function(){Modernizr._trigger(n,Modernizr[n])},0)},s._trigger=function(n,e){if(this._l[n]){var A=this._l[n];setTimeout(function(){var n;for(n=0;n<A.length;n++)(0,A[n])(e)},0),delete this._l[n]}},Modernizr._q.push(function(){s.addTest=a}),Modernizr.addAsyncTest(function(){function n(n,e,A){function o(e){var o=!(!e||"load"!==e.type)&&1===t.width;a(n,"webp"===n&&o?new Boolean(o):o),A&&A(e)}var t=new Image;t.onerror=o,t.onload=o,t.src=e}var e=[{uri:"data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=",name:"webp"},{uri:"data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==",name:"webp.alpha"},{uri:"data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA",name:"webp.animation"},{uri:"data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=",name:"webp.lossless"}],A=e.shift();n(A.name,A.uri,function(A){if(A&&"load"===A.type)for(var o=0;o<e.length;o++)n(e[o].name,e[o].uri)})}),function(){var n,e,A,t,a,s,r;for(var f in i)if(i.hasOwnProperty(f)){if(n=[],e=i[f],e.name&&(n.push(e.name.toLowerCase()),e.options&&e.options.aliases&&e.options.aliases.length))for(A=0;A<e.options.aliases.length;A++)n.push(e.options.aliases[A].toLowerCase());for(t=o(e.fn,"function")?e.fn():e.fn,a=0;a<n.length;a++)s=n[a],r=s.split("."),1===r.length?Modernizr[r[0]]=t:(Modernizr[r[0]]&&(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean)||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=t),l.push((t?"":"no-")+r.join("-"))}}(),t(l),delete s.addTest,delete s.addAsyncTest;for(var c=0;c<Modernizr._q.length;c++)Modernizr._q[c]();n.Modernizr=Modernizr}(window,document); \ No newline at end of file |