JSFiddle - React, Tailwind, and code Playground
by Liane Stevenson
HTML
<div class="circle-outer">
<a href="https://www.w3schools.com"><button class="circle">Click me</button></a>
</div>
CSS
body, html {
height: 100%;
display: grid;
}
.circle-outer {
margin: auto;
text-align: center;
}
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);
}
}