[TASK] progressive loaded images

This commit is contained in:
TLRZ Seyfferth
2020-05-07 18:54:10 +02:00
parent 2cd70552b0
commit 03ebd97cd0
4 changed files with 116 additions and 41 deletions
@@ -17,6 +17,64 @@ main {
flex: 1 0 auto;
}
.progressive {
position: relative;
display: block;
overflow: hidden;
outline: none
}
.progressive img {
display: block;
width: 100%;
max-width: none;
height: auto;
border: 0
}
.progressive img.preview {
filter: blur(2vw);
transform: scale(1.05)
}
.progressive img.reveal {
position: absolute;
left: 0;
top: 0;
will-change: transform, opacity;
animation: progressiveReveal 1s ease-out
}
@keyframes progressiveReveal {
0% {
transform: scale(1.05);
filter: blur(20px);
opacity: 0
}
to {
transform: scale(1);
filter: none;
opacity: 1
}
}
picture {
width: 100%;
/* stretch to fit its containing element */
overflow: hidden;
}
picture img {
width: 100%;
/* stretch to fill the picture element */
transition: filter .5s;
}
picture.lazy img {
filter: blur(20px);
}
/*
header,
main,