@@ -28,23 +28,12 @@ export class ProgressiveImage extends React.Component<ProgressiveImageProps & Di
2828
2929 render ( ) {
3030 const { src, style, background} = this . props ;
31- return (
32- < div >
33- < style > { `
34- @-webkit-keyframes blur {
35- 0% { -webkit-filter: blur(10px); }
36- 100% { -webkit-filter: blur(0); }
37- }
38- ` } </ style >
39- {
40- background ?
41- < div style = { assign ( this . getBackgroundStyle ( ) , style ) } { ...this . clonedProps } />
42- :
43- < img src = { src } style = { assign ( this . getStyle ( ) , style ) } { ...this . clonedProps } />
44- }
45-
46- </ div >
47- ) ;
31+ return
32+ background ?
33+ < div style = { assign ( this . getBackgroundStyle ( ) , style ) } { ...this . clonedProps } />
34+ :
35+ < img src = { src } style = { assign ( this . getStyle ( ) , style ) } { ...this . clonedProps } />
36+ ;
4837 }
4938
5039 private cloneProps ( ) {
@@ -57,8 +46,7 @@ export class ProgressiveImage extends React.Component<ProgressiveImageProps & Di
5746 const { blur} = this . state ;
5847 return {
5948 filter : `blur(${ blur } px)` ,
60- animation : "blur 400ms" ,
61- animationTimingFunction : "ease"
49+ transition : "blur 500ms ease"
6250 } ;
6351 }
6452
@@ -67,8 +55,7 @@ export class ProgressiveImage extends React.Component<ProgressiveImageProps & Di
6755 return {
6856 backgroundImage : `url(${ src } )` ,
6957 filter : `blur(${ blur } px)` ,
70- animation : "blur 400ms" ,
71- animationTimingFunction : "ease"
58+ transition : "blur 500ms ease"
7259 } ;
7360 }
7461}
0 commit comments