Item animations
by Csaba Hellinger
HTML
<div class="item item-font">
<div class="footer">
<div class="title title-font">Title</div>
<div class="metadata metadata-font">Metadata</div>
</div>
</div>
CSS
.item {
width: 200px;
height: 200px;
background: lightgreen;
position: relative;
overflow: hidden;
}
.footer {
position: absolute;
bottom: -1.5rem; /*metadata height*/
width: 100%;
transition: bottom 100ms ease-in-out;
}
.item:hover .footer {
bottom: 0;
}
.title {
background: green;
}
.metadata {
background: skyblue;
}
/* --------------------------------- */
.item-font {
font-size: 16px;
}
.title-font {
font-size: 150%;
font-weight: 600;
padding: 0.4rem;
}
.metadata-font {
height: 1.5rem;
line-height: 1.5rem;
padding: 0 0.4rem;
box-sizing: content-box;
}