File tree Expand file tree Collapse file tree 4 files changed +35
-1
lines changed Expand file tree Collapse file tree 4 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 1+ import  React ,  {  useState ,  useRef  }  from  "react" ; 
2+ 
3+ function  ProgressiveImage ( props ) { 
4+  const  [ highResImageLoaded ,  handlehighResImageLoaded ]  =  useState ( false ) ; 
5+  const  highResImage  =  useRef ( null ) ; 
6+ 
7+  const  overlayStyles  =  { 
8+  position : "absolute" , 
9+  filter : "blur(1px)" , 
10+  transition : "opacity ease-in 1000ms" , 
11+  clipPath : "inset(0)" 
12+  } ;  
13+  const  {  overlaySrc,  alt,  src }  =  props ; 
14+  return  ( 
15+  < span > 
16+  < img 
17+  onLoad = { ( )  =>  { 
18+  handlehighResImageLoaded ( true ) 
19+  } } 
20+  ref = { highResImage } 
21+  src = { src } 
22+  alt = { alt } 
23+  /> 
24+  < img 
25+  className = { ` ${ overlayStyles }  } 
26+  { ...highResImageLoaded  &&  {  style : {  opacity : "0"  }  } } 
27+  src = { overlaySrc } 
28+  alt = { alt } 
29+  /> 
30+  </ span > 
31+  ) ;  
32+ } 
33+ 
34+ export  default  ProgressiveImage ; 
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import theme from '../../style/theme';
33
44const  HeaderStyle  =  style . div ` 
55 height: 80vh; 
6-  background: url("https://phandroid.s3.amazonaws.com/wp-content/uploads/2014/05/rainbow-nebula .jpg") repeat; 
6+  background: url("/image/header-bg .jpg") repeat; 
77 background-size: cover; 
88 background-position: bottom; 
99 position: relative; 
                         You can’t perform that action at this time. 
           
                  
0 commit comments