Подскажите как поправить то что анимация для фона , обратно меняется резко. И вообще может быть подобную анимацию можно добиться как-нибудь более просто?
* {
margin: 0;
padding: 0;
text-decoration: none;
box-sizing: border-box;
font-family: 'Comfortaa', cursive;
}
html,
body {
max-width: 100%;
height: 100%;
}
.cards {
height: 400px;
display: flex;
flex-direction: row;
justify-content: space-between;
overflow: auto;
gap: 10px;
}
.card {
position: relative;
width: 399px;
overflow: hidden;
background: red;
}
.card:after {
content: "";
margin: 0;
background: white;
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
border-radius: 100%;
width: 0;
height: 0;
}
.card__text {
position: absolute;
padding: 10px;
font-size: 20px;
transform: translate(0px, 420px);
transition: transform .5s ease .5s;
z-index: 2;
}
.card__title {
position: relative;
font-size: 25px;
z-index: 2;
}
.card:hover .card__text {
transform: translate(0px, 0px);
}
.card:hover::after {
animation: circle 1s forwards;
}
@keyframes circle {
0% {
}
100% {
width: 600px;
height: 600px;
}
}
<div class="cards">
<div class="card">
<div class="card__title">Lorem</div>
<div class="card__text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div>
</div>
<div class="card">
<div class="card__title">Lorem</div>
<div class="card__text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div>
</div>
<div class="card">
<div class="card__title">Lorem</div>
<div class="card__text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div>
</div>
</div>