@substrate-system/image
Version:
An image component
56 lines (48 loc) • 888 B
CSS
.placeholder {
display: inline-block;
min-width: 50px;
min-height: 50px;
background-color: #f6f6f6;
background-size: cover;
background-repeat: no-repeat;
position: relative;
overflow: hidden;
}
.placeholder img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
img.sharp {
opacity: 0;
}
img.sharp.loaded {
opacity: 1;
animation: sharpen 0.6s both;
}
.blurry {
filter: blur(30px);
}
@keyframes sharpen {
from {
filter: blur(30px);
}
to {
filter: blur(0px)
}
}
.placeholder, .non-blurry-wrapper, .image {
display: inline-block;
height: 50vw;
width: 50vw;
}
:is(.non-blurry-wrapper,.image) img {
object-fit: cover;
width: 100%;
height: 100%;
}
:is(.blur-test,.non-blurry-image,.image) img {
object-fit: cover;
}