I am in the process of designing a webpage that will showcase 5 rounded components, each with different sizes, arranged in a semi-circle pattern. I have included an image to give an idea of how I want the layout to appear, with placeholder circles indicating where custom images will be placed. The plan is to dynamically load the images through JavaScript and Angular, hence why I have currently defined them in the HTML.
At the moment, I am manually rounding the edges of the images, adjusting their sizes individually, and using 'transform: translate(x,y)' to position them in a semi-circle formation. However, this method lacks flexibility, as resizing the images would entail recalculating the positioning for a circle shape.
This is the current code snippet I am working with:
<div class="round top1st" style="background-image: url('image1.png');"></div>
<div class="round top2nd" style="background-image: url('image2.png');"></div>
.
.
.
.round {
border-radius:50% 50% 50% 50%;
overflow: hidden;
background-position: center center;
background-repeat: no-repeat;
background-size:cover;
}
.top1st {
width: 180px;
height: 180px;
transform: translate(0px,300px);
}
.top2nd {
width: 150px;
height: 150px;
transform: translate(100px, -30px);
}
.
.
.
Is there a more efficient approach to achieve this? It's important to note that the circular images will vary in size and will be loaded dynamically from a database query using Angular on the client-side.