vue-progressive-image
Advanced tools
Comparing version 1.0.2 to 1.0.3
/*! | ||
* vue-progressive-image v1.0.2 | ||
* vue-progressive-image v1.0.3 | ||
* (c) 2017 Matteo Gabriele | ||
@@ -121,5 +121,3 @@ * Released under the ISC License. | ||
image.onload = function () { | ||
setTimeout(function () { | ||
_this2.image = _this2.source; | ||
}, 2000); | ||
_this2.image = _this2.source; | ||
}; | ||
@@ -126,0 +124,0 @@ |
/*! | ||
* vue-progressive-image v1.0.2 | ||
* vue-progressive-image v1.0.3 | ||
* (c) 2017 Matteo Gabriele | ||
@@ -125,5 +125,3 @@ * Released under the ISC License. | ||
image.onload = function () { | ||
setTimeout(function () { | ||
_this2.image = _this2.source; | ||
}, 2000); | ||
_this2.image = _this2.source; | ||
}; | ||
@@ -130,0 +128,0 @@ |
/*! | ||
* vue-progressive-image v1.0.2 | ||
* vue-progressive-image v1.0.3 | ||
* (c) 2017 Matteo Gabriele | ||
* Released under the ISC License. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.VueProgressiveImage=t()}(this,function(){"use strict";function e(e,t){if("undefined"==typeof document)return t;e=e||"";var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");return r.type="text/css",r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e)),n.appendChild(r),t}var t='<div :class="style.component">\n <div :style="wrapperStyle">\n <transition :enter-class="style.enter" :enter-active-class="style.before">\n <img v-if="shouldImageRender" :class="style.image" :src="image" :alt="alt">\n </transition>\n <img v-if="shouldPlaceholderRender" :class="style.placeholder" :style="placeholderStyle" :src="placeholderImage">\n </div>\n</div>\n',n=e("._component_1rttq_1 {\n position: relative;\n overflow: hidden;\n}\n\n._image_1rttq_6 {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 1;\n transition: opacity 1s;\n backface-visibility: hidden;\n}\n\n._before_1rttq_16 {\n opacity: 1;\n}\n\n._enter_1rttq_20 {\n opacity: 0;\n}\n\n._placeholder_1rttq_24 {\n z-index: 0;\n\n /* this is needed so Safari keeps sharp edges */\n transform: scale(1)\n}\n",{component:"_component_1rttq_1",image:"_image_1rttq_6",before:"_before_1rttq_16",enter:"_enter_1rttq_20",placeholder:"_placeholder_1rttq_24 _image_1rttq_6"}),r=function(e,r){return{name:"progressive-image",template:t,props:{source:{type:String,required:!0},placeholder:{type:String,required:!1},blur:{type:Number,required:!1},alt:{type:String,required:!1}},data:function(){return{options:r,style:n,defaultBlur:5,image:null,placeholderImage:null,aspectRatio:56.25}},computed:{shouldPlaceholderRender:function(){return this.placeholderImage},shouldImageRender:function(){return this.image},wrapperStyle:function(){return{paddingBottom:this.aspectRatio+"%"}},placeholderStyle:function(){var e=this.blur||this.options.blur||this.defaultBlur;return 0===e?{}:{filter:"blur("+e+"px)"}}},created:function(){this.handleImageLoading()},methods:{defineAspectRatio:function(e){var t=this,n=setInterval(function(){if(e.naturalWidth){clearInterval(n);var r=e.naturalHeight,i=e.naturalWidth;t.aspectRatio=r/i*100}},100)},loadImage:function(){var e=this,t=new Image;this.defineAspectRatio(t),t.onload=function(){setTimeout(function(){e.image=e.source},2e3)},t.src=this.source},loadPlaceholder:function(){var e=this;if(this.placeholder||this.options.placeholder){var t=new Image,n=this.placeholder;this.options.placeholder&&!this.placeholder&&(n=this.options.placeholder),t.onload=function(){e.placeholderImage=n},t.src=n}},handleImageLoading:function(){this.loadPlaceholder(),this.loadImage()}}}},i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component("progressive-image",r(e,t))},o={install:i};return o}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.VueProgressiveImage=t()}(this,function(){"use strict";function e(e,t){if("undefined"==typeof document)return t;e=e||"";var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");return r.type="text/css",r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e)),n.appendChild(r),t}var t='<div :class="style.component">\n <div :style="wrapperStyle">\n <transition :enter-class="style.enter" :enter-active-class="style.before">\n <img v-if="shouldImageRender" :class="style.image" :src="image" :alt="alt">\n </transition>\n <img v-if="shouldPlaceholderRender" :class="style.placeholder" :style="placeholderStyle" :src="placeholderImage">\n </div>\n</div>\n',n=e("._component_1rttq_1 {\n position: relative;\n overflow: hidden;\n}\n\n._image_1rttq_6 {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 1;\n transition: opacity 1s;\n backface-visibility: hidden;\n}\n\n._before_1rttq_16 {\n opacity: 1;\n}\n\n._enter_1rttq_20 {\n opacity: 0;\n}\n\n._placeholder_1rttq_24 {\n z-index: 0;\n\n /* this is needed so Safari keeps sharp edges */\n transform: scale(1)\n}\n",{component:"_component_1rttq_1",image:"_image_1rttq_6",before:"_before_1rttq_16",enter:"_enter_1rttq_20",placeholder:"_placeholder_1rttq_24 _image_1rttq_6"}),r=function(e,r){return{name:"progressive-image",template:t,props:{source:{type:String,required:!0},placeholder:{type:String,required:!1},blur:{type:Number,required:!1},alt:{type:String,required:!1}},data:function(){return{options:r,style:n,defaultBlur:5,image:null,placeholderImage:null,aspectRatio:56.25}},computed:{shouldPlaceholderRender:function(){return this.placeholderImage},shouldImageRender:function(){return this.image},wrapperStyle:function(){return{paddingBottom:this.aspectRatio+"%"}},placeholderStyle:function(){var e=this.blur||this.options.blur||this.defaultBlur;return 0===e?{}:{filter:"blur("+e+"px)"}}},created:function(){this.handleImageLoading()},methods:{defineAspectRatio:function(e){var t=this,n=setInterval(function(){if(e.naturalWidth){clearInterval(n);var r=e.naturalHeight,i=e.naturalWidth;t.aspectRatio=r/i*100}},100)},loadImage:function(){var e=this,t=new Image;this.defineAspectRatio(t),t.onload=function(){e.image=e.source},t.src=this.source},loadPlaceholder:function(){var e=this;if(this.placeholder||this.options.placeholder){var t=new Image,n=this.placeholder;this.options.placeholder&&!this.placeholder&&(n=this.options.placeholder),t.onload=function(){e.placeholderImage=n},t.src=n}},handleImageLoading:function(){this.loadPlaceholder(),this.loadImage()}}}},i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component("progressive-image",r(e,t))},o={install:i};return o}); |
{ | ||
"name": "vue-progressive-image", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Vue progressive image loading plugin", | ||
@@ -5,0 +5,0 @@ "main": "dist/vue-progressive-image.js", |
@@ -82,1 +82,6 @@ # vue-progressive-image | ||
``` | ||
# Issues and features requests | ||
Please drop an issue, if you find something that doesn't work, or a feature request at https://github.com/MatteoGabriele/vue-progressive-image/issues | ||
Follow me on twitter [@matteo_gabriele](https://twitter.com/matteo_gabriele) |
@@ -93,5 +93,3 @@ import template from './progressive-image.html' | ||
image.onload = () => { | ||
setTimeout(() => { | ||
this.image = this.source | ||
}, 2000) | ||
this.image = this.source | ||
} | ||
@@ -98,0 +96,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1399395
87
728