Gallery · 27 of 33
Expanding Card
Content expands and pushes image
<div class="expanding-card">
<img src="https://picsum.photos/id/180/800/600" alt="Expand">
<div class="card-info">
<h3>Title</h3>
<p>Description goes here</p>
</div>
</div>
.expanding-card {
position: relative;
width: 400px;
aspect-ratio: 4 / 3;
overflow: hidden;
border-radius: 12px;
background: #12121a;
}
.expanding-card img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-info {
position: absolute;
bottom: 0; left: 0;
width: 100%;
padding: 1rem;
box-sizing: border-box;
background: #12121a;
font-family: system-ui, sans-serif;
color: #f0f0f5;
transform: translateY(100%);
transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-info h3 { margin: 0; font-size: 1rem; }
.card-info p { margin: 0.25rem 0 0; font-size: 0.8rem; color: #6b6b80; }
.expanding-card:hover img {
transform: translateY(-20px) scale(0.9);
}
.expanding-card:hover .card-info {
transform: translateY(0);
}