I managed to rotate four images around a circular border and stop one image at every 45-degree angle. However, I am struggling to enlarge the image that stops at 90 degrees on the website while still showing the content of the respective image when it reaches that angle. Can someone provide a solution using HTML, CSS, and JavaScript?
HTML code
<div id="parent-circle">
<div class="circle blue">vinay</div>
<div class="circle pink">vinay</div>
<div class="circle lime">vinay</div>
<div class="circle orange">vinay</div>
</div>
<div class="mt-5 content pt-2">
<h1>Health Record</h1>
<p class="w-75">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Dolorum, doloremque!</p>
</div>
body {
width: 90vw;
height: 90vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
body #parent-circle {
position: relative;
width: 20vw;
height: 20vw;
border: 0.4vw solid rgba(0, 0, 0, 0.4);
border-radius: 50%;
transform: rotate(0deg);
transition: transform 0.7s linear;
animation: rotate 14s infinite linear;
}
body #parent-circle .circle {
display: block;
position: absolute;
width: 30%;
height: 30%;
margin: -14%;
border-radius: 50%;
top: 50%;
left: 50%;
}
body #parent-circle .circle.blue {
background-color: #416ba9;
transform: translate(10vw);
-webkit-animation: 25s linear infinite reverse spin_1;
-moz-animation: 25s linear infinite reverse spin_1;
-ms-animation: 25s linear infinite reverse spin_1;
animation: 25s linear infinite reverse spin_1;
}
body #parent-circle .circle.pink {
background-color: #e6427a;
transform: rotate(90deg) translate(10vw) rotate(-90deg);
-webkit-animation: 25s linear infinite reverse spin_1;
-moz-animation: 25s linear infinite reverse spin_1;
-ms-animation: 25s linear infinite reverse spin_1;
animation: 25s linear infinite reverse spin_1;
}
body #parent-circle .circle.lime {
background-color: #cddb00;
transform: rotate(180deg) translate(10vw) rotate(-180deg);
-webkit-animation: 25s linear infinite reverse spin_1;
-moz-animation: 25s linear infinite reverse spin_1;
-ms-animation: 25s linear infinite reverse spin_1;
animation: 25s linear infinite reverse spin_1;
}
body #parent-circle .circle.orange {
background-color: #e0592a;
transform: rotate(270deg) translate(10vw) rotate(-270deg);
-webkit-animation: 25s linear infinite reverse spin_1;
-moz-animation: 25s linear infinite reverse spin_1;
-ms-animation: 25s linear infinite reverse spin_1;
animation: 25s linear infinite reverse spin_1;
}
.content {
margin-left: 20%;
}
@keyframes example {
0% {
width: 30%;
height: 30%;
}
100% {
width: 60%;
height: 60%;
}
}
@keyframes rotate {
0% {
-webkit-transform: rotate(0deg);
}
12.5% {
-webkit-transform: rotate(90deg)
}
25% {
-webkit-transform: rotate(90deg);
}
37.5% {
-webkit-transform: rotate(180deg);
}
50% {
-webkit-transform: rotate(180deg);
}
62.5% {
-webkit-transform: rotate(270deg);
}
75% {
-webkit-transform: rotate(270deg);
}
87.5% {
-webkit-transform: rotate(360deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
CSS CODE