Socket
Socket
Sign inDemoInstall

react-progressive-image-loading

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-progressive-image-loading - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

6

build/index.d.ts

@@ -9,2 +9,4 @@ /// <reference types="react" />

background?: boolean;
transitionTime?: number;
timingFunction?: string;
}

@@ -17,2 +19,6 @@ export interface ProgressiveImageState {

private clonedProps;
static defaultProps: {
transitionTime: number;
timingFunction: string;
};
componentWillMount(): void;

@@ -19,0 +25,0 @@ render(): JSX.Element;

23

build/index.js

@@ -33,5 +33,8 @@ "use strict";

var _a = this.props, src = _a.src, preview = _a.preview;
this.setState({ src: preview, blur: 10 });
this.setState({ src: "", blur: 10 });
this.cloneProps();
fetch(src).then(function () { return _this.setState({ src: src, blur: 0 }); });
fetch(preview)
.then(function () { return _this.setState({ src: preview, blur: 10 }); })
.then(function () { return fetch(src); })
.then(function () { return _this.setState({ src: src, blur: 0 }); });
};

@@ -52,19 +55,23 @@ ProgressiveImage.prototype.render = function () {

ProgressiveImage.prototype.getStyle = function () {
var _a = this.props, transitionTime = _a.transitionTime, timingFunction = _a.timingFunction;
var blur = this.state.blur;
return {
filter: "blur(" + blur + "px)",
transition: "filter 500ms ease"
transition: "filter " + transitionTime + "ms " + timingFunction
};
};
ProgressiveImage.prototype.getBackgroundStyle = function () {
var _a = this.state, src = _a.src, blur = _a.blur;
return {
backgroundImage: "url(" + src + ")",
filter: "blur(" + blur + "px)",
transition: "filter 500ms ease"
var src = this.state.src;
var style = {
backgroundImage: "url(" + src + ")"
};
return lodash_1.assign(style, this.getStyle());
};
return ProgressiveImage;
}(React.Component));
ProgressiveImage.defaultProps = {
transitionTime: 500,
timingFunction: "ease"
};
exports.ProgressiveImage = ProgressiveImage;
//# sourceMappingURL=index.js.map
{
"name": "react-progressive-image-loading",
"version": "1.0.4",
"version": "1.0.5",
"description": "Progressively load images using a blur effect. Edit",

@@ -5,0 +5,0 @@ "main": "build/index.js",

@@ -5,1 +5,7 @@ # React Progressive Image Loading

[![CircleCI](https://circleci.com/gh/wcandillon/react-progressive-image-loading.svg?style=svg)](https://circleci.com/gh/wcandillon/react-progressive-image-loading)
## Installation
```bash
$ npm install react-progressive-image-loading --save
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc