50 lines
969 B
CSS
50 lines
969 B
CSS
.block {
|
|
position: relative;
|
|
overflow: hidden;
|
|
aspect-ratio: 1.334;
|
|
}
|
|
|
|
.block:focus {
|
|
outline: 4px solid var(--color-black);
|
|
}
|
|
|
|
.media {
|
|
transition: transform 0.15s ease-in;
|
|
}
|
|
|
|
.body {
|
|
visibility: hidden;
|
|
transition: visibility 1ms linear 0.15s;
|
|
}
|
|
|
|
.content {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-between;
|
|
padding: var(--spacing-sm) var(--spacing-xs);
|
|
color: var(--color-white);
|
|
text-align: center;
|
|
background-color: rgba(0, 0, 0, 0.25);
|
|
transform: translate3d(0, calc(100% - 58px), 0);
|
|
transition: transform 0.15s ease-in, background-color 0.3s ease-in;
|
|
}
|
|
|
|
@media (hover: hover) and (pointer: fine) {
|
|
.block:hover .content {
|
|
background-color: rgba(0, 0, 0, 0.65);
|
|
transform: translate3d(0, 0, 0);
|
|
}
|
|
.block:hover .media {
|
|
transform: scale(1.05);
|
|
}
|
|
.block:hover .body {
|
|
visibility: visible;
|
|
transition: none;
|
|
}
|
|
}
|