پیشنمایش زنده
کد HTML
<section class="container">
<div class="card">
<div class="content">
<p class="logo">Digital Way</p>
<div class="h6">Data & Infrastructure Agility</div>
<div class="hover_content">
<p>mParticle’s customer data platform empowers you to Integrate all of your data and orchestrate it across channels, partners, and systems.</p>
</div>
</div>
</div>
</section>
کد CSS
.container {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.card {
position: relative;
display: flex;
justify-content: center;
cursor: pointer;
width: 22em;
max-width: 80%;
padding: 2em 0;
background: #FFF;
box-shadow: 0 0 6px 0 rgba(32, 32, 36, 0.12);
transition: all 0.35s ease;
}
.card::before, .card::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
background: orange;
height: 4px;
}
.card::before {
width: 0;
opacity: 0;
transition: opacity 0 ease, width 0 ease;
transition-delay: 0.5s;
}
.card::after {
width: 100%;
background: white;
transition: width 0.5s ease;
}
.card .content {
width: 18em;
max-width: 80%;
}
.card .logo {
margin: 0 0 1em;
width: 10.625em;
transition: all 0.35s ease;
}
.card .h6 {
color: #999;
font-weight: 600;
text-transform: uppercase;
margin: 0;
letter-spacing: 2px;
}
.card .hover_content {
overflow: hidden;
max-height: 0;
transform: translateY(1em);
transition: all 0.55s ease;
}
.card .hover_content p {
margin: 1.5em 0 0;
color: #6E6E70;
line-height: 1.4em;
}
.card:hover {
width: 24em;
box-shadow: 0 10px 20px 0 rgba(32, 32, 36, 0.12);
}
.card:hover::before {
width: 100%;
opacity: 1;
transition: opacity 0.5s ease, width 0.5s ease;
transition-delay: 0;
}
.card:hover::after {
width: 0;
opacity: 0;
transition: width 0 ease;
}
.card:hover .logo {
margin-bottom: 0.5em;
}
.card:hover .hover_content {
max-height: 10em;
transform: none;
}