From 6f5d5569ef1042bd3a643f341d938761d5a397e1 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Sat, 4 Jan 2020 15:40:37 +0100 Subject: Add modernizr --- app.html | 1 + components/JoinUs.vue | 5 +---- components/ObozWidget.vue | 5 +---- modernizr.config.json | 9 +++++++++ static/modernizr.js | 3 +++ 5 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 modernizr.config.json create mode 100644 static/modernizr.js diff --git a/app.html b/app.html index 90f5368..e1236b9 100644 --- a/app.html +++ b/app.html @@ -3,6 +3,7 @@ {{ HEAD }} + {{ 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