In the example below, I created what I am trying to achieve.
I added the hover effect on the circles and then I used transform: scale(1.1); to fill in the gaps between the large circle and the ones on its side.
This one looks good when I resize the circle from 100px to 200px, but I need to make it work in any size. I used only css, but you can use JS to get the sizes and everything. I have a feeling that some trigonometry formula is needed but I have no clue how to approach it.
Thanks!
.circles {
display: flex;
}
.circles__item {
height: 100px;
width: 100px;
background: limegreen;
border-radius: 50%;
transform: scale(1);
transform-origin: top center;
transition: all 500ms ease-out;
}
.circles__item:hover {
transform: scale(1.1);
width: 200px;
height: 200px;
background-color: rebeccapurple;
}
<div class="circles">
<div class="circles__item"></div>
<div class="circles__item"></div>
<div class="circles__item"></div>
<div class="circles__item"></div>
<div class="circles__item"></div>
</div>