I have some code which displays 4 images as segments within a circle gallery. How can I split the circle into 12 images instead of 4? I tried to add one more part with div but every new image was placed outside of the circle gallery.
Please tell me how I can work with this or if I should try another way to achieve the desired outcome. If there is another way I would appreciate it if you guide me there.
* {
box-sizing: border-box;
}
body{
align-items: center;
background-color: #333;
display: flex;
height: 100vh;
justify-content: center;
}
.gallery {
display: flex;
flex-wrap: wrap;
min-height: 500px;
min-width: 500px;
transform: rotate(45deg);
}
.photo {
position: relative;
background-size: cover;
flex: 50%;
overflow: hidden;
transition: transform .3s ease-out;
}
img {
position: absolute;
top: -190px;
left: -90px;
transform: rotate(-45deg);
}
.photo-1 {
border-top-left-radius: 100%;
}
.photo-1:hover {
transform: translate(-25px, -25px) scale(1.08);
}
.photo-2 {
border-top-right-radius: 100%;
}
.photo-2:hover {
transform: translate(25px, -25px) scale(1.08);
}
.photo-3 {
border-bottom-left-radius: 100%;
}
.photo-3:hover {
transform: translate(-25px, 25px) scale(1.08);
}
.photo-4 {
border-bottom-right-radius: 100%;
}
.photo-4:hover {
transform: translate(25px, 25px) scale(1.08);
}
.photo-5{
border-top-left-radius: 100%;
}
.photo-5:hover {
transform: translate(25px, 25px) scale(1.08);
}
<div class="gallery">
<div class="photo photo-1">
<img src="https://images.unsplash.com/photo-1461534204375-bd3ba51cca78?w=500&h=500&q=80&fit=crop" alt="" />
</div>
<div class="photo photo-2">
<img src="https://images.unsplash.com/photo-1423483641154-5411ec9c0ddf?w=500&h=500&q=80&fit=crop" alt="" />
</div>
<div class="photo photo-3">
<img src="https://images.unsplash.com/photo-1464454709131-ffd692591ee5?w=500&h=500&q=80&fit=crop" alt="" />
</div>
<div class="photo photo-4">
<img src="https://images.unsplash.com/photo-1479064578521-1eebbb96eca1?w=500&h=500&q=80&fit=crop" alt="" />
</div>
</div>