Fade from image -> movie, instead of harsh change
We put it on top, then fade it out!
This commit is contained in:
parent
e2aeb90b4b
commit
7a8c5068a7
1 changed files with 18 additions and 14 deletions
|
@ -233,25 +233,29 @@ function OutfitMovieLayer({
|
|||
|
||||
return (
|
||||
<Grid templateAreas="single-shared-area">
|
||||
{!movieIsLoaded && (
|
||||
// While the movie is loading, we show our image version as a
|
||||
// placeholder, because it generally loads much faster.
|
||||
// TODO: Show a loading indicator for this partially-loaded state?
|
||||
<canvas
|
||||
ref={canvasRef}
|
||||
width={internalWidth}
|
||||
height={internalHeight}
|
||||
style={{
|
||||
width: width,
|
||||
height: height,
|
||||
gridArea: "single-shared-area",
|
||||
}}
|
||||
/>
|
||||
{/* While the movie is loading, we show our image version as a
|
||||
* placeholder, because it generally loads much faster.
|
||||
* TODO: Show a loading indicator for this partially-loaded state? */}
|
||||
<Box
|
||||
as="img"
|
||||
src={safeImageUrl(placeholderImageUrl)}
|
||||
width={width}
|
||||
height={height}
|
||||
gridArea="single-shared-area"
|
||||
opacity={movieIsLoaded ? 0 : 1}
|
||||
transition="opacity 0.2s"
|
||||
onLoad={callOnLoadIfNotYetCalled}
|
||||
/>
|
||||
)}
|
||||
<canvas
|
||||
ref={canvasRef}
|
||||
width={internalWidth}
|
||||
height={internalHeight}
|
||||
style={{ width: width, height: height, gridArea: "single-shared-area" }}
|
||||
/>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue