У меня круглая кнопка дыхания click me
внизу, здесь я использую @keyframes
, чтобы оживить дыхание кнопки - пока все хорошо!
Но, как вы можете сказать, текст click me
дрожит во время анимации дыхания.
Есть ли способ избежать этого?
.centered {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%)
}
button.circle {
--startSize: 65vh;
--endSize: 85vh;
width: var(--startSize);
height: var(--startSize);
background: teal;
border-radius: 100%;
animation-name: breathe;
animation-play-state: running;
animation-duration: 4.5s;
animation-iteration-count: infinite;
animation-direction: alternate;
border: none;
}
@keyframes breathe {
0% {
width: var(--startSize);
height: var(--startSize);
}
25% {
width: var(--startSize);
height: var(--startSize);
}
75% {
width: var(--endSize);
height: var(--endSize);
}
100% {
width: var(--endSize);
height: var(--endSize);
}
}
<a href="https://www.w3schools.com"><button class="circle centered">Click me</button></a>